skypy.power_spectrum.classy¶
-
skypy.power_spectrum.classy(wavenumber, redshift, cosmology, **kwargs)[source] [edit on github]¶ Return the CLASS computation of the linear matter power spectrum, on a two dimensional grid of wavenumber and redshift.
Additional CLASS parameters can be passed via keyword arguments.
- Parameters
- wavenumber(nk,) array_like
Array of wavenumbers in units of Mpc-1 at which to evaluate the linear matter power spectrum.
- redshift(nz,) array_like
Array of redshifts at which to evaluate the linear matter power spectrum.
- cosmologyastropy.cosmology.Cosmology
Cosmology object providing omega_matter, omega_baryon, Hubble parameter and CMB temperature in the present day
- Returns
- power_spectrum(nz, nk) array_like
Array of values for the linear matter power spectrum in Mpc3 evaluated at the input wavenumbers for the given primordial power spectrum parameters, cosmology. For nz redshifts and nk wavenumbers the returned array will have shape (nz, nk).
References
doi : 10.1088/1475-7516/2011/07/034 arXiv: 1104.2932, 1104.2933
Examples
>>> import numpy as np >>> from astropy.cosmology import default_cosmology >>> cosmology = default_cosmology.get() >>> redshift = np.array([0, 1]) >>> wavenumber = np.array([1.e-2, 1.e-1, 1e0]) >>> A_s = 2.e-9 >>> n_s = 0.965 >>> z_reio = 10. >>> classy(wavenumber, redshift, cosmology, A_s, n_s, z_reio) array([[2.34758952e+04, 8.70837957e+03], [3.03660813e+03, 1.12836115e+03], [2.53124880e+01, 9.40802814e+00]])