gwpy.timeseries.TimeSeriesDict(*args, **kwds)[source]¶Bases: gwpy.timeseries.core.TimeSeriesBaseDict
Ordered key-value mapping of named TimeSeries objects
This object is designed to hold data for many different sources (channels) for a single time span.
The main entry points for this object are the
read() and fetch()
data access methods.
Methods Summary
append(other[, copy]) |
Append the dict other to this one |
clear(() -> None. Remove all items from od.) |
|
copy() |
Return a copy of this dict with each value copied to new memory |
crop([start, end, copy]) |
Crop each entry of this dict |
fetch(channels, start, end[, host, port, …]) |
Fetch data from NDS for a number of channels. |
find(channels, start, end[, frametype, …]) |
Find and read data from frames for a number of channels. |
fromkeys((S[, …) |
If not specified, the value defaults to None. |
get(channels, start, end[, pad, dtype, …]) |
Retrieve data for multiple channels from frames or NDS |
has_key((k) -> True if D has a key k, else False) |
|
items(() -> list of (key, value) pairs in od) |
|
iteritems() |
od.iteritems -> an iterator over the (key, value) pairs in od |
iterkeys(() -> an iterator over the keys in od) |
|
itervalues() |
od.itervalues -> an iterator over the values in od |
keys(() -> list of keys in od) |
|
plot([label]) |
Plot the data for this TimeSeriesBaseDict. |
pop((k[,d]) -> v, …) |
value. If key is not found, d is returned if given, otherwise KeyError |
popitem(() -> (k, v), …) |
Pairs are returned in LIFO order if last is true or FIFO order if false. |
prepend(other, **kwargs) |
Prepend the dict other to this one |
read(source, *args, **kwargs) |
Read data for multiple channels into a TimeSeriesDict |
resample(rate, **kwargs) |
Resample items in this dict. |
setdefault((k[,d]) -> od.get(k,d), …) |
|
update(([E, …) |
If E present and has a .keys() method, does: for k in E: D[k] = E[k] |
values(() -> list of values in od) |
|
viewitems(…) |
|
viewkeys(…) |
|
viewvalues(…) |
|
write(target, *args, **kwargs) |
Write this TimeSeriesDict to a file |
Methods Documentation
append(other, copy=True, **kwargs)[source]¶Append the dict other to this one
| Parameters: | other :
copy :
**kwargs
|
|---|
See also
TimeSeries.appendclear() → None. Remove all items from od.¶crop(start=None, end=None, copy=False)[source]¶Crop each entry of this dict
This method calls the crop() method of all entries and
modifies this dict in place.
| Parameters: | start :
end :
|
|---|
See also
TimeSeries.cropfetch(channels, start, end, host=None, port=None, verify=False, verbose=False, connection=None, pad=None, allow_tape=None, type=None, dtype=None)[source]¶Fetch data from NDS for a number of channels.
| Parameters: | channels :
start :
end :
host :
port :
verify :
verbose :
connection :
allow_tape :
dtype :
|
|---|---|
| Returns: | data :
|
find(channels, start, end, frametype=None, frametype_match=None, pad=None, dtype=None, nproc=1, verbose=False, allow_tape=True, observatory=None, **readargs)[source]¶Find and read data from frames for a number of channels.
| Parameters: | channels :
start :
end :
frametype :
frametype_match :
pad :
dtype :
nproc :
allow_tape :
verbose :
**readargs
|
|---|
fromkeys(S[, v]) → New ordered dictionary with keys from S.¶If not specified, the value defaults to None.
get(channels, start, end, pad=None, dtype=None, verbose=False, allow_tape=None, **kwargs)[source]¶Retrieve data for multiple channels from frames or NDS
This method dynamically accesses either frames on disk, or a remote NDS2 server to find and return data for the given interval
| Parameters: | channels :
start :
end :
frametype :
pad :
dtype :
nproc :
allow_tape :
verbose :
**kwargs
|
|---|
has_key(k) → True if D has a key k, else False¶items() → list of (key, value) pairs in od¶iteritems()¶od.iteritems -> an iterator over the (key, value) pairs in od
iterkeys() → an iterator over the keys in od¶itervalues()¶od.itervalues -> an iterator over the values in od
keys() → list of keys in od¶plot(label='key', **kwargs)[source]¶Plot the data for this TimeSeriesBaseDict.
| Parameters: | label :
**kwargs
|
|---|
pop(k[, d]) → v, remove specified key and return the corresponding¶value. If key is not found, d is returned if given, otherwise KeyError is raised.
popitem() → (k, v), return and remove a (key, value) pair.¶Pairs are returned in LIFO order if last is true or FIFO order if false.
prepend(other, **kwargs)[source]¶Prepend the dict other to this one
| Parameters: | other :
copy :
**kwargs
|
|---|
See also
TimeSeries.prependread(source, *args, **kwargs)[source]¶Read data for multiple channels into a TimeSeriesDict
| Parameters: |
channels :
start :
end :
format :
nproc :
gap :
pad :
|
|---|---|
| Returns: | tsdict :
|
Notes
The available built-in formats are:
| Format | Read | Write | Auto-identify |
|---|---|---|---|
| framecpp | Yes | Yes | No |
| gwf | Yes | Yes | Yes |
| gwf.framecpp | Yes | Yes | No |
| gwf.lalframe | Yes | Yes | No |
| hdf5 | Yes | No | No |
| lalframe | Yes | Yes | No |
resample(rate, **kwargs)[source]¶Resample items in this dict.
This operation over-writes items inplace.
| Parameters: |
**kwargs
|
|---|
setdefault(k[, d]) → od.get(k,d), also set od[k]=d if k not in od¶update([E, ]**F) → None. Update D from mapping/iterable E and F.¶If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values() → list of values in od¶viewitems() → a set-like object providing a view on od's items¶viewkeys() → a set-like object providing a view on od's keys¶viewvalues() → an object providing a view on od's values¶write(target, *args, **kwargs)[source]¶Write this TimeSeriesDict to a file
Arguments and keywords depend on the output format, see the online documentation for full details for each format.
| Parameters: | target :
format :
|
|---|
Notes
The available built-in formats are:
| Format | Read | Write | Auto-identify |
|---|---|---|---|
| framecpp | Yes | Yes | No |
| gwf | Yes | Yes | Yes |
| gwf.framecpp | Yes | Yes | No |
| gwf.lalframe | Yes | Yes | No |
| hdf5 | Yes | Yes | No |
| lalframe | Yes | Yes | No |
EntryClass[source]¶alias of TimeSeries