igwn_segments.utils

This module provides additional utilities for use with igwn_segments.

Functions

Fold(seglist1, seglist2)

An iterator that generates the results of taking the intersection of seglist1 with each segment in seglist2 in turn.

S2playground(extent)

Return a segmentlist identifying the S2 playground times within the interval defined by the segment extent.

from_bitstream(bitstream, start, dt[, minlen])

Convert consecutive True values in a bit stream (boolean-castable iterable) to a stream of segments.

from_range_strings(ranges[, boundtype])

Parse a list of ranges expressed as strings in the form "value" or "first:last" into an equivalent igwn_segments.segmentlist.

fromfilenames(filenames[, coltype])

Return a segmentlist describing the intervals spanned by the files whose names are given in the list filenames.

fromlalcache(cachefile[, coltype])

Construct a segmentlist representing the times spanned by the files named in the LAL cache contained in the file object cachefile.

fromsegwizard(fileobj[, coltype, strict])

Read a segmentlist from the file object fileobj containing a segwizard compatible segment list.

fromtama(fileobj[, coltype])

Read a segmentlist from the file object fileobj containing TAMA locked-segments data.

segmentlist_range(start, stop, period)

Analogous to Python's range() builtin, this generator yields a sequence of continuous adjacent segments each of length "period" with the first starting at "start" and the last ending not after "stop".

segmentlistdict_from_short_string(s[, boundtype])

Parse a string representation of a set of named segmentlists into a segmentlistdict object.

segmentlistdict_to_short_string(seglists)

Return a string representation of a segmentlistdict object.

to_range_strings(seglist)

Turn a segment list into a list of range strings as could be parsed by from_range_strings().

tosegwizard(fileobj, seglist[, header, coltype])

Write the segmentlist seglist to the file object fileobj in a segwizard compatible format.

vote(seglists, n)

Given a sequence of segmentlists, returns the intervals during which at least n of them intersect.