WatcherCsc#

class lsst.ts.watcher.WatcherCsc(config_dir=None, initial_state=State.STANDBY, override='')#

Bases: ConfigurableCsc

The Watcher CSC.

Parameters:
  • config_dir (str, optional) – Directory of configuration files, or None for the standard configuration directory (obtained from get_default_config_dir). This is provided for unit testing.

  • initial_state (salobj.State or int, optional) – The initial state of the CSC. This is provided for unit testing, as real CSCs should start up in lsst.ts.salobj.StateSTANDBY, the default.

  • override (str, optional) – Configuration override file to apply if initial_state is State.DISABLED or State.ENABLED.

Raises:

salobj.ExpectedError – If initial_state is invalid.

Attributes Summary

Methods Summary

begin_disable(data)

Begin do_disable; called before state changes.

begin_start(data)

Begin do_start; configure the CSC before changing state.

close_tasks()

Shut down pending tasks.

configure(config)

Configure the CSC.

do_acknowledge(data)

do_makeLogEntry(data)

Make log entry for alarms.

do_mute(data)

Mute one or more alarms.

do_setLogLevel(data)

Set logging level.

do_showAlarms(data)

Show all alarms.

do_unacknowledge(data)

Unacknowledge one or more alarms.

do_unmute(data)

Unmute one or more alarms.

end_enable(data)

End do_enable; called after state changes but before command acknowledged.

evt_alarm_callback(data)

Handle alarm event from alarm subprocesses.

evt_description_callback(data)

Handle description event from alarm subprocesses.

evt_logLevel_callback(data)

Handle logLevel event from the alarm subprocess.

evt_logMessage_callback(data)

Handle logMessage event from the alarm subprocess.

evt_state_callback(data)

Handle state event from alarm subprocesses.

find_remotes_for_rule_regex(name_regex)

Get all remotes whose alarm classnames match the specified regular expression.

get_config_pkg()

Get the name of the configuration package, e.g. "ts_config_ocs".

make_log_entry(log_server_url, name_regex)

MakeLogEntry for alarm.

make_log_entry_for_alarm(log_server_url, alarm)

Post a message to the narrative log entry in response to alarm.

output_alarm(alarm_info[, force_output])

Output the alarm event for one alarm_info instance.

output_alarms()

Output the alarm events for all alarms.

Attributes Documentation

enable_cmdline_state = True#
require_settings = True#
valid_simulation_modes: Sequence[int] = [0]#
version = '2.2.0'#

Methods Documentation

async begin_disable(data)#

Begin do_disable; called before state changes.

Parameters:

data (DataType) – Command data

Return type:

None

async begin_start(data)#

Begin do_start; configure the CSC before changing state.

Parameters:

data (cmd_start.DataType) – Command data

Notes

The override field must be one of:

  • The name of a config label or config file

  • The name and version of a config file, formatted as <file_name>:<version>, where the version is a git reference, such as a git tag or commit hash. This form does not support labels.

async close_tasks()#

Shut down pending tasks. Called by close.

async configure(config)#

Configure the CSC.

Parameters:

config (object) – The configuration, as described by the config schema, as a struct-like object.

Notes

Called when running the start command, just before changing summary state from State.STANDBY to State.DISABLED.

async do_acknowledge(data)#
async do_makeLogEntry(data)#

Make log entry for alarms.

async do_mute(data)#

Mute one or more alarms.

async do_setLogLevel(data)#

Set logging level.

Also set the logging level for all alarm rules.

Parameters:

data (cmd_setLogLevel.DataType) – Logging level.

Return type:

None

async do_showAlarms(data)#

Show all alarms.

async do_unacknowledge(data)#

Unacknowledge one or more alarms.

async do_unmute(data)#

Unmute one or more alarms.

async end_enable(data)#

End do_enable; called after state changes but before command acknowledged.

Parameters:

data (DataType) – Command data

async evt_alarm_callback(data)#

Handle alarm event from alarm subprocesses.

async evt_description_callback(data)#

Handle description event from alarm subprocesses.

async evt_logLevel_callback(data)#

Handle logLevel event from the alarm subprocess.

async evt_logMessage_callback(data)#

Handle logMessage event from the alarm subprocess.

async evt_state_callback(data)#

Handle state event from alarm subprocesses.

async find_remotes_for_rule_regex(name_regex)#

Get all remotes whose alarm classnames match the specified regular expression.

Parameters:

name_regex (str) – Regular expression for alarm classname(s) to match.

Returns:

remotes – A list of remotes.

Return type:

list`[`salobj.Remote]

static get_config_pkg()#

Get the name of the configuration package, e.g. “ts_config_ocs”.

async make_log_entry(log_server_url, name_regex)#

MakeLogEntry for alarm.

Parameters:
  • log_server_url (str) – URL of the narrativelog service.

  • name_regex (str) – Regular expression for alarm name(s) to post to narrative log.

async make_log_entry_for_alarm(log_server_url, alarm)#

Post a message to the narrative log entry in response to alarm.

Parameters:
  • log_server_url (str) – URL of the narrativelog service.

  • alarm (AlarmInfo) – The alarm to make the log entry for.

Returns:

response – JSON response from Post.

Return type:

dict

async output_alarm(alarm_info, force_output=True)#

Output the alarm event for one alarm_info instance.

async output_alarms()#

Output the alarm events for all alarms.