llama.files.lvc_gcn_xml module

Class for saving, parsing, and conveniently retrieving data from VOEvent XML files distributed by the GCN network and created by LVC describing GW triggers. Includes functionality work with multiple schemas of LVC VOEvents from the Advanced LIGO era.

class llama.files.lvc_gcn_xml.LVCGcnXml

Bases: llama.filehandler.EventTriggeredFileHandler

A VOEvent XML file received from GCN corresponding to an LVC event notice.

alert_type

Get the alert type for this VOEvent.

event_time_gps

Get the time of the observed event up to nanosecond precision (less accurate than this in practice) in GPS time format.

event_time_gps_nanoseconds

Get the number of nanoseconds past the last GPS second at the time of the observed event. Ostensibly provides nanosecond precision, but is less accurate than this in practice.

event_time_gps_seconds

Get the time of the observed event in GPS seconds (truncated to the nearest second).

event_time_mjd

Get the time of the observed event in UTC MJD format.

event_time_str

Get a unicode string with the ISO date and time of the observed event straight from the VOEvent file. UTC time.

far

Get the false alarm rate of this VOEvent as a float value.

get_alert_type()

Read the alert type of this GCN Notice.

get_param(param)

Get this VOEventParam for this event.

graceid

Get the GraceID corresponding to this VOEvent.

notice_time_str

Get a unicode string with the date and time of creation of the notification associated with this VOEvent, rather than the time of detection of the event itself. Should be in ISO format.

pipeline

Return an ALL-CAPS name of the pipeline used to generate this event, e.g. GSTLAL or CWB.

role

Get the role of this VOEvent as specified in the header.

skymap_filename

Get the filename for this skymap as it appears on GraceDB.

class llama.files.lvc_gcn_xml.LVCInitialXml

Bases: llama.files.lvc_gcn_xml.LVCGcnXml

digraph "llama.files.lvc_gcn_xml.LVCInitialXml" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.lvc_gcn_xml.LVCInitialXml" [label=<{{<B>LVCInitialXml</B>|<I>lvc_initial.xml</I>|LVCGcnXml}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_gcn_xml.html#llama.files.lvc_gcn_xml.LVCInitialXml", fillcolor="#cccccc"]; }

llama.files.lvc_gcn_xml.LVCInitialXml is created from external triggers. It therefore has no LLAMA-representable input dependencies, but instead acts as initial input for other FileHandler classes.

A VOEvent XML file received from GCN corresponding to an LVC_INITIAL event notice.

FILENAME = 'lvc_initial.xml'
MANIFEST_TYPES = (<class 'llama.files.lvc_gcn_xml.LVCInitialXml'>,)
UR_DEPENDENCIES = ()
UR_DEPENDENCY_TREE = ImmutableDict({})
alert_type

Get the alert type for this VOEvent FileHandler type.

class llama.files.lvc_gcn_xml.LVCPreliminaryXml

Bases: llama.files.lvc_gcn_xml.LVCGcnXml

digraph "llama.files.lvc_gcn_xml.LVCPreliminaryXml" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.lvc_gcn_xml.LVCPreliminaryXml" [label=<{{<B>LVCPreliminaryXml</B>|<I>lvc_preliminary.xml</I>|LVCGcnXml}}>, shape="record", style=filled, target=_top, URL="/llama.files.lvc_gcn_xml.html#llama.files.lvc_gcn_xml.LVCPreliminaryXml", fillcolor="#cccccc"]; }

llama.files.lvc_gcn_xml.LVCPreliminaryXml is created from external triggers. It therefore has no LLAMA-representable input dependencies, but instead acts as initial input for other FileHandler classes.

A VOEvent XML file received from GCN corresponding to an LVC_PRELIMINARY event notice.

FILENAME = 'lvc_preliminary.xml'
MANIFEST_TYPES = (<class 'llama.files.lvc_gcn_xml.LVCPreliminaryXml'>,)
UR_DEPENDENCIES = ()
UR_DEPENDENCY_TREE = ImmutableDict({})
alert_type

Get the alert type for this VOEvent FileHandler type.

llama.files.lvc_gcn_xml.get_filename_from_group(filename, paramname)

old VOEvent format had the skymap URL buried in a Param which itself is contained in a group:

VOEvent/What/Group/Param

This is mostly the same as get VOEventParam in utils and is rewritten here only to add support for an edge case.

llama.files.lvc_gcn_xml.get_filename_from_group_name(filename, grouptypename, paramname)

some stupid VOEvent format has things nested under filter(lambda a: a[‘type’] == ‘GW_SKYMAP’, event.voe_VOEvent.What.Group)[0] so go ahead and look under different group type names to find the right skymap URL.

llama.files.lvc_gcn_xml.get_filename_from_param(filename, paramname)

get the skymap URL for newer style VOEvents, which have the skymap param directly under the What element:

VOEvent/What/Param
llama.files.lvc_gcn_xml.get_skymap_filename(filename)

Get the skymap URL regardless of the current VOEvent format from the VOEvent file with the given filename.