StateVectorDict#

class gwpy.timeseries.StateVectorDict[source]#

Bases: TimeSeriesBaseDict

Key-value mapping of named StateVector objects.

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() and fetch() data access methods.

Attributes Summary

get

Retrieve StateVector data for multiple channels.

read

Read data into a StateVectorDict.

write

Write this StateVectorDict to a file.

Attributes Documentation

get#

Retrieve StateVector data for multiple channels.

This method attemps to get data any way it can, potentially iterating over multiple available data sources.

Parameters:
channelslist

Required data channels.

startLIGOTimeGPS, float, str

GPS start time of required data, any input parseable by to_gps is fine

endLIGOTimeGPS, float, str

GPS end time of required data, any input parseable by to_gps is fine

sourcestr, list, list of dict.

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,

  • list of dict - a list of source specifications to try in order; each dict must 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.

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:
sourcestr, list

Source of data, any of the following:

  • str path of single data file,

  • str path of LAL-format cache file,

  • list of paths.

namesSequence of str or Channel

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.

startLIGOTimeGPS, float, str, optional

GPS start time of required data, defaults to start of data found; any input parseable by to_gps is fine.

endLIGOTimeGPS, float, str, optional

GPS end time of required data, defaults to end of data found; any input parseable by to_gps is fine.

formatstr, optional

Source format identifier. If not given, the format will be detected if possible. See below for list of acceptable formats.

parallelint, optional

Number of parallel processes to use, serial process by default.

padfloat, optional

Value with which to fill gaps in the source data, by default gaps will result in a ValueError.

gapstr, 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.

Raises:
IndexError

If source is an empty list.

write#

Write this StateVectorDict to 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.

Parameters:
targetstr

output filename

formatstr, optional

output format identifier. If not given, the format will be detected if possible. See below for list of acceptable formats.