pycsa.data.results

Spectral analysis result dataclass.

Moved from pycsa.core.var. The get_attrs method copies fields from a Fourier transformer instance + spectrum into the analysis container; grid_kk_ll is retained as a deprecated helper for legacy diagnostic scripts.

Classes

analysis([wlat, wlon, ampls, kks, lls, recon])

Container for everything needed to compute idealised pseudo-momentum fluxes from a CSA fit.

class pycsa.data.results.analysis(wlat: Any | None = None, wlon: Any | None = None, ampls: ndarray | None = None, kks: ndarray | None = None, lls: ndarray | None = None, recon: ndarray | None = None)

Container for everything needed to compute idealised pseudo-momentum fluxes from a CSA fit.

dk and dl are set at runtime by get_attrs() (they’re computed from the wavenumber meshgrids), so they’re not declared as fields.

wlat: Any = None
wlon: Any = None
ampls: ndarray | None = None
kks: ndarray | None = None
lls: ndarray | None = None
recon: ndarray | None = None
get_attrs(fobj, freqs) None

Copy wlat / wlon from a Fourier transformer and compute kks / lls meshgrids in physical units.

Sets self.dk and self.dl as runtime attributes (mean spacing in each wavenumber direction).

grid_kk_ll(fobj, dat) ndarray

Reshape a flat amplitude vector onto the 2-D wavenumber grid.

Deprecated since version 0.90.0: Retained only for back-compatibility; not used by the production pipeline.

Parameters:
  • fobj (pycsa.core.fourier.f_trans) – Fourier transformer providing the wavenumber index vectors m_i and m_j along the two horizontal directions.

  • dat (array-like) – flat vector of spectral amplitudes to scatter onto the grid, ordered to match the iteration over (m_j, m_i).

Returns:

2-D amplitude grid of shape (len(m_i), len(m_j)) with the kk == 0 and ll <= 0 entries zeroed out.

Return type:

numpy.ndarray

__init__(wlat: Any | None = None, wlon: Any | None = None, ampls: ndarray | None = None, kks: ndarray | None = None, lls: ndarray | None = None, recon: ndarray | None = None) None