Skip to content

hertzforge.core.sensor_catalog

sensor_catalog

The sensors Hertzforge 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.

A sensor the catalog does not hold is drawn at its size when the size is written where the model would be: Block 17.5 mm for a cube, Block 14 x 10 x 6 mm for a box along x, y and z, Cylinder 16 x 8 mm for a round body by its diameter and height (sized).

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, a make

sized

The body a size written as a model describes, or None when the

size_text

A size as sized reads it, to write where a model would be.

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, a make written in front of it ('PCB 352A71') and a range or sensitivity written after it ('7270A-20K', '7250AM1-10'); 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

sized

sized(model: str, kind: str) -> SensorModel | None

The body a size written as a model describes, or None when the text is not a size.

Parameters:

Name Type Description Default
model str

Block 17.5 mm (a cube), Block 14 x 10 x 6 mm (a box along x, y and z), Cylinder 16 x 8 mm (a diameter and a height along z) or Cylinder 16 mm (as high as it is wide). Case and spacing do not matter.

required
kind str

One of KINDS: what the rows it is on measure.

required

Returns:

Type Description
SensorModel or None

A plain body of that size with no connector, named as written. None for a block given two numbers, a cylinder given three, a size of zero, and a cylinder for a tri-axial accelerometer, whose faces carry its letters.

size_text

size_text(shape: str, size: Sequence[float]) -> str

A size as sized reads it, to write where a model would be.

Parameters:

Name Type Description Default
shape str

'block' or 'cylinder'.

required
size sequence of 3 floats

Millimeters along x, y and z; a cylinder's diameter is its x.

required

Returns:

Type Description
str

Block 17.5 mm, Block 14 x 10 x 6 mm or Cylinder 16 x 8 mm, each number to a hundredth.

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