Dynamic power spectra
- pyspedas.tdpwrspc(varname, newname=None, trange=['0.0', '0.0'], nboxpoints=None, nshiftpoints=None, polar=False, bin=3, nohanning=False, noline=False, notperhz=False, notmvariance=False)
Compute power spectra for a tplot variable.
- Parameters:
varname (
str
) – Name of pytplot variable.newname (
str
, optional) – Name of new pytplot variable to save data to. Default: None. If newname is not set ‘_dpwrspc’ will be appended to the varnametrange (
list
offloat
, optional) – Start and end times for the calculation.nboxpoints (
int
, optional) – The number of points to use for the hanning window. Default: 256nshiftpoints (
int
, optional) – The number of points to shift for each spectrum. Default: 128polar (
bool
, optional) – If True, the input data is in polar coordinates. Default: Falsebin (
int
, optional) – Size for binning of the data along the frequency domain. Default: 3nohanning (
bool
, optional) – If True, no hanning window is applied to the input. Default: Falsenoline (
bool
, optional) – If True, no straight line is subtracted. Default: Falsenotperhz (
bool
, optional) – If True, the output units are the square of the input units. Default: Falsenotmvariance (
bool
, optional) – If True, replace output spectrum for any windows that have variable. cadence with NaNs. Default: False
- Returns:
Name of new pytplot variable.
- Return type:
Example
>>> import pytplot >>> import numpy as np >>> pytplot.store_data('a', data={'x': range(100), 'y': np.random.random(100)}) >>> pytplot.get_data('a_pwrspc') >>> pytplot.tpwrspc('a_pwrspc')
- pyspedas.dpwrspc(time, quantity, nboxpoints=256, nshiftpoints=128, bin=3, tbegin=-1.0, tend=-1.0, noline=False, nohanning=False, notperhz=False, notmvariance=False, tm_sensitivity=None)
Compute power spectra.
- Parameters:
nboxpoints (
int
, optional) – The number of points to use for the hanning window. The default is 256.nshiftpoints (
int
, optional) – The number of points to shift for each spectrum. The default is 128.bin (
int
, optional) – Size for binning of the data along the frequency domain. The default is 3.tbegin (
float
, optional) – Start time for the calculation. If -1.0, the start time is the first time in the time array.tend (
float
, optional) – End time for the calculation. If -1.0, the end time is the last time in the time array.noline (
bool
, optional) – If True, no straight line is subtracted. The default is False.nohanning (
bool
, optional) – If True, no hanning window is applied to the input. The default is False.notperhz (
bool
, optional) – If True, the output units are the square of the input units. The default is False.notmvariance (
bool
, optional) – If True, replace output spectrum for any windows that have variable cadence with NaNs. The default is False.tm_sensitivity (
float
, optional) – If noTmVariance is set, this number controls how much of a dt anomaly is accepted. The default is None.
- Returns: