kspace.PowerLaw#

class kspace.PowerLaw(alpha, k0, ndim=3)[source]#

Bases: PowerSpectrum

Power-law power spectrum.

Parameters:
  • alpha (float) – Power-law index.

  • k0 (float) – Normalization scale (wavenumber at which the power spectrum is normalized).

  • ndim (int, optional) – Number of dimensions (1, 2, or 3). Default is 3.

__init__(alpha, k0, ndim=3)[source]#

Methods

A(k)

The Fourier amplitude corresponding to the power spectrum at a given wavenumber k, A(k) = sqrt(E(k) * k).

E(k)

The "energy spectrum" of the power spectrum as a function of the wavenumber k.

__init__(alpha, k0[, ndim])

integrate_E(kmin, kmax)

Integrate the energy spectrum E(k) over a range of wavenumbers.

renormalize(f_rms[, kmin, kmax])

Rescale the power spectrum's normalization so that the integral of its energy spectrum over [kmin, kmax] gives the desired RMS field value.