pyrfu.mms.fk_power_spectrum_4sc module#

pyrfu.mms.fk_power_spectrum_4sc.fk_power_spectrum_4sc(e, r, b, tints, cav: int = 8, num_k: int = 500, num_f: int = 200, df: float | None = None, w_width: int = 1, f_range: list | None = None)[source]#

Calculates the frequency-wave number power spectrum using the four MMS spacecraft. Uses a generalization of mms.fk_powerspectrum. Wavelet based cross-spectral analysis is used to calculate the phase difference each spacecraft pair and determine 3D wave vector. A generalization of the method used in mms.fk_powerspectrum to four point measurements.

Parameters:
  • e (list of xarray.DataArray) – Fields to apply 4SC cross-spectral analysis to. e.g., e or b fields (if multiple components only the first is used).

  • r (list of xarray.DataArray) – Positions of the four spacecraft.

  • b (list of xarray.DataArray) – background magnetic field in the same coordinates as r. Used to determine the parallel and perpendicular wave numbers using 4SC average.

  • tints (list of str) – Time interval over which the power spectrum is calculated. To avoid boundary effects use a longer time interval for e and b.

  • cav (int, Optional) – Number of points in time series used to estimate phase. Default cav = 8.

  • num_k (int, Optional) – Number of wave numbers used in spectrogram. Default num_k = 500.

  • df (float, Optional) – Linear spacing of frequencies. Default df = None (log spacing).

  • num_f (int, Optional) – Number of frequencies used in spectrogram. Default num_f = 200.

  • w_width (float, Optional) – Multiplier for Morlet wavelet width. Default w_width = 1.

  • f_range (list of float, Optional) – Frequency range for k-k plots. [minf maxf].

Returns:

out – Dataset of array of powers as a function of frequency and wavenumber. Power is normalized to the maximum value.

Return type:

xarray.Dataset

Notes

Wavelength must be larger than twice the spacecraft separations, otherwise spatial aliasing will occur.

Examples

>>> from pyrfu.mms import get_data, fk_power_spectrum_4sc
>>> from pyrfu.pyrf import extend_tint, convert_fac

Load data

>>> tint = ["2015-10-16T13:05:24.00", "2015-10-16T13:05:50.000"]
>>> ic = range(1, 5)
>>> b_fgm = [get_data("b_gse_fgm_brst_l2", tint, i) for i in ic]
>>> b_scm = [get_data("b_gse_scm_brst_l2", tint, i) for i in ic]

Load spacecraft position

>>> tint_long = extend_tint(tint, [-60, 60])
>>> r_gse_mms = [get_data("r_gse", tint_long, i) for i in range(1, 5)]

Convert magnetic field fluctuations to field aligned coordinates

>>> b_fac = [convert_fac(b_s, b_f) for b_s, b_f in zip(b_scm, b_fgm)]
>>> b_par = [b_s[:, 0] for b_s in b_fac]

Compute dispersion relation

>>> tint = ["2015-10-16T13:05:26.500", "2015-10-16T13:05:27.000"]
>>> pwer = fk_power_spectrum_4sc(b_par, r_gse, b_fgm, tint, 4, 500, 2,
... 10, 2)