snews_cs.cs_alert_schema

Classes

CoincidenceTierAlert

The Message scheme for the alert and observations

Module Contents

class snews_cs.cs_alert_schema.CoincidenceTierAlert(env_path=None)[source]

The Message scheme for the alert and observations

Parameters:

env_path (str, optional) – The path containing the environment configuration file If None, uses the default file in ‘/etc/test-config.env’

id_format(num_detectors)[source]
Returns formatted message ID

time format should always be same for all detectors. num_detectors: int

Number of detectors in the alert. If more than 2, it is an update to an earlier alert, and will be appended with -UPDATE_ string

Returns
:str

The formatted id as a string

get_cs_alert_schema(data, is_test=False)[source]

Create a message schema for alert. Internally called in hop_pub

Parameters:

data (named tuple) – cs_utils data tuple with predefined field.

Returns:

message with the correct scheme

Return type:

dict