igwn_ligolw.utils.segments Module

Tools for interacting with segment lists in LIGO Light-Weight XML files.

LIGO Light-Weight XML files allow for the encoding of segment lists. Each segment list is a collection of intervals each of which is in one of three states: on, off, or undefined. The segment lists are encoded as tabular data using three tables: (i) the segment_definer table which provides the names, versions, instruments, and descriptions of each of the segment lists; (ii) the segment table which provides a collection of (start, stop) pairs defining “on” segments; and (iii) the segment_summary table which provides a collection of (start, stop) pairs defining the intervals for which a segment list’s state is defined.

To interact with the segment lists in an XML file, an instance of the LigolwSegments class is attached to an XML document tree, at which time it removes all rows from the segment, segment_definer, and segment_summary tables in the document, converting them into LigolwSegmentList objects. These objects can be manipulated algebraically using the rules of Kleene’s strong ternerary logic. When the desired manipulations are complete, the LigolwSegments is detached from the XML document at which time it re-populates the segment, segment_definer, and segment_summary tables from the contents of the LigolwSegmentList objects within it.

Only one LigolwSegments object may be attached to an XML document at a time. Attempting to attach multiple LigolwSegments objects to the same XML tree yields undefined results.

Functions

has_segment_tables(xmldoc[, name])

Return True if the document contains a complete set of segment tables.

segmenttable_get_by_name(xmldoc, name)

Retrieve the segmentlists whose name equals name.

Classes

LIGOLWContentHandler(document[, start_handlers])

ContentHandler class for parsing LIGO Light Weight documents with a SAX2-compliant parser.

LigolwSegmentList([active, valid, ...])

A description of a LIGO Light-Weight XML segment list.

LigolwSegments(xmldoc[, process])

An interface shim between code that makes use of segments in ligo.segments form, and LIGO Light-Weight XML I/O code.

Class Inheritance Diagram

Inheritance diagram of igwn_ligolw.utils.segments.LigolwSegmentList, igwn_ligolw.utils.segments.LigolwSegments