gwexpy.frequencyseries.FrequencySeries

class gwexpy.frequencyseries.FrequencySeries(*args: Any, **kwargs: Any)[source]

Bases: PlotMixin, SignalAnalysisMixin, RegularityMixin, FittingMixin, StatisticalMethodsMixin, FrequencySeries

Light wrapper of gwpy’s FrequencySeries for compatibility and future extension.

__init__()

Methods

__init__()

abs(**kwargs)

Return the absolute value of the data in this Array.

all([axis, out])

angle([unwrap])

Calculate the phase angle of this FrequencySeries.

any([axis, out])

append(other, *[, inplace, gap, pad, resize])

Connect another series onto this one.

argmax([axis, out, keepdims])

argmin([axis, out, keepdims])

argpartition(kth[, axis, kind, order])

Returns the indices that would partition this array.

argsort([axis, kind, order])

astype(dtype[, order, casting, subok, copy])

Copy of the array, cast to a specified type.

byteswap([inplace])

Swap the bytes of the array elements

check_compatible(other[, casting, ...])

Check whether this Series and other are compatible.

choose(choices[, out, mode])

clip([min, max, out])

Return an array whose values are limited to [min, max].

compress(condition[, axis, out])

Return selected slices of this array along given axis.

conj()

Complex-conjugate all elements.

conjugate()

Return the complex conjugate, element-wise.

copy([order])

Return a copy of the array.

crop([start, end, copy])

Crop this series to the given x-axis extent.

cumprod([axis, dtype, out])

Return the cumulative product of the elements along the given axis.

cumsum([axis, dtype, out])

Return the cumulative sum of the elements along the given axis.

decompose([bases])

Generates a new Quantity with the units decomposed.

degree([unwrap])

Calculate the phase of this FrequencySeries in degrees.

diagonal([offset, axis1, axis2])

Return specified diagonals.

diff([n, axis])

Calculate the n-th order discrete difference along given axis.

differentiate([order])

Differentiate the FrequencySeries in the frequency domain.

differentiate_time()

Apply time differentiation in frequency domain.

dot(b[, out])

dump(file)

Not implemented, use .value.dump() instead.

dumps()

Not implemented, use .value.dumps() instead.

ediff1d([to_end, to_begin])

fill(value)

filter(filt, *[, analog, sample_rate, unit, ...])

Apply a filter to this FrequencySeries.

filterba(*args, **kwargs)

Apply a [b, a] filter to this FrequencySeries.

find_peaks([height, threshold, distance, ...])

Find peaks in the series.

fit(model[, x_range, sigma, p0, limits, fixed])

Fit the data to a model using iminuit.

flatten([order])

Return a copy of the array collapsed into one dimension.

from_control_frd(frd, *[, frequency_unit])

Create from control.FRD.

from_cupy(array, frequencies[, unit])

Create FrequencySeries from CuPy array.

from_finesse_frequency_response(sol, *[, ...])

Create from finesse FrequencyResponseSolution.

from_finesse_noise(sol, *[, output, noise, unit])

Create from finesse NoiseProjectionSolution.

from_hdf5_dataset(group, path)

Read FrequencySeries from HDF5 dataset.

from_jax(array, frequencies[, unit])

Create FrequencySeries from JAX array.

from_lal(lalfs, *[, copy])

Generate a new FrequencySeries from a LAL FrequencySeries.

from_mne(spectrum, **kwargs)

Create FrequencySeries from MNE-Python Spectrum object.

from_obspy(trace, **kwargs)

Create FrequencySeries from Obspy Trace.

from_pandas(series, **kwargs)

Create FrequencySeries from pandas.Series.

from_polars(data[, frequencies])

Create a FrequencySeries from a polars.DataFrame or polars.Series.

from_pycbc(fs, *[, copy])

Convert a pycbc.types.frequencyseries.FrequencySeries.

from_pyspeckit(spectrum, **kwargs)

Create FrequencySeries from pyspeckit.Spectrum.

from_pyspice_ac(analysis, *[, node, branch, ...])

Create from a PySpice AcAnalysis.

from_pyspice_distortion(analysis, *[, node, ...])

Create from a PySpice DistortionAnalysis.

from_pyspice_noise(analysis, *[, node, unit])

Create from a PySpice NoiseAnalysis.

from_quantities(q, frequencies)

Create FrequencySeries from quantities.Quantity.

from_root(obj[, return_error])

Create FrequencySeries from ROOT TGraph or TH1.

from_simpeg(data_obj, **kwargs)

Create FrequencySeries from SimPEG Data object.

from_skrf_network(ntwk, *[, parameter, ...])

Create from a scikit-rf Network.

from_specutils(spectrum, **kwargs)

Create FrequencySeries from specutils.Spectrum1D.

from_tensorflow(tensor, frequencies[, unit])

Create FrequencySeries from tensorflow.Tensor.

from_torch(tensor, frequencies[, unit])

Create FrequencySeries from torch.Tensor.

from_xarray(da, **kwargs)

Create FrequencySeries from xarray.DataArray.

getfield(dtype[, offset])

Returns a field of the given array as a certain type.

group_delay()

Calculate the group delay of the series.

histogram([bins, range, weights, density])

Compute a histogram of the values in this FrequencySeries.

idct([type, norm, n])

Compute the Inverse Discrete Cosine Transform (IDCT).

ifft(*[, mode, trim, original_n, pad_left, ...])

Inverse FFT returning a gwexpy TimeSeries, supporting transient round-trip.

inject(other, *[, inplace])

Add two compatible Series along their shared x-axis values.

insert(obj, values[, axis])

Insert values along the given axis before the given indices and return a new ~astropy.units.Quantity object.

integrate([order])

Integrate the FrequencySeries in the frequency domain.

integrate_time()

Apply time integration in frequency domain.

interpolate(df)

Interpolate this FrequencySeries to a new resolution.

is_compatible(other)

Check whether this series and other have compatible metadata.

is_contiguous(other[, tol])

Check whether other is contiguous with self.

item(*args)

Copy an element of an array to a scalar Quantity and return it.

itemset(*args)

kurtosis([axis, fisher, nan_policy])

Compute the kurtosis (Fisher or Pearson) of the data.

max([axis, out, keepdims, initial, where])

mean([axis, dtype, out, keepdims, where])

median([axis, out, overwrite_input, keepdims])

Compute the median.

min([axis, out, keepdims, initial, where])

newbyteorder([new_order])

Return the array with the same data viewed with a different byte order.

nonzero()

Return the indices of the elements that are non-zero.

override_unit(unit[, parse_strict])

Reset the unit of these data.

pad(pad_width, **kwargs)

Pad this series to a new size.

partition(kth[, axis, kind, order])

Rearranges the elements in the array in such a way that the value of the element in kth position is in the position it would be in a sorted array.

phase([unwrap])

Calculate the phase of this FrequencySeries.

plot(**kwargs)

Plot this object using gwexpy.plot.Plot.

prepend(other, *[, inplace, gap, pad, resize])

Connect another series onto the start of the current one.

prod([axis, dtype, out, keepdims, initial, ...])

Return the product of the array elements over the given axis

ptp([axis, out, keepdims])

Peak to peak (maximum - minimum) value along a given axis.

put(indices, values[, mode])

quadrature_sum(other)

Compute sqrt(self^2 + other^2) assuming checking independence.

ravel([order])

Return a flattened array.

rebin(width)

Rebin the FrequencySeries to a new resolution.

repeat(repeats[, axis])

Repeat elements of an array.

reshape(shape[, order])

Returns an array containing the same data with a new shape.

resize(new_shape[, refcheck])

Change shape and size of array in-place.

rms([axis, keepdims, ignore_nan])

Compute the Root Mean Square (RMS) value.

round([decimals, out])

searchsorted(v, *args, **kwargs)

setfield(val, dtype[, offset])

Put a value into a specified place in a field defined by a data-type.

setflags([write, align, uic])

Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY, respectively.

shift(delta)

Shift this Series forward on the X-axis by delta.

skewness([axis, nan_policy])

Compute the skewness of the data.

smooth(width[, method, ignore_nan])

Smooth the series.

sort([axis, kind, order])

Sort an array in-place.

squeeze([axis])

Remove axes of length one from a.

std([axis, dtype, out, ddof, keepdims, where])

step(**kwargs)

Create a step plot of this series.

sum([axis, dtype, out, keepdims, initial, where])

Return the sum of the array elements over the given axis.

swapaxes(axis1, axis2)

Return a view of the array with axis1 and axis2 interchanged.

take(indices[, axis, out, mode])

to(unit[, equivalencies, copy])

Return a new ~astropy.units.Quantity object with the specified unit.

to_control_frd([frequency_unit])

Convert to control.FRD.

to_cupy([dtype])

Convert to CuPy array.

to_db([ref, amplitude])

Convert this series to decibels.

to_hdf5_dataset(group, path, *[, overwrite, ...])

Write to HDF5 dataset within a group.

to_jax([dtype])

Convert to JAX array.

to_lal()

Convert this FrequencySeries into a LAL FrequencySeries.

to_mne([info])

Convert to MNE-Python object.

to_obspy(**kwargs)

Convert to Obspy Trace.

to_pandas([index, name, copy])

Convert to pandas.Series.

to_polars([name, as_dataframe, frequencies])

Convert this series to a polars.DataFrame or polars.Series.

to_pycbc(*[, copy])

Convert this FrequencySeries into a PyCBC FrequencySeries.

to_pyspeckit(**kwargs)

Convert to pyspeckit.Spectrum.

to_quantities([units])

Convert to quantities.Quantity (Elephant/Neo compatible).

to_simpeg([location, rx_type, orientation])

Convert to SimPEG Data object.

to_skrf_network(*[, parameter, z0, ...])

Convert to a scikit-rf Network.

to_specutils(**kwargs)

Convert to specutils.Spectrum1D.

to_string([unit, precision, format, subfmt, ...])

Generate a string representation of the quantity and its unit.

to_tensorflow([dtype])

Convert to tensorflow.Tensor.

to_tgraph([error])

Convert to ROOT TGraph or TGraphErrors.

to_th1d([error])

Convert to ROOT TH1D.

to_torch([device, dtype, requires_grad, copy])

Convert to torch.Tensor.

to_value([unit, equivalencies])

The numerical value, possibly in a different unit.

to_xarray([freq_coord])

Convert to xarray.DataArray.

tobytes([order])

Not implemented, use .value.tobytes() instead.

tofile(fid[, sep, format])

Not implemented, use .value.tofile() instead.

tolist()

tostring([order])

Not implemented, use .value.tostring() instead.

trace([offset, axis1, axis2, dtype, out])

transpose(*axes)

Returns a view of the array with axes transposed.

update(other, *[, inplace, gap, pad])

Update this series by appending new data like a buffer.

value_at(x)

Return the value of this Series at the given xindex value.

var([axis, dtype, out, ddof, keepdims, where])

view([dtype][, type])

New view of array with the same data.

zip()

Zip the xindex and value arrays of this Series.

zpk(zeros, poles, gain, *[, analog, ...])

Filter this FrequencySeries by applying a zero-pole-gain filter.

Attributes

T

View of the transposed array.

base

Base object if memory is from some other object.

cgs

Returns a copy of the current Quantity instance with CGS units.

channel

Instrumental channel associated with these data.

ctypes

An object to simplify the interaction of the array with the ctypes module.

data

Python buffer object pointing to the start of the array's data.

df

Frequency spacing of this FrequencySeries

dtype

Data-type of the array's elements.

dx

X-axis sample separation.

epoch

GPS epoch associated with these data.

equivalencies

A list of equivalencies that will be applied by default during unit conversions.

f0

Starting frequency for this FrequencySeries

flags

Information about the memory layout of the array.

flat

A 1-D iterator over the Quantity array.

frequencies

Series of frequencies for each sample

imag

The imaginary part of the array.

info

Container for meta information like name, description, format.

is_regular

Return True if this series has a regular grid (constant spacing).

isscalar

True if the value of this quantity is a scalar, or False if it is an array-like object.

itemsize

Length of one array element in bytes.

name

Name for this data set.

nbytes

Total bytes consumed by the elements of the array.

ndim

Number of array dimensions.

read

real

The real part of the array.

shape

Tuple of array dimensions.

si

Returns a copy of the current Quantity instance with SI units.

size

Number of elements in the array.

strides

Tuple of bytes to step in each dimension when traversing an array.

unit

The physical unit of these data.

value

The numerical value of this instance.

write

x0

X-axis coordinate of the first data point.

xindex

Positions of the data on the x-axis.

xspan

X-axis [low, high) segment encompassed by these data.

xunit

Unit of x-axis index.

dt

phase(unwrap: bool = False) FrequencySeries[source]

Calculate the phase of this FrequencySeries.

Parameters:

unwrap (bool, optional) – If True, unwrap the phase to remove discontinuities. Default is False.

Returns:

The phase of the series, in radians.

Return type:

FrequencySeries

angle(unwrap: bool = False) FrequencySeries[source]

Calculate the phase angle of this FrequencySeries.

Alias for phase(unwrap=unwrap).

Parameters:

unwrap (bool, optional) – If True, unwrap the phase to remove discontinuities. Default is False.

Returns:

The phase of the series, in radians.

Return type:

FrequencySeries

histogram(bins=None, range=None, weights=None, density=False, **kwargs)[source]

Compute a histogram of the values in this FrequencySeries.

Useful for analyzing the distribution of spectral density levels.

Parameters:
  • bins (int or sequence or str, optional) – Binning specification (passed to np.histogram).

  • range ((float, float), optional) – The lower and upper range of the bins.

  • weights (array_like, optional) – Weights for each sample.

  • density (bool, optional) – If True, return a probability density histogram.

  • **kwargs – Additional arguments passed to np.histogram.

Returns:

A gwexpy.histogram.Histogram object.

Return type:

Histogram

degree(unwrap: bool = False) FrequencySeries[source]

Calculate the phase of this FrequencySeries in degrees.

Parameters:

unwrap (bool, optional) – If True, unwrap the phase before converting to degrees.

Returns:

The phase of the series, in degrees.

Return type:

FrequencySeries

differentiate(order: int = 1) FrequencySeries[source]

Differentiate the FrequencySeries in the frequency domain.

Multiplies by (i * 2 * pi * f)^order.

Parameters:

order (int, optional) – Order of differentiation. Default is 1.

Returns:

The differentiated series.

Return type:

FrequencySeries

integrate(order: int = 1) FrequencySeries[source]

Integrate the FrequencySeries in the frequency domain.

Divides by (i * 2 * pi * f)^order.

Parameters:

order (int, optional) – Order of integration. Default is 1.

Returns:

The integrated series.

Return type:

FrequencySeries

to_db(ref: Any = 1.0, amplitude: bool = True) FrequencySeries[source]

Convert this series to decibels.

Parameters:
  • ref (float or Quantity, optional) – Reference value for 0 dB. Default is 1.0.

  • amplitude (bool, optional) – If True (default), treat data as amplitude (20 * log10). If False, treat data as power (10 * log10).

Returns:

The series in dB.

Return type:

FrequencySeries

filterba(*args, **kwargs)[source]

Apply a [b, a] filter to this FrequencySeries. Inherited from gwpy.

to_pandas(index: Literal['frequency'] = 'frequency', *, name: str | None = None, copy: bool = False) Any[source]

Convert to pandas.Series.

classmethod from_pandas(series: Any, **kwargs: Any) Any[source]

Create FrequencySeries from pandas.Series.

to_polars(name: str | None = None, as_dataframe: bool = True, frequencies: str = 'frequency') Any[source]

Convert this series to a polars.DataFrame or polars.Series.

Parameters:
  • name (str, optional) – Name for the polars Series/Column.

  • as_dataframe (bool, default True) – If True, returns a DataFrame with a ‘frequency’ column. If False, returns a raw Series of values.

  • frequencies (str, default "frequency") – Name of the frequency column (only if as_dataframe=True).

Return type:

polars.DataFrame or polars.Series

classmethod from_polars(data: Any, frequencies: str | None = 'frequency', **kwargs: Any) Any[source]

Create a FrequencySeries from a polars.DataFrame or polars.Series.

Parameters:
  • data (polars.DataFrame or polars.Series) – Input data.

  • frequencies (str, optional) – If data is a DataFrame, name of the column to use as frequency.

  • **kwargs – Additional arguments passed to frequency series constructor.

Return type:

FrequencySeries

to_tgraph(error: Any | None = None) Any[source]

Convert to ROOT TGraph or TGraphErrors.

to_th1d(error: Any | None = None) Any[source]

Convert to ROOT TH1D.

classmethod from_root(obj: Any, return_error: bool = False, **kwargs: Any) Any[source]

Create FrequencySeries from ROOT TGraph or TH1.

to_xarray(freq_coord: Literal['Hz'] = 'Hz') Any[source]

Convert to xarray.DataArray.

classmethod from_xarray(da: Any, **kwargs: Any) Any[source]

Create FrequencySeries from xarray.DataArray.

to_hdf5_dataset(group: Any, path: str, *, overwrite: bool = False, compression: str | None = None, compression_opts: Any = None) Any[source]

Write to HDF5 dataset within a group.

classmethod from_hdf5_dataset(group: Any, path: str) Any[source]

Read FrequencySeries from HDF5 dataset.

ifft(*, mode: str = 'auto', trim: bool = True, original_n: int | None = None, pad_left: int | None = None, pad_right: int | None = None, **kwargs: Any) Any[source]

Inverse FFT returning a gwexpy TimeSeries, supporting transient round-trip.

Parameters:
  • mode ({"auto", "gwpy", "transient"}) – auto: use transient restoration if _gwex_fft_mode==”transient” is detected, otherwise GWpy compatible.

  • trim (bool) – Whether to remove padding and trim to original length during transient mode.

  • original_n (int, optional) – Explicitly specify the length after restoration (takes priority).

  • pad_right (int, optional) – Specify padding lengths for transient mode to override defaults.

  • pad_left (int, optional) – Specify padding lengths for transient mode to override defaults.

idct(type: int = 2, norm: str = 'ortho', *, n: int | None = None) Any[source]

Compute the Inverse Discrete Cosine Transform (IDCT).

Reconstructs a time-domain signal from DCT coefficients.

Parameters:
  • type (int, optional) – DCT type (1, 2, 3, or 4). Should match the type used for the forward DCT. Default is 2.

  • norm (str, optional) – Normalization mode: ‘ortho’ for orthonormal, None for standard. Default is ‘ortho’.

  • n (int, optional) – Length of the output time series. If None, uses the stored original_n attribute if available.

Returns:

The reconstructed time series.

Return type:

TimeSeries

Notes

For a proper roundtrip, use the same type and norm as the forward DCT transform.

Examples

>>> fs = FrequencySeries(dct_coeffs, ...)
>>> ts = fs.idct()
differentiate_time() Any[source]

Apply time differentiation in frequency domain.

Multiplies by (2 * pi * i * f). Converting Displacement -> Velocity -> Acceleration.

Return type:

FrequencySeries

integrate_time() Any[source]

Apply time integration in frequency domain.

Divides by (2 * pi * i * f). Converting Acceleration -> Velocity -> Displacement.

Return type:

FrequencySeries

quadrature_sum(other: Any) Any[source]

Compute sqrt(self^2 + other^2) assuming checking independence.

Operates on magnitude. Phase information is lost (returns real).

Parameters:

other (FrequencySeries) – The other series to add.

Returns:

Magnitude combined series.

Return type:

FrequencySeries

group_delay() Any[source]

Calculate the group delay of the series.

Group delay is defined as -d(phase)/d(omega), where omega = 2 * pi * f. It represents the time delay of the envelope of a signal at a given frequency.

Returns:

A new FrequencySeries representing the group delay in seconds.

Return type:

FrequencySeries

rebin(width: float | Quantity) FrequencySeries[source]

Rebin the FrequencySeries to a new resolution.

Parameters:

width (float or Quantity) – New bin width in Hz.

Returns:

The rebinned series.

Return type:

FrequencySeries

to_control_frd(frequency_unit: Literal['rad/s', 'Hz'] = 'Hz') Any[source]

Convert to control.FRD.

classmethod from_control_frd(frd: Any, *, frequency_unit: Literal['Hz', 'rad/s'] = 'Hz') Any[source]

Create from control.FRD.

classmethod from_finesse_frequency_response(sol: Any, *, output: Any | None = None, input_dof: Any | None = None, unit: Any | None = None) Any[source]

Create from finesse FrequencyResponseSolution.

Parameters:
  • sol (finesse.analysis.actions.lti.FrequencyResponseSolution) – The frequency response solution from a Finesse 3 simulation.

  • output (str or object, optional) – Output DOF name. Combined with input_dof to select one transfer function.

  • input_dof (str or object, optional) – Input DOF name.

  • unit (str or astropy.units.Unit, optional) – Unit to assign to the data.

Return type:

FrequencySeries or FrequencySeriesMatrix

classmethod from_finesse_noise(sol: Any, *, output: Any | None = None, noise: str | None = None, unit: Any | None = None) Any[source]

Create from finesse NoiseProjectionSolution.

Parameters:
  • sol (finesse.analysis.actions.noise.NoiseProjectionSolution) – The noise projection solution from a Finesse 3 simulation.

  • output (str or object, optional) – Output node name.

  • noise (str, optional) – Specific noise source name.

  • unit (str or astropy.units.Unit, optional) – Unit to assign to the data (e.g., "m/sqrt(Hz)").

Return type:

FrequencySeries or FrequencySeriesDict

classmethod from_pyspice_ac(analysis: Any, *, node: str | None = None, branch: str | None = None, unit: Any | None = None) Any[source]

Create from a PySpice AcAnalysis.

Parameters:
  • analysis (PySpice.Spice.Simulation.AcAnalysis) – The AC analysis result from a PySpice simulation.

  • node (str, optional) – Node name to extract. If None and branch is also None, all signals are returned as a FrequencySeriesDict.

  • branch (str, optional) – Branch name to extract.

  • unit (str or astropy.units.Unit, optional) – Unit to assign to the result.

Return type:

FrequencySeries or FrequencySeriesDict

classmethod from_pyspice_noise(analysis: Any, *, node: str | None = None, unit: Any | None = None) Any[source]

Create from a PySpice NoiseAnalysis.

Parameters:
  • analysis (PySpice.Spice.Simulation.NoiseAnalysis) – The noise analysis result from a PySpice simulation.

  • node (str, optional) – Node name to extract (e.g. "onoise"). If None, all signals are returned as a FrequencySeriesDict.

  • unit (str or astropy.units.Unit, optional) – Unit to assign to the result.

Return type:

FrequencySeries or FrequencySeriesDict

classmethod from_pyspice_distortion(analysis: Any, *, node: str | None = None, unit: Any | None = None) Any[source]

Create from a PySpice DistortionAnalysis.

Parameters:
  • analysis (PySpice.Spice.Simulation.DistortionAnalysis) – The distortion analysis result from a PySpice simulation.

  • node (str, optional) – Node name to extract. If None, all signals are returned as a FrequencySeriesDict.

  • unit (str or astropy.units.Unit, optional) – Unit to assign to the result.

Return type:

FrequencySeries or FrequencySeriesDict

classmethod from_skrf_network(ntwk: Any, *, parameter: str = 's', port_pair: tuple[int, int] | None = None, unit: Any | None = None) Any[source]

Create from a scikit-rf Network.

Parameters:
  • ntwk (skrf.Network) – The scikit-rf Network object.

  • parameter (str, default "s") – Which network parameter to extract ("s", "z", "y", "a", "t", or "h").

  • port_pair (tuple[int, int], optional) – Zero-based (row, col) port indices. If None, 1-port networks return a FrequencySeries and multi-port networks return a FrequencySeriesMatrix.

  • unit (str or astropy.units.Unit, optional) – Unit to assign to the result.

Return type:

FrequencySeries or FrequencySeriesMatrix

to_skrf_network(*, parameter: str = 's', z0: float = 50.0, port_names: list[str] | None = None, name: str | None = None) Any[source]

Convert to a scikit-rf Network.

Parameters:
  • parameter (str, default "s") – Network parameter the data represents.

  • z0 (float, default 50.0) – Reference impedance in Ohms.

  • port_names (list[str], optional) – Names for each port.

  • name (str, optional) – Name for the resulting Network.

Return type:

skrf.Network

to_torch(device: str | None = None, dtype: Any = None, requires_grad: bool = False, copy: bool = False) Any[source]

Convert to torch.Tensor.

Parameters:
  • device (str or torch.device, optional) – Target device (e.g. ‘cpu’, ‘cuda’).

  • dtype (torch.dtype, optional) – Target data type. Defaults to preserving complex64/128 or float32/64.

  • requires_grad (bool, optional) – If True, enable gradient tracking.

  • copy (bool, optional) – If True, force a copy of the data.

Return type:

torch.Tensor

classmethod from_torch(tensor: Any, frequencies: Any, unit: Any | None = None) Any[source]

Create FrequencySeries from torch.Tensor.

Parameters:
  • tensor (torch.Tensor) – Input tensor.

  • frequencies (Array or Quantity) – Frequency array matching the tensor size.

  • unit (Unit or str, optional) – Data unit.

Return type:

FrequencySeries

to_tensorflow(dtype: Any = None) Any[source]

Convert to tensorflow.Tensor.

Return type:

tensorflow.Tensor

classmethod from_tensorflow(tensor: Any, frequencies: Any, unit: Any | None = None) Any[source]

Create FrequencySeries from tensorflow.Tensor.

to_jax(dtype: Any = None) Any[source]

Convert to JAX array.

Return type:

jax.Array

classmethod from_jax(array: Any, frequencies: Any, unit: Any | None = None) Any[source]

Create FrequencySeries from JAX array.

to_cupy(dtype: Any = None) Any[source]

Convert to CuPy array.

Return type:

cupy.ndarray

classmethod from_cupy(array: Any, frequencies: Any, unit: Any | None = None) Any[source]

Create FrequencySeries from CuPy array.

to_quantities(units: str | None = None) Any[source]

Convert to quantities.Quantity (Elephant/Neo compatible).

Parameters:

units (str or quantities.UnitQuantity, optional) – Target units.

Return type:

quantities.Quantity

classmethod from_quantities(q: Any, frequencies: Any) Any[source]

Create FrequencySeries from quantities.Quantity.

Parameters:
  • q (quantities.Quantity) – Input data.

  • frequencies (array-like) – Frequencies corresponding to the data.

Return type:

FrequencySeries

to_mne(info: Any | None = None) Any[source]

Convert to MNE-Python object.

Parameters:

info (mne.Info, optional) – MNE Info object.

Return type:

mne.time_frequency.SpectrumArray

classmethod from_mne(spectrum: Any, **kwargs: Any) Any[source]

Create FrequencySeries from MNE-Python Spectrum object.

Parameters:
  • spectrum (mne.time_frequency.Spectrum) – Input spectrum data.

  • **kwargs – Additional arguments passed to constructor.

Return type:

FrequencySeries or FrequencySeriesDict

to_obspy(**kwargs: Any) Any[source]

Convert to Obspy Trace.

Return type:

obspy.Trace

classmethod from_obspy(trace: Any, **kwargs: Any) Any[source]

Create FrequencySeries from Obspy Trace.

Parameters:
  • trace (obspy.Trace) – Input trace.

  • **kwargs – Additional arguments.

Return type:

FrequencySeries

to_simpeg(location=None, rx_type='PointElectricField', orientation='x', **kwargs) Any[source]

Convert to SimPEG Data object.

Parameters:
  • location (array_like, optional) – Rx location (x, y, z). Default is [0, 0, 0].

  • rx_type (str, optional) – Receiver class name. Default “PointElectricField”.

  • orientation (str, optional) – Receiver orientation (‘x’, ‘y’, ‘z’). Default ‘x’.

Return type:

simpeg.data.Data

classmethod from_simpeg(data_obj: Any, **kwargs: Any) Any[source]

Create FrequencySeries from SimPEG Data object.

Parameters:

data_obj (simpeg.data.Data) – Input SimPEG Data.

Return type:

FrequencySeries

to_specutils(**kwargs)[source]

Convert to specutils.Spectrum1D.

Parameters:

**kwargs – Arguments passed to Spectrum1D constructor.

Return type:

specutils.Spectrum1D

classmethod from_specutils(spectrum, **kwargs)[source]

Create FrequencySeries from specutils.Spectrum1D.

Parameters:

spectrum (specutils.Spectrum1D) – Input spectrum.

Return type:

FrequencySeries

to_pyspeckit(**kwargs)[source]

Convert to pyspeckit.Spectrum.

Parameters:

**kwargs – Arguments passed to pyspeckit.Spectrum constructor.

Return type:

pyspeckit.Spectrum

classmethod from_pyspeckit(spectrum, **kwargs)[source]

Create FrequencySeries from pyspeckit.Spectrum.

Parameters:

spectrum (pyspeckit.Spectrum) – Input spectrum.

Return type:

FrequencySeries

DictClass

alias of FrequencySeriesDict