nifty.re.empirical_power_spectrum module#
- compute_empirical_power_spectrum(field: Array, distances: float | Tuple[float, ...], axes: int | Tuple[int, ...] | None = None, use_window: bool = False, n_bins: int | None = 128)[source]#
Computes the average empirical power spectrum of a field across the given axes, assuming regular grids.
- Parameters:
field (jnp.array) – Field of which to compute the power spectrum
distances (float, Tuple[float]) – Pixel distances of field along the axes to be converted
axes (int, Tuple[int], None) – Axes over which to compute the power spectrum. If None, all axes are consumed
use_window (bool) – Whether to apply a Hann window to the field along the consumed axes before computing the power. Required if the field does not have periodic boundaries.
n_bins (Optional[int]) – Maximum number of k bins to use
- Returns:
ps (jnp.array) – Empirical power spectrum
k_bin_centers (jnp.array) – Geometric means of k bins