TimeSeriesDict#

class gwpy.timeseries.TimeSeriesDict[source]#

Bases: TimeSeriesBaseDict

Key-value mapping of named TimeSeries 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 data for multiple names from any data source.

read

Read data into a TimeSeriesDict.

write

Write this TimeSeriesDict to a file.

Attributes Documentation

get#

Retrieve data for multiple names from any data source.

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

Parameters:
nameslist

A list of channel names to find.

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.

frametypestr

Name of frametype in which this channel is stored, by default will search for all required frame types.

padfloat

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

scaledbool

apply slope and bias calibration to ADC data, for non-ADC data this option has no effect.

nprocint, default: 1

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

allow_tapebool, default: None

Allow the use of data files that are held on tape. Default is None to attempt to allow the TimeSeries.fetch method to intelligently select a server that doesn’t use tapes for data storage (doesn’t always work), but to eventually allow retrieving data from tape if required.

verbosebool

This argument is deprecated and will be removed in a future release. Use DEBUG-level logging instead, see Logging with GWpy.

kwargs

Other keyword arguments to pass to the data access function for each data source. See TimeSeriesDict.get.help(source=<>) for details on the positional and keyword arguments supported for each data source.

read#

Read data into a TimeSeriesDict.

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.

Raises:
IndexError

If source is an empty list.

write#

Write this TimeSeriesDict 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.