Power Spectrum Window Functions¶
Class providing window functions \(W(k, M)\) for filtering the matter power spectrum when computing the rms mass variance \(\sigma(M) = \int \mathrm{d}k\, k^2 P(k) |W(k,M)|^2\). The window function smooths the density field on the scale enclosing mass \(M\), and the choice of window (e.g.real-space top-hat, sharp \(k\)-space, or Gaussian) affects the resulting mass function. Methods return the filter value at a given wavenumber and smoothing mass, and indicate the maximum relevant wavenumber and whether the amplitude is mass-independent.
Default implementation: powerSpectrumWindowFunctionTopHat
Methods¶
value→double precisionReturns the window function for power spectrum variance computation at the specified
wavenumber(in Mpc\(^{-1}\)) for a givensmoothingMass(in \(\mathrm{M}_\odot\)).double precision, intent(in ) :: wavenumber, smoothingMass, time
wavenumberMaximum→double precisionReturns the maximum wavenumber for which the window function for power spectrum variance computation is non-zero for a given
smoothingMass(in \(\mathrm{M}_\odot\)).double precision, intent(in ) :: smoothingMass
amplitudeIsMassIndependent→logicalShould return true if, and only if, the amplitude of the window function below the maximum wavenumber is independent of the smoothing mass scale.
powerSpectrumWindowFunctionETHOS¶
ETHOS window function for filtering of power spectra from Bohr et al. (2021). This window function was chosen to give good matches to N-body halo mass functions derived from the ETHOS transfer functions. Specifically the window function is given by:
with defaults of \(c_\mathrm{W} = 3.78062835\), \(\beta = 3.4638743\), where \(R\) is related to \(M\) via the standard relation \(M = \frac{4\pi}{3}\bar\rho_m R^3\).
Methods
tabulate— Tabulate the virial density contrast as a function of mass and time.restoreTable— Restore a tabulated solution from file.storeTable— Store a tabulated solution to file.
Parameters
powerSpectrumWindowFunctionETHOSExtended¶
A generalization of the ETHOS window function for filtering of power spectra from Bohr et al. (2021). The window function has the same functional form
but the parameters \(c_\mathrm{W}\) and \(\beta\) are now scale dependent following
where \(x\) refers to either \(c_\mathrm{W}\) or \(\beta\), \(n = \mathrm{d}\log P / \mathrm{d} \log k\) is the logarithmic derivative of the linear theory power spectrum, and \(n_0 = -2.6\) is a convenient zero-point.
Methods
powerSpectrumSlopeSmoothed— Compute the slope of the smoothed power spectrum.
Parameters
[cW0](real; default3.78062835d0) — The parameter \(c_\mathrm{W,0}\) in the generalized ETHOS power spectrum window function.[beta0](real; default3.4638743d0) — The parameter \(\beta_0\) in the generalized ETHOS power spectrum window function.[cW1](real; default0.0d0) — The parameter \(c_\mathrm{W,1}\) in the generalized ETHOS power spectrum window function.[beta1](real; default0.0d0) — The parameter \(\beta_1\) in the generalized ETHOS power spectrum window function.[wavenumberScaledMinimum](real; default0.0d0) — The parameter \(x_\mathrm{min}\) in the generalized ETHOS power spectrum window function.[powerSpectrumSmoothingWidth](real; default1.0d0) — The width (in natural logarithm of wavenumber) over which to smooth the power spectrum when estimating the power spectrum slope.[cW](real; default3.78062835d0) — The parameter \(c_\mathrm{W}\) in the Bohr et al. (2021) power spectrum window function. (inherited frompowerSpectrumWindowFunctionETHOS)[beta](real; default3.4638743d0) — The parameter \(\beta\) in the Bohr et al. (2021) power spectrum window function. (inherited frompowerSpectrumWindowFunctionETHOS)
powerSpectrumWindowFunctionHyperbolicTangent¶
A hyperbolic tangent window function for filtering of power spectra. The window function is given by:
where \(R\) is related to \(M\) via the standard relation \(M = \frac{4\pi}{3}\bar\rho_m R^3\).
Parameters
[c](real; default1.85d0) — The parameter \(c\) in the hyperbolic tangent power spectrum window function.[beta](real; default4.41d0) — The parameter \(\beta\) in the tangent power power spectrum window function.
powerSpectrumWindowFunctionLagrangianChan2017¶
A power spectrum window function class that implements the Lagrangian filter of Chan et al. (2017), which provides a smoothed transition in Fourier space designed to match the effective filtering of matter fields in Lagrangian perturbation theory. The scale of the embedded Gaussian window is controlled by the parameter \(f\) given by [f].
Parameters
[f](real; default1.0d0) — The parameter “\(f\)” which defines the scale of the Gaussian window.
powerSpectrumWindowFunctionSharpKSpace¶
A sharp \(k\)-space window function for filtering of power spectra. The window function is given by:
where if [normalization]\(=\)natural then \(k_\mathrm{s} = (6 \Pi^2 \bar{\rho} / M)^{1/3}\) for a smoothing scale \(M\) and mean matter density \(\bar{\rho}\). Otherwise, [normalization] must be set to a numerical value, \(\alpha\), in which case \(k_\mathrm{s} = \alpha / R_\mathrm{th}\) with \(R_\mathrm{th}=3M/4\pi\bar{\rho}\) for a smoothing scale \(M\) and mean matter density \(\bar{\rho}\).
Parameters
[normalization](string; defaultnatural) — The parameter \(a\) in the relation \(k_\mathrm{s} = a/r_\mathrm{s}\), where \(k_\mathrm{s}\) is the cut-off wavenumber for the sharp \(k\)-space window function and \(r_\mathrm{s}\) is the radius of a sphere (in real-space) enclosing the requested smoothing mass. Alternatively, a value ofnaturalwill be supplied in which case the normalization is chosen such that, in real-space, \(W(r=0)=1\). This results in a contained mass of \(M=6 \pi^2 \bar{\rho} k_\mathrm{s}^{-3}\).
powerSpectrumWindowFunctionSmoothKSpace¶
A smooth window function for filtering of power spectra in wavenumber space, defined as \(W(kR) = 1/[1+(kR)^\beta]\), providing a tunable, sharp-but-smooth transition between large and small scales. The shape exponent \(\beta\) and normalization relative to a top-hat filter are set by [beta] and [normalization].
Parameters
[normalization](real; default3.5d0) — The parameter “normalization” is equivalent to the normalization for a sharp-\(k\) filter. It serves as the ratio of mass scales of the object to the one in the spherical model: \(R/R_\mathrm{topHat}\).[beta](real; default3.7d0) — The parameter “beta” is defined as the exponent of “\(kR\)” in the denominator of the window function: \(W(kR)= 1/[1+(kR)^\beta]\).
powerSpectrumWindowFunctionTopHat¶
A top-hat in real space window function for filtering of power spectra. The window function is given by:
where \(x = k R\) and \(R=(3M/4\pi\bar{\rho})^{1/3}\) for a smoothing scale \(M\) and mean matter density \(\bar{\rho}\).
(Default implementation)
powerSpectrumWindowFunctionTopHatGeneralized¶
A generalized top-hat in real space window function for filtering of power spectra. The window function is given by (Brown et al., 2022):
where \(x = k R\) and \(R=(3M/4\pi\bar{\rho})^{1/3}\) for a smoothing scale \(M\) and mean matter density \(\bar{\rho}\), and \(\mu_\mathrm{g}\) is a parameter.
Parameters
[mu](real) — The parameter \(\mu_\mathrm{g}\) appearing in the generalized top-hat window function of Brown et al. (2022).
powerSpectrumWindowFunctionTopHatSharpKHybrid¶
A hybrid top-hat/sharp \(k\)-space window function for filtering of power spectra. This class implements a convolution of a top-hat window function and sharp \(k\)-space window function in \(k\)-space:
where
where \(x = k R_\mathrm{th}\), and
where \(k\mathrm{s} = \alpha / R_\mathrm{s}\) if [normalization] is assigned a numerical value. Alternatively, if [normalization]\(=\)natural then the value of \(\alpha\) is chosen such that \(k_\mathrm{s} = (6 \Pi^2 \bar{\rho}/M)^{1/3}\) if \(R_\mathrm{s}=3M/4\pi\bar{\rho}\). The radii, \(R_\mathrm{th}\) and \(R_\mathrm{s}\), are chosen such that:
where \(\beta=\)[radiiRatio].
Methods
radii— Set the radii of the components of the window function.
Parameters
[normalization](string; defaultnatural) — The parameter \(a\) in the relation \(k_\mathrm{s} = a/r_\mathrm{s}\), where \(k_\mathrm{s}\) is the cut-off wavenumber for the sharp \(k\)-space window function and \(r_\mathrm{s}\) is the radius of a sphere (in real-space) enclosing the requested smoothing mass. Alternatively, a value ofnaturalwill be supplied in which case the normalization is chosen such that, in real-space, \(W(r=0)=1\). This results in a contained mass of \(M=6 \pi^2 \bar{\rho} k_\mathrm{s}^{-3}\).[radiiRatio](real; default1.0d0) — The parameter \(\beta\) in the relation \(r_\mathrm{s}=\beta r_\mathrm{th}\) between \(k\)-space sharp and top-hat window function radii in the hybrid window function used for computing the variance in the power spectrum.
powerSpectrumWindowFunctionTopHatSmoothed¶
A top-hat in real space window function for filtering of power spectra, smoothed with a Gaussian. The window function is given by:
where \(x = k R\) and \(R=(3M/4\pi\bar{\rho})^{1/3}\) for a smoothing scale \(M\) and mean matter density \(\bar{\rho}\). \(\sigma\) is the width of the smoothing Gaussian in real space. This exponentially cuts off the window function at \(k \gg 1/\sigma\).
Parameters
[sigma](real; default3.0d0) — The parameter “\(\sigma\)” which defines the width of the smoothing Gaussian.