BaseEssRule#
- class lsst.ts.watcher.BaseEssRule(*, config, name, topic_attr_name, field_name, sensor_info_name, big_is_bad, is_indexed, units, value_format='0.2f', log=None)#
Bases:
PollingRuleCheck one kind of ESS data, e.g. temperature or humidity.
- Parameters:
config (struct) –
Rule configuration. The following fields are read:
warning_level :
float|NoneWarning level. None to not use this level.serious_level :
float|NoneSerious level. None to not use this level.critical_level :
float|NoneCritical level. None to not use this level.warning_period :
floatPeriod [s] after which the warning alarm will be raised.serious_period :
floatPeriod [s] after which the serious alarm will be raised.critical_period :
floatPeriod [s] after which the critical alarm will be raised.hysteresis :
floatThe amount by which the measurement must decrease below (or increase above ifbig_is_badfalse) a severity level, before alarm severity is decreased.{sensor_info_name} A field whose name is given by
sensor_info_namethat contains information about the sensors to read. A list of dicts whose format depends on is_indexed. If is_indexed false, the fields are:sal_index : int SAL index of topic.
sensor_names : list[str] A list of sensor names.
If is_indexed true, the fields are:
sal_index : int SAL index of topic.
sensor_info : list[dict[str, str | list[int]]] A list of topic-specific sensor info with fields:
sensor_name : str Name of sensor.
indices : list[int], optional Indices of field to read. If omitted then read all non-nan values.
warning_msg :
str, optional The first part of the reason string for a warning alarm. This should say what the operators should do.serious_msg :
str, optional The first part of the reason string for a serious alarm. This should say what the operators should do.critical_msg :
str, optional The first part of the reason string for a critical alarm. This should say what the operators should do.
- name
str The name of the rule.
- topic_attr_name
str The attr name of the ESS telemetry topic, e.g. “tel_temperature” or “tel_relativeHumidity”.
- field_name
str The name of the ESS topic field, e.g. “temperatureItem” or “humidity”.
- sensor_info_name
str Name of sensor info field in
config.- is_indexed
bool Is the field indexed? This controls the format of sensor info in the config.
- units
str Units of measurement.
- value_format
str, optional Format for float value (threshold level or measured value) without a leading colon, e.g. “0.2f”
- log
logging.Logger, optional Parent logger.
- PollingRule attributes
All attributes from
PollingRule, plus:
- field_wrappers#
Wrappers for ESS telemetry fields.
- Type:
- threshold_handler#
Threshold handler for ESS data.
- Type:
Notes
This uses
FilteredEssFieldWrapperand its kin, because ESS data must be filtered by the value of thesensorNamefield (and index, if the data is array-valued).Methods Summary
Compute and set alarm severity and reason.
setup(model)Create filtered topic wrappers
Methods Documentation
- compute_alarm_severity()#
Compute and set alarm severity and reason.
- Parameters:
**kwargs (
dict[str,typing.Any]) –Keyword arguments. If triggered by
TopicCallbackcallingupdate_alarm_severity, the arguments will be as follows:data :
salobj.BaseMsgTypeMessage from the topic described by topic_callback.topic_callback :
TopicCallbackTopic callback wrapper.
- Return type:
- Returns:
None, if no change or unknown, or a tuple of two values
severity (
lsst.ts.xml.enums.Watcher.AlarmSeverity) – The new alarm severity.reason (
str) – Detailed reason for the severity, e.g. a string describing what value is out of range, and what the range is. IfseverityisNONEthen this value is ignored (but still required) and the old reason is retained until the alarm is reset tonominalstate.
Notes
You may return
NoneNoReasonif the alarm state isNONE.