ATCameraDewar

class lsst.ts.watcher.rules.ATCameraDewar(config)

Bases: lsst.ts.watcher.base_rule.BaseRule

Monitor ATCamera dewar temperatures and vacuum.

Parameters
configtypes.SimpleNamespace

Rule configuration, as validated by the schema.

Raises
jsonschema.ValidationError

If the configuration does not match the schema.

ValueError

If the three threshold levels for a given measurement, e.g. the three min_*_ccd_temp fields, are all null or absent. If you want to suppress all alarms for a measurement, specify an unrealistic value for at least one threshold level for that measurement.

Notes

The alarm name is “ATCameraDewar”.

The rule raises an alarm if any of the following are true:

  • ccd temperature is too low

  • ccd temperature is too high

  • cold plate temperature is too high

  • cryo head temperature is too high

  • vacuum is too soft (pressure is too high)

You may configure up to three severity threshold levels for each of these alarm conditions, but typically you should only specify two: a warning level and either a serious or a critical level.

The vacuum pressure gauge occasionally “burps”, and temperature measurements fluctuate somewhat, so alarm thresholds are based on median values reported within a configurable time window.

Attributes Summary

name

Get the rule name.

Methods Summary

__call__(topic_callback)

Run the rule and return the severity and reason.

get_schema()

Return a jsonschema to validate configuration, as a dict.

is_usable(disabled_sal_components)

Return True if rule can be used, despite disabled SAL components.

no_data_timer()

Timer for no data received.

reset_all()

Reset the alarm, clear the data queue, and restart the no-data timer.

restart_no_data_timer()

Start or restart the no-data timer.

setup(model)

Perform post-constructor setup.

start()

Start any background tasks, such as a polling loop.

stop()

Stop all background tasks.

Attributes Documentation

name

Get the rule name.

Methods Documentation

__call__(topic_callback: lsst.ts.watcher.topic_callback.TopicCallback) lsst.ts.idl.enums.Watcher.AlarmSeverity

Run the rule and return the severity and reason.

Parameters
topic_callbackTopicCallback

Topic callback wrapper.

Returns
A tuple of two values:
severity: lsst.ts.idl.enums.Watcher.AlarmSeverity

The new alarm severity.

reasonstr

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 states is NONE.

To defer setting the alarm state, start a task that calls self.alarm.set_severity later. For example the heartbeat rule’s __call__ method is called when the heartbeat event is seen, and this restarts a timer and returns NoneNoReason. If the timer finishes, meaning the next heartbeat event was not seen in time, the timer sets alarm severity > NONE.

classmethod get_schema() Dict[str, Any]

Return a jsonschema to validate configuration, as a dict.

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)
is_usable(disabled_sal_components)

Return True if rule can be used, despite disabled SAL components.

The default implementation returns true if all remotes used by this rule are enabled. Override if you need something more complicated. The attributes config, name and remote_info_list are all available when this method is called.

Parameters
disabled_sal_componentsset [tuple [str, int]]

Set of disabled SAL components. Each element is a tuple of:

  • SAL component name (e.g. “ATPtg”)

  • SAL index

async no_data_timer()

Timer for no data received.

reset_all()

Reset the alarm, clear the data queue, and restart the no-data timer.

restart_no_data_timer()

Start or restart the no-data timer.

setup(model)

Perform post-constructor setup.

Called after the remotes are constructed and populated with topics, but before the remotes have started.

Parameters
modelModel

The watcher model.

Notes

Possible uses:

  • Rules in which topics and/or fields are specified in configuration should check that the topics and/or fields exist. They may also set variables pointing to the appropriate topics.

  • Rules that start a background process may start the process here rather than in the constructor; this is especially helpful if the process needs access to topics or fields.

Few rules require setup, so the default implemention is a no-op.

start()

Start any background tasks, such as a polling loop.

This is called when the watcher goes into the enabled state.

Notes

Do not assume that start is called before stop; the order depends on the initial state of the Watcher.

Immediate subclasses need not call super().start()

stop()

Stop all background tasks.

This is called when the watcher goes out of the enabled state, and must stop any tasks that might trigger an alarm state change.

Notes

Do not assume that start is called before stop; the order depends on the initial state of the Watcher.

This base implementation does nothing, so immediate subclasses need not call super().stop().