gwdetchar.utils module¶
Utility methods
- gwdetchar.utils.natural_sort(ls, key=<class 'str'>)[source]¶
Sort a list the way that humans expect.
This differs from the built-in
sorted
method by building a custom key to sort numeric parts by value, not by character content, so that ‘2’ gets sorted before ‘10’, for example.
- gwdetchar.utils.table_from_segments(flagdict, sngl_burst=False, snr=10.0, frequency=100.0)[source]¶
Build an
EventTable
from aDataQualityDict
- gwdetchar.utils.table_from_times(times, names=('time', 'frequency', 'snr'), snr=10.0, frequency=100.0, **kwargs)[source]¶
Build an
EventTable
from aDataQualityDict
- Parameters:
- times
numpy.ndarray
a 1D array of GPS times
- names
tuple
,list
, optional the list of names to use
- snr
float
, optional the SNR to assign to all ‘event triggers’
- frequency
float
, optional the frequency to assign to all ‘event triggers’
- **kwargs
other keyword arguments to pass to the
EventTable
constructor
- times
- Returns:
- table
EventTable
a new table filled with events at the given times
- table