query_segments

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

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

Parameters:
flag

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

start

the GPS start time.

end

the GPS end time.

host='https://segments.ligo.org'

the URL of the database, defaults to DEFAULT_SEGMENT_SERVER.

coalesce=True

if True, coalesce the segmentlists returned by the server, and restrict them to lie fully within the [start, end) request segment, otherwise return the ‘raw’ result, default: True.

Returns:

segmentdict – 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)

Return type:

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)

Last update: May 23, 2023