skypy.power_spectrum.eisenstein_hu

skypy.power_spectrum.eisenstein_hu(wavenumber, A_s, n_s, cosmology, kwmap=0.02, wiggle=True)[source] [edit on github]

Eisenstein & Hu matter power spectrum. This function returns the Eisenstein and Hu fitting function for the linear matter power spectrum with (or without) baryon acoustic oscillations, c.f. [1] and [2], using formulation from Komatsu et al (2009) in [3].

Parameters
wavenumber(nk, ) array_like

Array of wavenumbers in units of Mpc-1 at which to evaluate the linear matter power spectrum.

A_s, n_s: float

Amplitude and spectral index of primordial scalar fluctuations.

cosmologyastropy.cosmology.Cosmology

Cosmology object providing omega_matter, omega_baryon, Hubble parameter and CMB temperature in the present day.

kwmapfloat

WMAP normalization for the amplitude of primordial scalar fluctuations, as described in [3], in units of Mpc-1. Default is 0.02.

wigglebool

Boolean flag to set the use of baryion acoustic oscillations wiggles. Default is True, for which the power spectrum is computed with the wiggles.

Returns
power_spectrumarray_like

Linear matter power spectrum in units of Mpc3, evaluated at the given wavenumbers for the input primordial power spectrum parameters A_s and n_s, cosmology, and kwmap normalization.

References

1

Eisenstein D. J., Hu W., ApJ, 496, 605 (1998)

2

Eisenstein D. J., Hu W., ApJ, 511, 5 (1999)

3

Komatsu et al., ApJS, 180, 330 (2009)

Examples

This example returns the Eisenstein and Hu matter power spectrum with baryon acoustic oscillations for the Astropy default cosmology at a given array of wavenumbers:

>>> import numpy as np
>>> from astropy.cosmology import default_cosmology
>>> wavenumber = np.logspace(-3, 1, num=5, base=10.0)
>>> A_s, n_s = 2.1982e-09, 0.969453
>>> cosmology = default_cosmology.get()
>>> eisenstein_hu(wavenumber, A_s, n_s, cosmology, kwmap=0.02,
...               wiggle=True)
array([6.47460158e+03, 3.71610099e+04, 9.65702614e+03, 1.14604456e+02,
   3.91399918e-01])