nbodykit.cosmology.power.linear

Functions

EHPower(cosmo, redshift)

NoWiggleEHPower(cosmo, redshift)

Classes

LinearPower(cosmo, redshift[, transfer])

An object to compute the linear power spectrum and related quantities, using a transfer function from the CLASS code or the analytic Eisenstein & Hu approximation.

class nbodykit.cosmology.power.linear.LinearPower(cosmo, redshift, transfer='CLASS')[source]

An object to compute the linear power spectrum and related quantities, using a transfer function from the CLASS code or the analytic Eisenstein & Hu approximation.

Parameters
  • cosmo (Cosmology, astropy.cosmology.FLRW) – the cosmology instance; astropy cosmology objects are automatically converted to the proper type

  • redshift (float) – the redshift of the power spectrum

  • transfer (str, optional) – string specifying the transfer function to use; one of ‘CLASS’, ‘EisensteinHu’, ‘NoWiggleEisensteinHu’

cosmo

the object giving the cosmological parameters

Type

class:Cosmology

sigma8

the z=0 amplitude of matter fluctuations

Type

float

redshift

the redshift to compute the power at

Type

float

transfer

the type of transfer function used

Type

str

Attributes
attrs

The meta-data dictionary

redshift

The redshift of the power spectrum

sigma8

The present day value of sigma_r(r=8 Mpc/h), used to normalize the power spectrum, which is proportional to the square of this value.

Methods

__call__(k)

Return the linear power spectrum in units of \(h^{-3} \mathrm{Mpc}^3\) at the redshift specified by redshift.

sigma_r(r[, kmin, kmax])

The mass fluctuation within a sphere of radius r, in units of \(h^{-1} Mpc\) at redshift.

velocity_dispersion([kmin, kmax])

The velocity dispersion in units of of \(\mathrm{Mpc/h}\) at redshift.

__call__(k)[source]

Return the linear power spectrum in units of \(h^{-3} \mathrm{Mpc}^3\) at the redshift specified by redshift.

The transfer function used to evaluate the power spectrum is specified by the transfer attribute.

Parameters

k (float, array_like) – the wavenumber in units of \(h Mpc^{-1}\)

Returns

Pk – the linear power spectrum evaluated at k in units of \(h^{-3} \mathrm{Mpc}^3\)

Return type

float, array_like

property attrs

The meta-data dictionary

property redshift

The redshift of the power spectrum

property sigma8

The present day value of sigma_r(r=8 Mpc/h), used to normalize the power spectrum, which is proportional to the square of this value.

The power spectrum can re-normalized by setting a different value for this parameter

sigma_r(r, kmin=1e-05, kmax=10.0)[source]

The mass fluctuation within a sphere of radius r, in units of \(h^{-1} Mpc\) at redshift.

This returns \(\sigma\), where

\[\sigma^2 = \int_0^\infty \frac{k^3 P(k,z)}{2\pi^2} W^2_T(kr) \frac{dk}{k},\]

where \(W_T(x) = 3/x^3 (\mathrm{sin}x - x\mathrm{cos}x)\) is a top-hat filter in Fourier space.

The value of this function with r=8 returns sigma8, within numerical precision.

Parameters
  • r (float, array_like) – the scale to compute the mass fluctation over, in units of \(h^{-1} Mpc\)

  • kmin (float, optional) – the lower bound for the integral, in units of \(\mathrm{Mpc/h}\)

  • kmax (float, optional) – the upper bound for the integral, in units of \(\mathrm{Mpc/h}\)

velocity_dispersion(kmin=1e-05, kmax=10.0, **kwargs)[source]

The velocity dispersion in units of of \(\mathrm{Mpc/h}\) at redshift.

This returns \(\sigma_v\), defined as

\[\sigma_v^2 = \frac{1}{3} \int_a^b \frac{d^3 q}{(2\pi)^3} \frac{P(q,z)}{q^2}.\]
Parameters
  • kmin (float, optional) – the lower bound for the integral, in units of \(\mathrm{Mpc/h}\)

  • kmax (float, optional) – the upper bound for the integral, in units of \(\mathrm{Mpc/h}\)