query_segments

dqsegdb2.query.query_segments(flag, start, end, host='https://segments.ligo.org', coalesce=True)

Query for segments for the given flag in a [start, stop) interval

Parameters:
flag : str

the name for which to query, see _Notes_ for information on how versionless-flags are queried.

start : int

the GPS start time.

end : int

the GPS end time.

host : str, optional

the URL of the database, defaults to DEFAULT_SEGMENT_SERVER.

coalesce : bool, optional

if True coalesce the segmentlists returned by the server, otherwise return the ‘raw’ result, default: True.

Returns:
segmentdict : dict

a dict with the following keys

  • 'ifo' - the interferometer prefix (str)
  • 'name' - the flag name (str)
  • 'version' - the flag version (int)
  • 'known' - the known segments (segmentlist)
  • 'active' - the active segments (segmentlist)
  • 'metadata' - a dict of flag information (dict)
  • 'query_information' - a dict of query information (dict)

Notes

If flag is given without a version (e.g. 'X1:FLAG-NAME') or the version is given as '*' (e.g. 'X1:FLAG-NAME:*') the result of the query will be the intersection of queries over all versions found in the database. In that case the 'metadata' and 'query_information' in the output will be preserved for the highest version number only.

Examples

>>> from dqsegdb2.query import query_segments
>>> query_segments('G1:GEO-SCIENCE:1', 1000000000, 1000001000)