StateVectorDict#
- class gwpy.timeseries.StateVectorDict[source]#
Bases:
TimeSeriesBaseDictKey-value mapping of named
StateVectorobjects.This object is designed to hold data for many different sources (channels) for a single time span. Dictionary keys are ordered by insertion order.
The main entry points for this object are the
read()andfetch()data access methods.Attributes Summary
Retrieve
StateVectordata for multiple channels.Read data into a
StateVectorDict.Write this
StateVectorDictto a file.Attributes Documentation
- get#
Retrieve
StateVectordata for multiple channels.This method attemps to get data any way it can, potentially iterating over multiple available data sources.
- Parameters:
- channels
list Required data channels.
- start
LIGOTimeGPS,float,str GPS start time of required data, any input parseable by
to_gpsis fine- end
LIGOTimeGPS,float,str GPS end time of required data, any input parseable by
to_gpsis fine- source
str,list,listofdict. The data source to use. One of the following formats:
str- the name of a single source to use,list- a list of source names to try in order,listofdict- a list of source specifications to try in order; eachdictmust contain a"source"key giving the name of the source to use, and may contain other keys giving options to pass to the data access function for that source.
See ‘Notes’ section below for valid source names.
- kwargs
Other keyword arguments to pass to the data access function for each data source. See
StateVectorDict.get.help(source=<>)for details on the positional and keyword arguments supported for each data source.
- channels
- read#
Read data into a
StateVectorDict.Arguments and keywords depend on the output format, see the online documentation for full details for each format, the parameters below are common to most formats.
- Parameters:
- source
str,list Source of data, any of the following:
- names
SequenceofstrorChannel A list (or similar) of dataset names to read from
source.When reading from GWF, this argument should specify the names of the channels to read.
When reading from HDF5, this argument should specify the paths or dataset names within the file.
- start
LIGOTimeGPS,float,str, optional GPS start time of required data, defaults to start of data found; any input parseable by
to_gpsis fine.- end
LIGOTimeGPS,float,str, optional GPS end time of required data, defaults to end of data found; any input parseable by
to_gpsis fine.- format
str, optional Source format identifier. If not given, the format will be detected if possible. See below for list of acceptable formats.
- parallel
int, optional Number of parallel processes to use, serial process by default.
- pad
float, optional Value with which to fill gaps in the source data, by default gaps will result in a
ValueError.- gap
str, optional How to handle gaps in the data, one of
- “ignore”
Do nothing, let the underlying reader method handle it.
- “warn”
Do nothing except print a warning to the screen.
- “raise”
Raise an exception upon finding a gap (default).
- “pad”
Insert a value to fill the gaps.
- source
- Raises:
IndexErrorIf
sourceis an empty list.
- write#
Write this
StateVectorDictto a file.Arguments and keywords depend on the output format, see the online documentation for full details for each format, the parameters below are common to most formats.