MTAOSLag#

class lsst.ts.watcher.rules.MTAOSLag(config, log=None)#

Bases: BaseRule

Monitor the lag of MTAOS.

If the lag is too high, raise an alarm. The lag is defined as the difference between the current visit ID and the visit ID of the last degree of freedom change. This only is important when in the closed loop. In open loop, the lag is not relevant.

Parameters:

Notes

The alarm name is “MTAOSLag”.

The current visitId is retrieved from the MTCamera CSC endReadout event. The visitId equals imageDate + imageNumber with the image date multiplied by 1e5 so a 13-digit int (converted from float) is obtained.

The MTAOS visitId is retrieved from the degreeOfFreedom event as an int.

Methods Summary

compute_alarm_severity(**kwargs)

Compute and set alarm severity and reason.

get_schema()

Return a jsonschema as a dict, to validate configuration.

Methods Documentation

compute_alarm_severity(**kwargs)#

Compute and set alarm severity and reason.

Parameters:

**kwargs (dict [str, typing.Any]) –

Keyword arguments. If triggered by TopicCallback calling update_alarm_severity, the arguments will be as follows:

  • data : salobj.BaseMsgType Message from the topic described by topic_callback.

  • topic_callback : TopicCallback Topic callback wrapper.

Return type:

tuple[AlarmSeverity, str] | None

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. If severity is NONE then this value is ignored (but still required) and the old reason is retained until the alarm is reset to nominal state.

Notes

You may return NoneNoReason if the alarm state is NONE.

classmethod get_schema()#

Return a jsonschema as a dict, to validate configuration.

Notes

Please provide default values for all fields for which defaults make sense. This makes watcher configuration files easier to write.

If your rule has no configuration then return None.

We recommend that you write the schema as yaml, for compactness, then use yaml.safe_load to convert it to a dict. For example:

schema_yaml = """
    $schema: http://json-schema.org/draft-07/schema#
    description: Configuration for MyRule
    type: object
    properties:
    ...
    required: [...]
    additionalProperties: false
"""
return yaml.safe_load(schema_yaml)