Skip to content

ozzy.fields

This submodule includes functions to analyze field data.

vphi_from_fit §

vphi_from_fit(
    da,
    x_zero,
    xvar="x1",
    tvar="t",
    window_len=1.0,
    k=1.0,
    boundary="trim",
    quasistatic_fixed_z=False,
)

Measure the phase (\(\phi\)) and phase velocity (\(v_\phi\)) from stacked lineouts of a wave (waterfall data) by fitting a sinusoidal function to blocks of data.

Parameters:

Name Type Description Default

da §

DataArray

The input xarray.DataArray containing the data to be analyzed.

The data should be two-dimensional: time or propagation distance along one dimension, and a longitudinal coordinate along the other dimension.

required

x_zero §

float

Position along the longitudinal coordinate where the sine should be considered to start, and with respect to which the phase will be measured. For example, a seed position.

required

xvar §

str

The name of the spatial dimension along which to perform the fit. Default is 'x1'.

'x1'

tvar §

str

The name of the time or propagation dimension. Default is 't'.

't'

window_len §

float

The length of the window (in units of the plasma wavelength) over which to perform the fit. Default is 1.0.

1.0

k §

float | str

The wavenumber to use in the definition of the window length. If 'fft', the wavenumber will be calculated from the FFT of the data. Default is 1.0.

1.0

boundary §

str

How to handle boundaries when coarsening the data into blocks. One of 'trim', 'pad', or 'drop'. See xarray.DataArray.coarsen.

'trim'

quasistatic_fixed_z §

bool

If True, the phase velocity is calculated assuming a quasistatic approximation with a fixed z-dimension. Default is False.

False

Returns:

Type Description
Dataset

A dataset containing the calculated phase velocity ('vphi'), phase ('phi'), and phase error ('phi_err').