gwdetchar.saturation.core module

Utilies for analysing sensor saturations

gwdetchar.saturation.core._find_saturations(data)[source]

Thin wrapper around find_saturations

gwdetchar.saturation.core.find_limit_channels(channels, skip=None)[source]

Find all ‘LIMIT’ channels that have a matching ‘LIMEN’ or ‘SWSTAT’

Parameters:
channelslist of str

the list of channel names to search

Returns:
limitslist or str

the list of channels whose name ends in ‘_LIMIT’ for whom a matching channel ending in ‘_LIMEN’ or ‘_SWSTAT’ was found

gwdetchar.saturation.core.find_saturations(timeseries, limit=65536, precision=1, segments=False)[source]

Find the times of software saturations of the given TimeSeries

Parameters:
timeseriesTimeSeries

the input data to search

limitfloat, TimeSeries

the limit above which a saturation has occurred

precisionfloat in range (0, 1]

the precision of the check for saturation

segmentsbool, default: False

return saturation segments, otherwise return times when saturations occur

Returns:
timesnumpy.ndarray

the array of times when this timeseries started saturating, OR

segmentsDataQualityFlag

the flag containing segments during which this timeseries was actively saturating

gwdetchar.saturation.core.grouper(iterable, n, fillvalue=None)[source]

Separate an iterable into sub-sets of n elements

gwdetchar.saturation.core.is_saturated(channel, cache, start=None, end=None, indicator='LIMEN', nproc=2)[source]

Check whether a channel has saturated its software limit

Parameters:
channelstr, or list of str

either a single channel name, or a list of channel names

cachelist

a list of file paths, the cache must be contiguous

startLIGOTimeGPS, int

the GPS start time of the check

endLIGOTimeGPS, int

the GPS end time of the check

indicatorstr

the suffix of the indicator channel, either 'LIMEN' or 'SWSTAT'

nprocint

the number of parallel processes to use for frame reading

Returns:
saturatedbool, None, or DataQualityFlag, or list of the same

one of the following given the conditions - None : if the channel doesn’t have a software limit - False : if the channel didn’t saturate - DataQualityFlag : otherwise OR, a list of the above if a list of channels was given in the first place