Skip to content

hertzforge.core.multi_point

multi_point

Multi-point control: several control channels combined into one, and the two judgments a test run that way is accepted on.

A random test on one shaker is often controlled at more than one point. The controller combines the control channels' spectra, line by line, into one composite and holds that to the reference; how they are combined is the strategy:

  • 'average', the mean of the channels' densities, each counted alike;
  • 'weighted', the mean with weights chosen for the channels;
  • 'maximum', the highest channel at each line, so nothing sensed exceeds the reference and every other point is under it;
  • 'minimum', the lowest channel at each line, so every point sensed meets the reference and every other point is over it.

The average is taken on the densities themselves, not on their decibels, because that is the arithmetic a controller does. With two channels, one at four times the reference and one at a quarter, the average is just over twice the reference: the hot spot shows, far smaller than it is.

So a run controlled this way has two results, and a report carries both: the composite against the composite band, and each control channel against its own band, which is wider. The second exists because the first can pass with a channel far out. A channel reading near zero inside an average (a dead or loose sensor) leaves the composite in tolerance while the controller drives the live channels up to make up for it, and nothing on the composite says so. The reading here lists, for each channel, the lines where it is outside its own band while the composite is inside its band, which is the fact the composite hides.

Every judgment is compliance.compare and compliance.exceedances, the comparison every other random reading makes: the composite and each channel are compared cell by cell, as areas, against a band around the reference, at the comparison's one scale. Nothing here judges a line by its own rule.

Classes:

Name Description
ChannelReading

One control channel of a multi-point reading, against its own

MultiPointReading

What multi_point read: the composite, its judgment, and each

Functions:

Name Description
composite

The composite of several channels' densities, line by line.

multi_point

Read a multi-point control run: the composite of its control

control_channels

The measured records a multi-point reading combines, by the rule

Classes

ChannelReading dataclass

ChannelReading(label: str, record: int, weight: float, result: dict[str, Any], over: ndarray, under: ndarray, hidden: ndarray, held_lines: int | None = None)

One control channel of a multi-point reading, against its own band.

Attributes:

Name Type Description
outside ndarray

Per line, outside the individual band either way.

outside_lines int

How many lines are outside the individual band.

judged_lines int

How many lines were judged against the individual band: none

hidden_lines int

How many lines are outside the individual band while the

Attributes
outside property
outside: ndarray

Per line, outside the individual band either way.

outside_lines property
outside_lines: int

How many lines are outside the individual band.

judged_lines property
judged_lines: int

How many lines were judged against the individual band: none for a channel with no finite line, which was not judged at all and is never read as inside its band.

hidden_lines property
hidden_lines: int

How many lines are outside the individual band while the composite is inside its own.

MultiPointReading dataclass

MultiPointReading(strategy: str, composite: Psd, spec_record: int, composite_band: Specification, individual_band: Specification, composite_text: str, individual_text: str, result: dict[str, Any], over: ndarray, under: ndarray, channels: tuple[ChannelReading, ...], scale_db: float, notes: tuple[str, ...] = (), chance_share: float | None = None)

What multi_point read: the composite, its judgment, and each channel's.

Attributes:

Name Type Description
outside_lines int

How many lines of the composite are outside its band.

judged_lines int

How many lines of the composite were judged: none when it was

hiding tuple[ChannelReading, ...]

The channels outside their own band at a line where the

Attributes
outside_lines property
outside_lines: int

How many lines of the composite are outside its band.

judged_lines property
judged_lines: int

How many lines of the composite were judged: none when it was formed at no line (a channel with no finite line), in which case nothing was judged and the reading is never a pass.

hiding property
hiding: tuple[ChannelReading, ...]

The channels outside their own band at a line where the composite is inside its band.

Functions:

composite

composite(values: ArrayLike, strategy: str = 'average', weights: ArrayLike | None = None) -> ndarray

The composite of several channels' densities, line by line.

values is (channels, lines), real densities on one set of lines. 'average' and 'weighted' take the weighted mean of the densities (weights normalized to sum to one, equal under 'average'), 'maximum' and 'minimum' the highest and lowest channel at each line.

A line where any channel is not a finite, non-negative number has no composite and is NaN: the composite of these channels was not formed there, and averaging the rest would be a composite of other channels. A channel reading zero is a number and is counted, as a controller counts it, which is what lets a dead channel be found.

Parameters:

Name Type Description Default
values array_like

The densities, one row per channel.

required
strategy str

One of STRATEGIES.

'average'
weights array_like

One per channel, finite and not negative, under 'weighted' only; normalized here.

None

Returns:

Type Description
ndarray

One value per line.

Raises:

Type Description
ValueError

For a strategy not in STRATEGIES, weights under a strategy that takes none or none under 'weighted', or weights that are not one finite, non-negative number per channel with a positive sum.

multi_point

multi_point(specification: Specification, measured: Psd, channels: Sequence[int | str] | None = None, strategy: str = 'average', weights: ArrayLike | None = None, composite_band: str | tuple[float, float] = 'warning', individual_band: str | tuple[float, float] = INDIVIDUAL_DB, spec_record: int | None = None, scale_db: float | None = None, table: Any = None) -> MultiPointReading

Read a multi-point control run: the composite of its control channels against the composite band, and each channel against its own.

The composite is formed line by line (composite) from the control channels' densities and compared with the reference by compliance.compare; each channel is compared the same way against the individual band. A band is a pair of the specification's own limits ('warning' or 'abort'), or a pair of dB below and above the reference, ten log ten on a density (an infinite edge is no edge on that side). For each channel the lines outside its own band are found, and among them those where the composite is inside its band: the lines the composite hides.

The reference is one record of the specification: spec_record when given, the only record when there is one, and otherwise the record each channel pairs with (compliance.matched_records), which must all ask for the same thing, since a composite is held to one reference. The scale is resolved once for every channel, as compliance.compare_all resolves it.

Parameters:

Name Type Description Default
specification Specification

The reference and, where its limits are used, the bands.

required
measured Psd

The run, holding the control channels' autospectra.

required
channels sequence of int or str

The control channels, by record or by response DOF; by default those control_channels finds (the channel table's control channels, else the autospectra that pair with the specification's records). Two or more.

None
strategy str

One of STRATEGIES.

'average'
weights array_like

One per channel, under 'weighted' only.

None
composite_band str or tuple of float

'warning' or 'abort' for that pair of the specification's limits, or (below, above) in dB.

'warning'
individual_band str or tuple of float

'warning' or 'abort' for that pair of the specification's limits, or (below, above) in dB.

'warning'
spec_record int

The reference record, chosen as above when omitted.

None
scale_db float

The comparison's scale; resolved through compliance.comparison_scale_db when omitted.

None
table ChannelTable

The channel table whose Control flags name the control channels when channels is omitted (control_channels).

None

Returns:

Type Description
MultiPointReading

The composite and its judgment, each channel's, and the notes.

Raises:

Type Description
ValueError

With the reason, for anything the reading cannot be made from: a strategy or weights composite refuses, fewer than two channels, a channel named twice, not found, ambiguous or a cross term, channels of different quantities, channels whose specification records differ, a band the specification does not carry or edges on the wrong side of the reference, or a pair compliance.compare refuses (bands of another fraction, another quantity, units declared on one side only).

control_channels

control_channels(specification: Specification, measured: Psd, channels: Sequence[int | str] | None = None, table: Any = None) -> list[int]

The measured records a multi-point reading combines, by the rule multi_point uses: the records named, by index or by response DOF; by default the autospectra at the channels a channel table flags as the specification's loop's control channels (ChannelTable.controls_for), where it flags any; and otherwise the autospectra that pair with the specification's records (compliance.matched_records). The window asks this before it offers the reading, so the reading is offered exactly where it can be made.

Parameters:

Name Type Description Default
specification Specification

The reference the channels pair with.

required
measured Psd

The run.

required
channels sequence of int or str

The channels named; found as above when omitted.

None
table ChannelTable

The channel table whose Control flags say which channels the controller held.

None

Returns:

Type Description
list of int

Two or more records of measured, in the order named (or the table's order).

Raises:

Type Description
ValueError

With the reason, for fewer than two channels, or a channel named twice, not found, ambiguous or a cross term.