Skip to content

visualdynamics.core.sensor_catalog

sensor_catalog

The sensors Visual Dynamics can draw by model: simplified bodies built from each outline drawing's dimensions.

A body is described in its own frame. For a triaxial accelerometer the frame is the sensor's X, Y and Z, with the cable or connector on the −X face and Z normal to the mounting base; the X, Y and Z faces carry their letters, as the sensors do. For a uniaxial accelerometer or a force transducer, z is the sensing axis (normal to the mounting base) and the connector or cable is on the +x side. Sizes are the extents of the body alone along x, y and z in millimeters: for a box its sides, for a hex prism the width across the flats twice and then the height, for a puck its diameter twice and then its height, for a teardrop its length, the diameter of its round end and its height, and for a rounded box its length with the round nose, its width and its height. The plug is the connector out of the connector face, the cable what is drawn beyond it, and a force transducer's studs stand out of both ends.

The bodies are drawn only, centered on their node. Nothing here enters the finite element model, the mass properties or a mesh.

Classes:

Name Description
SensorModel

One sensor model's body: what it is, its shape and its size.

Functions:

Name Description
lookup

The catalog entry for a model, ignoring case and spaces; None when

models_for

The catalog's models that measure a channel type: accelerometers

Classes

SensorModel dataclass

SensorModel(model: str, make: str, kind: str, shape: str, size: tuple[float, float, float], mass: float, connector: str, description: str = '', plug: tuple[float, float] = NOTHING, cable: tuple[float, float] = NOTHING, stud: tuple[float, float] = NOTHING)

One sensor model's body: what it is, its shape and its size.

Functions:

lookup

lookup(model: str) -> SensorModel | None

The catalog entry for a model, ignoring case and spaces; None when the model is not in the catalog.

Parameters:

Name Type Description Default
model str

The model as a channel table names it, such as '356A02'.

required

Returns:

Type Description
SensorModel or None
Source code in src/visualdynamics/core/sensor_catalog.py
def lookup(model: str) -> SensorModel | None:
    """The catalog entry for a model, ignoring case and spaces; None when
    the model is not in the catalog.

    Parameters
    ----------
    model : str
        The model as a channel table names it, such as '356A02'.

    Returns
    -------
    SensorModel or None
    """
    return _BY_MODEL.get(_key(model))

models_for

models_for(channel_type: str) -> list[SensorModel]

The catalog's models that measure a channel type: accelerometers for 'acceleration', force transducers for 'force', none otherwise.

Parameters:

Name Type Description Default
channel_type str

A channel table's type, such as 'acceleration'.

required

Returns:

Type Description
list of SensorModel
Source code in src/visualdynamics/core/sensor_catalog.py
def models_for(channel_type: str) -> list[SensorModel]:
    """The catalog's models that measure a channel type: accelerometers
    for 'acceleration', force transducers for 'force', none otherwise.

    Parameters
    ----------
    channel_type : str
        A channel table's type, such as 'acceleration'.

    Returns
    -------
    list of SensorModel
    """
    return [entry for entry in CATALOG
            if MEASURES[entry.kind] == channel_type]