FrequencySeriesDict๏
Stability: Stable
What it is๏
Use FrequencySeriesDict to manage multiple FrequencySeries objects as a labeled collection with batch operations and conversion helpers.
Representative Signatures๏
FrequencySeriesDict(data: dict[str, FrequencySeries])
FrequencySeriesDict.to_matrix()
Minimal Example๏
from gwexpy.frequencyseries import FrequencySeries, FrequencySeriesDict
import numpy as np
dct = FrequencySeriesDict({
"A": FrequencySeries(np.ones(64), df=1.0),
"B": FrequencySeries(np.ones(64), df=1.0),
})
mat = dct.to_matrix()
API Reference๏
The detailed generated API continues below on this page.
Inherits from: FrequencySeriesBaseDict
Ordered mapping of FrequencySeries objects keyed by label.
Physical Context๏
Use FrequencySeriesDict when the label itself matters physically: channel name, sensor location, configuration tag, or processing branch.
unlike a list, the key is part of the analysis record
this is useful for multi-sensor comparisons where losing the label would make the spectrum hard to interpret
Common Misreadings๏
assuming dictionary keys imply identical calibration or alignment
using sanitized file-output keys as though they were the original physical channel names
comparing spectra by key only, without checking units and frequency spacing
Where to go next๏
per-spectrum interpretation: FrequencySeries
convert to aligned analysis grid: FrequencySeriesMatrix
practical workflows: Transfer Function Measurement, Noise Budgeting
Methods๏
__init__๏
__init__(self, *args: 'Any', **kwargs: 'Any')
Initialize self. See help(type(self)) for accurate signature.
(Inherited from OrderedDict)
EntryClass๏
EntryClass(data, unit=None, f0=None, df=None, frequencies=None, name=None, epoch=None, channel=None, **kwargs)
Light wrapper of gwpyโs FrequencySeries for compatibility and future extension.
angle๏
angle(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Alias for phase(). Returns a new FrequencySeriesDict.
append๏
append(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Append to each FrequencySeries in the dict (in-place). Returns self.
apply_response๏
apply_response(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Apply response to each FrequencySeries. Returns a new FrequencySeriesDict.
copy๏
copy(self) -> "'FrequencySeriesBaseDict[_FS]'"
od.copy() -> a shallow copy of od
(Inherited from OrderedDict)
crop๏
crop(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Crop each FrequencySeries in the dict. In-place operation (GWpy-compatible). Returns self.
degree๏
degree(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Compute phase (in degrees) of each FrequencySeries. Returns a new FrequencySeriesDict.
differentiate_time๏
differentiate_time(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Apply time differentiation to each item. Returns a new FrequencySeriesDict.
filter๏
filter(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Apply filter to each FrequencySeries. Returns a new FrequencySeriesDict.
group_delay๏
group_delay(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Compute group delay of each item. Returns a new FrequencySeriesDict.
ifft๏
ifft(self, *args, **kwargs)
Compute IFFT of each FrequencySeries. Returns a TimeSeriesDict.
integrate_time๏
integrate_time(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Apply time integration to each item. Returns a new FrequencySeriesDict.
interpolate๏
interpolate(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Interpolate each FrequencySeries in the dict. Returns a new FrequencySeriesDict.
pad๏
pad(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Pad each FrequencySeries in the dict. Returns a new FrequencySeriesDict.
phase๏
phase(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Compute phase of each FrequencySeries. Returns a new FrequencySeriesDict.
plot๏
plot(self, label: 'str' = 'key', method: 'str' = 'plot', figsize: 'Optional[Any]' = None, **kwargs: 'Any')
Plot data.
Parameters๏
label : str, optional labelling method, one of
- ``'key'``: use dictionary key (default)
- ``'name'``: use ``name`` attribute of each item
method : str, optional
method of :class:~gwpy.plot.Plot to call, default: 'plot'
figsize : tuple, optional
(width, height) tuple in inches
**kwargs
other keyword arguments passed to the plot method
plot_all๏
plot_all(self, *args: 'Any', **kwargs: 'Any')
Alias for plot(). Plots all series in the dict.
prepend๏
prepend(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Prepend to each FrequencySeries in the dict (in-place). Returns self.
read๏
read(source, *args, **kwargs)
No documentation available.
setdefault๏
setdefault(self, key: 'str', default: 'Optional[_FS]' = None) -> '_FS'
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
(Inherited from OrderedDict)
smooth๏
smooth(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Smooth each FrequencySeries. Returns a new FrequencySeriesDict.
span๏
Frequency extent across all elements (based on xspan).
to_control_frd๏
to_control_frd(self, *args, **kwargs) -> 'dict'
Convert each item to control.FRD. Returns a dict of FRD objects.
to_cupy๏
to_cupy(self, *args, **kwargs) -> 'dict'
Convert each item to cupy.ndarray. Returns a dict of Arrays.
to_db๏
to_db(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Convert each FrequencySeries to dB. Returns a new FrequencySeriesDict.
to_jax๏
to_jax(self, *args, **kwargs) -> 'dict'
Convert each item to jax.Array. Returns a dict of Arrays.
to_matrix๏
to_matrix(self)
Convert this FrequencySeriesDict to a FrequencySeriesMatrix (Nx1).
to_pandas๏
to_pandas(self, **kwargs)
Convert to pandas.DataFrame. Keys become columns.
to_tensorflow๏
to_tensorflow(self, *args, **kwargs) -> 'dict'
Convert each item to tensorflow.Tensor. Returns a dict of Tensors.
to_tmultigraph๏
to_tmultigraph(self, name: 'Optional[str]' = None) -> 'Any'
Convert to ROOT TMultiGraph.
to_torch๏
to_torch(self, *args, **kwargs) -> 'dict'
Convert each item to torch.Tensor. Returns a dict of Tensors.
to_xarray๏
to_xarray(self)
Convert to xarray.Dataset. Keys become data variables.
write๏
write(self, target: 'str', *args: 'Any', **kwargs: 'Any') -> 'Any'
Write dict to file (HDF5, ROOT, etc.).
For HDF5 output you can choose a layout (default is GWpy-compatible dataset-per-entry).
fsd.write("out.h5", format="hdf5") # GWpy-compatible (default)
fsd.write("out.h5", format="hdf5", layout="group") # legacy group-per-entry
HDF5 dataset names (for GWpy path=):
Keys are sanitized to be HDF5-friendly (e.g.
H1:ASD->H1_ASD).If multiple keys sanitize to the same name, a suffix like
__1is added.The original keys are stored in file attributes, and
gwexpyrestores them on read.
Warning
Never unpickle data from untrusted sources. pickle/shelve can execute
arbitrary code on load.
Pickle portability note: pickled gwexpy FrequencySeriesDict unpickles as a built-in
dict of GWpy FrequencySeries (gwexpy not required on the loading side).
zpk๏
zpk(self, *args, **kwargs) -> "'FrequencySeriesDict'"
Apply ZPK filter to each FrequencySeries. Returns a new FrequencySeriesDict.