declare_measurement_point
Define a measurement point's context—bearing, design speed, ISO group, expected unit, sensor, and direction—so health snapshots and vibration diagnostics apply the correct defaults.
Instructions
Declare the context of a measurement point in the local asset ledger.
The declaration is what the health snapshots and diagnose_vibration
default to for every measurement of the point: the bearing at the
point (bearing_id from the verified catalog, or fault_orders as
multiples of the shaft frequency: BPFO, BPFI, BSF, FTF), the design
speed nominal_rpm (distinct from the rpm a measurement declares, which
wins when present), the ISO 20816-3 machine_group and support_type
(undeclared means no ISO block, never a silent default), the rated
power, and what the point expects of its measurements: signal unit,
sensor and direction (a measurement contradicting them is excluded
from the trend, one omitting them is qualified).
Versioned per point: a re-declaration that changes nothing appends
nothing and returns the current version; one that changes a value
appends the next version and reports the changed keys. Measurements
whose snapshot was computed with a previous context are counted in
measurements_with_stale_context together with the exact
assess_asset_change(..., reprocess=True) call that recomputes them (a
note-only change makes nothing stale).
Args:
ctx: MCP context. Unused, see this module's docstring on logging.
asset_id: The asset (letters, digits, '_', '-', '.', starting with
a letter or digit; case-sensitive).
measurement_point_id: The point on the asset (same grammar).
bearing_id: Catalog designation of the bearing at the point.
fault_orders: {label: order} with labels BPFO, BPFI, BSF, FTF and
orders in multiples of the shaft frequency (e.g. BPFO 3.58).
machine_group: ISO 20816-3 group, 1 (large) or 2 (medium).
support_type: 'rigid' or 'flexible'.
machine_power_kw: Rated power in kW (positive).
expected_signal_unit: Unit the point's measurements are expected in.
expected_sensor_id: Sensor expected at the point (free text, at
most 200 characters, one line).
expected_direction: Expected measurement direction.
nominal_rpm: Design speed of the point in rev/min (positive).
declared_by: Who declares (free text, at most 200 characters).
note: Free-text note (at most 200 characters, one line).
Returns:
MeasurementPointDeclarationResult with the version, whether an
event was appended, the changed keys, the stale-snapshot count and
remedy, the recorded declaration and a summary message.
Raises:
ValueError: Invalid ids, a value outside its vocabulary, a
non-positive number, free text over the limit or with control
characters (one message names every problem), or a ledger
that cannot be read or written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| asset_id | Yes | ||
| bearing_id | No | ||
| declared_by | No | ||
| nominal_rpm | No | ||
| fault_orders | No | ||
| support_type | No | ||
| machine_group | No | ||
| machine_power_kw | No | ||
| expected_direction | No | ||
| expected_sensor_id | No | ||
| expected_signal_unit | No | ||
| measurement_point_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remedy | No | The exact assess_asset_change(..., reprocess=True) call that recomputes the stale snapshots (bounded per call); None when nothing is stale | |
| changed | Yes | Declared keys whose value differs from the previous version (every key declared with a value for version 1; empty when nothing was appended) | |
| message | Yes | One-paragraph summary of the outcome | |
| appended | Yes | True when a new declaration version was appended to the ledger; False when the declaration equals the current version | |
| asset_id | Yes | Asset the point belongs to (ledger id) | |
| event_id | No | Id of the appended ledger event; None when nothing was appended | |
| declaration | Yes | The point declaration as recorded in the ledger: measurement_point_id, declaration_version, bearing_id, fault_orders, machine_group, support_type, machine_power_kw, expected_signal_unit, expected_sensor_id, expected_direction, nominal_rpm (the design speed of the point, distinct from the observed rpm of a measurement), declared_by, note, changed | |
| previous_version | No | Version this declaration supersedes; None for a first declaration | |
| bearing_in_catalog | No | Whether the declared bearing_id is in the verified bearing catalog (a bearing outside it leaves the bearing block of every snapshot missing); None when no bearing_id is declared | |
| declaration_version | Yes | Version of the point's declaration after this call (1-based, per point); unchanged when nothing was appended | |
| measurement_point_id | Yes | The declared point (ledger id) | |
| measurements_with_stale_context | Yes | Recorded measurements of the point that lack a health snapshot computed with the current declared context and the current processing lineage; their existing snapshots are kept |