onepower.pk.Spectra#
- class onepower.pk.Spectra(*args, **kwargs)[source]#
Class to compute matter power spectra using the halo model approach.
Methods
I_NL
(W_1, W_2, b_1, b_2, dndlnm_1, dndlnm_2, ...)Calculate the integral over beta_nl using equations A.7 to A.10 from Mead and Verde 2021.
Tk_cold_ratio
(k, g, ommh2, h, f_nu, N_nu[, ...])Ratio of cold to matter transfer function from Eisenstein & Hu (1999).
__init__
([matter_power_lin, ...])clone
(**kwargs)Create and return an updated clone of the current object.
compute_1h_term
(profile_u, profile_v, mass, ...)Compute the 1-halo term for two fields u and v, e.g. matter, galaxy, intrinsic alignment.
compute_A_term
(mass, b_dm, dndlnm, mean_density0)Integral over the missing haloes.
compute_Ig_term
(profile, mass, dndlnm, b_m)Compute the integral for the galaxy term in the 2-halo power spectrum.
compute_Im_term
(mass, u_dm, b_dm, dndlnm, ...)Compute the integral for the matter term in the 2-halo power spectrum.
Compute the central galaxy alignment profile.
compute_matter_profile
(mass, mean_density0, ...)Compute the matter halo profile with a correction for neutrino mass fraction.
compute_matter_profile_with_feedback
(mass, ...)Compute the matter profile including feedback as modelled by hmcode2020 (eq 25 of 2009.01858).
compute_matter_profile_with_feedback_stellar_fraction_from_obs
(...)Compute the matter profile using stellar fraction from observations.
Compute the satellite galaxy alignment profile.
dewiggle_plin
(plin)Dewiggle the linear power spectrum.
f_Mead
(x, y, p0, p1, p2, p3)Fitting function from Mead et al. 2021 (2009.01858), eq A3, used in \(\delta_c\) and \(\Delta_{\rm v}\) calculations.
fg
(mass, z_vec, fstar[, beta])Compute the gas fraction, eq 24 of Mead et al. 2021.
fg_fit
(mass, mb, fstar[, beta])Compute the gas fraction for a general baryonic feedback model, eq 24 of Mead et al. 2021.
fs
(z_vec)Compute the stellar fraction from table 4 and eq 26 of Mead et al. 2021.
get_Pk_wiggle
(k, Pk_lin, ns[, sigma_dlnk])Extract the wiggle from the linear power spectrum.
get_all_parameter_defaults
([recursive])Dictionary of all parameters and defaults.
Yield all parameter names in the class.
get_dependencies
(*q)Determine all parameter dependencies of the quantities in q.
get_halo_collapse_redshifts
(M, z, dc, g, ...)Calculate halo collapse redshifts according to the Bullock et al. (2001) prescription.
matter_profile_with_feedback_stellar_fraction_from_obs
(fstar)Compute the matter profile grid using stellar fraction from observations.
one_halo_truncation_mead
(sigma8_in)1-halo term truncation in Mead et al. 2021, eq 17 and table 2.
parameter_info
([names])Prints information about each parameter in the class.
prepare_I12_integrand
(b_1, b_2, dndlnm_1, ...)Prepare the integrand for the I12 term.
prepare_I21_integrand
(b_1, b_2, dndlnm_1, ...)Prepare the integrand for the I21 term.
prepare_I22_integrand
(b_1, b_2, dndlnm_1, ...)Prepare the integrand for the I22 term.
Obtain a list of all available output quantities.
sigmaR_cc
(power, k, r)Calculate the variance of the cold matter density field smoothed on scale R.
sigmaV
(k, power)Calculate the dispersion from the power spectrum.
transition_smoothing
(neff, p_1h, p_2h)Smooth the transition between 1 and 2 halo terms, eq 23 and table 2 of Mead et al. 2021.
trapezoidal_integrator
(integrand, x, axis)Trapezoidal integrator using fixed weights and tensor dot product as mass does not change.
two_halo_truncation_mead
(sigma8_in)2-halo term truncation in Mead et al. 2021, eq 16.
update
(**kwargs)Update parameters of the framework with kwargs.
validate
()Perform validation of the input parameters as they relate to each other.
Attributes
Return the integral over the missing mass.
Linear alignment coefficient C1 multiplited with the 2h amplitude.
Overdensity \(\Delta_{\rm v}\) fitting function from Mead et al. 2021 (2009.01858), eq A.2.
Compute the integral for the central galaxy alignment term in the 2-halo power spectrum.
Compute the integral for the central galaxy term in the 2-halo power spectrum.
Compute the integral for the matter term in the 2-halo power spectrum, eq 35 of Asgari, Mead, Heymans 2023.
Compute the integral for the satellite galaxy alignment term in the 2-halo power spectrum.
Compute the integral for the satellite galaxy term in the 2-halo power spectrum.
Sets the c(M) normalisations to the one used in HMCode.
Maximum halo mass (for hmf).
Minimum halo mass (for hmf).
Effective number of neutrino species.
Parameters for the alignment model.
The alignment amplitude for GI.
The alignment amplitude for II.
Set up the aligment amplitudes and radial dependence.
2h alignment amplitude.
Beta parameter for central galaxies.
Non-linear bias parameter \(\beta_{\rm nl}\).
Beta parameter for satellite galaxies.
Halo bias model (for halomod).
Whether to include non-linear bias.
Calculate the non-linear bias using the NonLinearBias class.
Prepare the grid in z, k and mass for the central alignment
Compute the galaxy profile for a sample of central galaxies.
Whether to compute observable.
Return the concentration for matter/central galaxies.
Return the concentration for satellite galaxies.
Return the astropy cosmology object assuming Flatw0waCDM model.
The critical overdensity for collapse \(\delta_c\) fitting function from Mead et al. 2021 (2009.01858).
Critical density threshold for collapse \(\delta_c\).
Whether to dewiggle the power spectrum.
Dissables the mass conversion for the mass definitions defined in HMCode.
Spacing in natural log of wavenumber (for hmf).
Spacing in log10 of halo mass (for hmf).
Return the differential mass function.
Bloating parameter for central galaxies.
float Bloating parameter for satellite galaxies.
Return the neutrino density fraction.
Whether to use the Fortuna model.
Compute the stellar fraction.
Compute the stellar fraction for the matter-matter power spectrum.
Calculates the accumulated growth at scale factor 'a'.
Return the Mead growth factor at the scale factors.
Solve the linear growth ODE and returns an interpolating function for the solution.
Return the growth factor.
Growth function model (for hmf).
Parameters for the growth function (for hmf).
Hubble parameter (small h).
Return the halo bias.
Halo concentration model of dark matter / central galaxies (for halomod).
Halo concentration model of satellite galaxies (for halomod).
Return the mean halo overdensity.
Halo profile model of dark matter / central galaxies (for halomod).
Halo profile model of satellite galaxies (for halomod).
Packs the cosmology to a dictionary to be passed to the hmf.
Halo mass function model (for hmf).
Initialize and return the HOD model.
Initialize and return the HOD model for matter-matter power spectrum.
An HOD model to use
Parameters for the HOD model.
Settings for the HOD model.
Settings for the HOD model.
Array of wavenumbers.
Return the k vector defined using lnk in hmf.
Maximum natural log of wavenumber (for hmf).
Minimum natural log of wavenumber (for hmf).
Log10 of AGN temperature.
Neutrino mass.
Return the masses.
Compute the average mass.
Linear matter power spectrum.
Non-linear matter power spectrum
Compute the matter profile grid in z, k, and M.
Compute the matter profile grid in z, k, and M.
Compute the matter profile grid with feedback.
Gas distribution mass pivot parameter \(M_{\rm b}\).
Mass definition model (for hmf).
Sets the overdensity parameter to the one used in HMCode or to the one for virial collapse.
Correction model from Mead et al.
Return the mean density at redshift zero.
Return the mean density at the given redshifts.
Compute the integral over the missing mass.
Pivot mass for central galaxies.
Pivot mass for satellite galaxies.
Spectral index.
Return the effective spectral index.
Return the density profile for matter/central galaxies.
Return the density profile for satellite galaxies.
Return the non-linear power spectrum at z (if options passed).
Normalization of c(M) relation for central galaxies.
Normalization of c(M) relation for satellite galaxies.
Return the peak height parameter.
Initialize and return the observable function.
Return the observable function in correct units.
Return the observable function for central galaxies in correct units.
Return the observable function x-axis.
Return the observable function for satellite galaxies in correct units.
Return the redshift for the observable function.
Settings for the observable.
Baryon density parameter.
Cold dark matter density parameter.
Matter density parameter.
Truncation wavenumber for the 1-halo term.
Truncation wavenumber for the 1-halo IA term.
1-halo term truncation at large scales (small k)
1-halo term truncation for IA.
Overdensity parameter.
Dictionary of all parameters and their current values
Return the mixture of linear and non-linear power spectrum.
Whether to use point mass approximation.
Calculates the Poisson parameter for use in Pgg integrals.
A Poisson parameter model to use
Parameters for the Poisson distribution.
Return the linear power spectrum at z.
Compute the galaxy-galaxy power spectrum.
Compute the galaxy-intrinsic alignment power spectrum.
Compute the galaxy-matter power spectrum.
Compute the intrinsic-intrinsic alignment power spectrum.
Return the linear power spectrum.
Compute the matter-intrinsic alignment power spectrum.
Compute the matter-matter power spectrum.
Return the scale radius for matter/central galaxies.
Return the scale radius for satellite galaxies.
Whether to calculate the resulting power spectra in response formalism.
Return the halo density.
Return the virial radius for matter/central galaxies.
Return the virial radius for satellite galaxies.
Prepare the grid in z, k and mass for the satellite alignment
Compute the galaxy profile for a sample of satellite galaxies.
Return the scale factor.
Return the amplitude of matter fluctuations on 8 Mpc scales at the given redshifts.
Amplitude of matter fluctuations on 8 Mpc scales.
Effective parameter for the Fortuna model.
Temperature of the CMB.
Transfer function model (for hmf).
Parameters for the transfer function (for hmf).
Truncation wavenumber for the 2-halo term.
Truncation wavenumber for the 2-halo IA term.
2-halo term truncation at larger k-values (large k).
2-halo term truncation for IA.
Return the normalized density profile for dark matter.
Return the normalized density profile for satellite galaxies.
Dark energy equation of state parameter.
Dark energy equation of state parameter.
Compute the radial alignment profile of satellite galaxies.
Array of redshifts.