segments module

class segments.LIGOLWContentHandler(document, start_handlers={})[source]

Bases: LIGOLWContentHandler

startColumn(parent, attrs)
startStream(parent, attrs, __orig_startStream=<function LIGOLWContentHandler.startStream>)
startTable(parent, attrs, __orig_startTable=<function use_in.<locals>.startTable>)
segments.analysis_segments(ifos: Iterable[str], allsegs: segmentlistdict, boundary_seg: segment, start_pad: float = 0.0, overlap: float = 0.0, min_instruments: int = 1, one_ifo_length: float = 28800.0) segmentlistdict[source]

Generate all disjoint detector combination segments for analysis job boundaries.

segments.query_dqsegdb_segments(instruments: Iterable, start: Union[int, LIGOTimeGPS], end: Union[int, LIGOTimeGPS], flags: Union[str, Mapping], server: str = 'https://segments.ligo.org') segmentlistdict[source]

Query DQSegDB for science segments.

Args:
instruments:

Union[str, Iterable], the instruments to query segments for

start:

Union[int, LIGOTimeGPS], the GPS start time

end:

Union[int, LIGOTimeGPS], the GPS end time

flags:

Union[str, Mapping], the name of the DQ flags used to query

server:

str, defaults to main DQSegDB server, the server URL

Returns:

segmentlistdict, the queried segments

segments.query_dqsegdb_veto_segments(instruments: Iterable, start: Union[int, LIGOTimeGPS], end: Union[int, LIGOTimeGPS], veto_definer_file: str, category: str, cumulative: bool = True, server: str = 'https://segments.ligo.org') segmentlistdict[source]

Query DQSegDB for veto segments.

Args:
instruments:

Union[str, Iterable], the instruments to query segments for

start:

Union[int, LIGOTimeGPS], the GPS start time

end:

Union[int, LIGOTimeGPS], the GPS end time

veto_definer_file:

str, the veto definer file in which to query veto segments for

category:

the veto category to use for vetoes, one of CAT1, CAT2, CAT3

cumulative:

whether veto categories are cumulative, e.g. choosing CAT2 also includes CAT1 vetoes

server:

str, defaults to main DQSegDB server, the server URL

Returns:

segmentlistdict, the queried veto segments

segments.query_gwosc_segments(instruments: Iterable, start: Union[int, LIGOTimeGPS], end: Union[int, LIGOTimeGPS], verify_certs: bool = True) segmentlistdict[source]

Query GWOSC for science segments.

Args:
instruments:

Union[str, Iterable], the instruments to query segments for

start:

Union[int, LIGOTimeGPS], the GPS start time

end:

Union[int, LIGOTimeGPS], the GPS end time

verify_certs:

bool, default True, whether to verify SSL certificates when querying GWOSC.

Returns:

segmentlistdict, the queried segments

segments.query_gwosc_veto_segments(instruments: Iterable, start: Union[int, LIGOTimeGPS], end: Union[int, LIGOTimeGPS], category: str, cumulative: bool = True, verify_certs: bool = True) segmentlistdict[source]

Query GWOSC for veto segments.

Args:
instruments:

Union[str, Iterable], the instruments to query segments for

start:

Union[int, LIGOTimeGPS], the GPS start time

end:

Union[int, LIGOTimeGPS], the GPS end time

category:

the veto category to use for vetoes, one of CAT1, CAT2, CAT3

cumulative:

whether veto categories are cumulative, e.g. choosing CAT2 also includes CAT1 vetoes

verify_certs:

bool, default True, whether to verify SSL certificates when querying GWOSC.

Returns:

segmentlistdict, the queried veto segments

segments.split_segment(seg: segment, maxextent: float, overlap: float) segmentlist[source]

Split a segment into segments of maximum extent.

segments.split_segments(seglist: segmentlist, maxextent: float, overlap: float) segmentlist[source]

Split a segmentlist into segments of maximum extent.

segments.split_segments_by_lock(ifos: Iterable, seglistdicts: segmentlistdict, boundary_seg: segment, max_time: float = 864000.0) segmentlist[source]

Split segments into segments with maximum time and boundaries outside of lock stretches.