plesty.pm100d.sensors
What the sensor head fitted to a PM100D can and cannot be asked.
The meter’s SCPI vocabulary is fixed; what it can answer is not. A silicon
photodiode has no pyroelectric element and no temperature probe, so
MEAS:ENER? and MEAS:TEMP? are simply never answered. That silence is
worse than an error: the transport reads it as a wedged instrument and
escalates through a device clear and a session reopen, and repeating it wedges
the meter for real.
So the gaps are recorded per sensor in sensor_capabilities.json and looked
up at runtime, rather than hardcoded into whatever happens to be attached
today.
Attributes
Functions
|
Return the sensor capability map, keyed by sensor name. |
|
Return the operations sensor cannot perform. |
|
Return the parameter ranges sensor actually accepts. |
|
Return the sensor names with a recorded entry. |
|
Read the fitted sensor's name from a connected device. |
Module Contents
- plesty.pm100d.sensors._CAPABILITIES_FILE
- plesty.pm100d.sensors.DEFAULT_KEY = '_default'
- plesty.pm100d.sensors.load_capabilities() dict[str, Any]
Return the sensor capability map, keyed by sensor name.
- Returns:
The parsed document. Keys beginning with
_are metadata, exceptDEFAULT_KEYwhich is the fallback entry.- Return type:
dict[str, Any]
- plesty.pm100d.sensors.unsupported_ops(sensor: str | None) list[str]
Return the operations sensor cannot perform.
- Parameters:
sensor (str | None) – Sensor name as reported by
SYST:SENS:IDN?, orNonewhen it could not be read.- Returns:
Operation names to keep away from this sensor. An unknown sensor gets the conservative default — the union of every known head’s gaps — because driving an unanswerable query is what wedges the meter.
- Return type:
list[str]
- plesty.pm100d.sensors.param_limits(sensor: str | None) dict[str, tuple[float, float]]
Return the parameter ranges sensor actually accepts.
The schema carries the console-wide envelope on purpose — the same module serves every head — so the fitted sensor’s narrower limits belong here and are applied at connect.
- Parameters:
sensor (str | None) – Sensor name as reported by
SYST:SENS:IDN?.- Returns:
{parameter: (min, max)}, empty when nothing is recorded for this head. An unrecorded sensor keeps the console envelope rather than inheriting another head’s limits.- Return type:
dict[str, tuple[float, float]]
- plesty.pm100d.sensors.known_sensors() list[str]
Return the sensor names with a recorded entry.
- Return type:
list[str]
- plesty.pm100d.sensors.read_sensor_name(device: Any) str | None
Read the fitted sensor’s name from a connected device.
- Parameters:
device (Any) – A connected PM100D device.
- Returns:
The sensor name (the first field of
SYST:SENS:IDN?), orNonewhen it cannot be read — in which case callers should fall back to the conservative default rather than assume the sensor is capable.- Return type:
str | None