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_central_galaxy_alignment_profile(...)

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_satellite_galaxy_alignment_profile(...)

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.

get_all_parameter_names()

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.

quantities_available()

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

A_term

Return the integral over the missing mass.

C1

Linear alignment coefficient C1 multiplited with the 2h amplitude.

Dv_Mead

Overdensity \(\Delta_{\rm v}\) fitting function from Mead et al. 2021 (2009.01858), eq A.2.

I12

I21

I22

Ic_align_term

Compute the integral for the central galaxy alignment term in the 2-halo power spectrum.

Ic_term

Compute the integral for the central galaxy term in the 2-halo power spectrum.

Im_term

Compute the integral for the matter term in the 2-halo power spectrum, eq 35 of Asgari, Mead, Heymans 2023.

Is_align_term

Compute the integral for the satellite galaxy alignment term in the 2-halo power spectrum.

Is_term

Compute the integral for the satellite galaxy term in the 2-halo power spectrum.

K

Sets the c(M) normalisations to the one used in HMCode.

Mmax

Maximum halo mass (for hmf).

Mmin

Minimum halo mass (for hmf).

Neff

Effective number of neutrino species.

Tk_EH_nowiggle_lnt

align_params

Parameters for the alignment model.

alignment_amplitude_2h

The alignment amplitude for GI.

alignment_amplitude_2h_II

The alignment amplitude for II.

alignment_class

Set up the aligment amplitudes and radial dependence.

alignment_gi

2h alignment amplitude.

beta_cen

Beta parameter for central galaxies.

beta_nl

Non-linear bias parameter \(\beta_{\rm nl}\).

beta_sat

Beta parameter for satellite galaxies.

bias_model

Halo bias model (for halomod).

bnl

Whether to include non-linear bias.

calc_bnl

Calculate the non-linear bias using the NonLinearBias class.

central_alignment_profile

Prepare the grid in z, k and mass for the central alignment

central_galaxy_profile

Compute the galaxy profile for a sample of central galaxies.

compute_observable

Whether to compute observable.

conc_cen

Return the concentration for matter/central galaxies.

conc_sat

Return the concentration for satellite galaxies.

cosmo_model

Return the astropy cosmology object assuming Flatw0waCDM model.

dc_Mead

The critical overdensity for collapse \(\delta_c\) fitting function from Mead et al. 2021 (2009.01858).

delta_c

Critical density threshold for collapse \(\delta_c\).

dewiggle

Whether to dewiggle the power spectrum.

disable_mass_conversion

Dissables the mass conversion for the mass definitions defined in HMCode.

dlnk

Spacing in natural log of wavenumber (for hmf).

dlog10m

Spacing in log10 of halo mass (for hmf).

dndlnm

Return the differential mass function.

eta_cen

Bloating parameter for central galaxies.

eta_sat

float Bloating parameter for satellite galaxies.

fnu

Return the neutrino density fraction.

fortuna

Whether to use the Fortuna model.

fstar

Compute the stellar fraction.

fstar_mm

Compute the stellar fraction for the matter-matter power spectrum.

get_mead_accumulated_growth

Calculates the accumulated growth at scale factor 'a'.

get_mead_growth

Return the Mead growth factor at the scale factors.

get_mead_growth_fnc

Solve the linear growth ODE and returns an interpolating function for the solution.

growth_factor

Return the growth factor.

growth_model

Growth function model (for hmf).

growth_params

Parameters for the growth function (for hmf).

h0

Hubble parameter (small h).

halo_bias

Return the halo bias.

halo_concentration_model_dm

Halo concentration model of dark matter / central galaxies (for halomod).

halo_concentration_model_sat

Halo concentration model of satellite galaxies (for halomod).

halo_overdensity_mean

Return the mean halo overdensity.

halo_profile_model_dm

Halo profile model of dark matter / central galaxies (for halomod).

halo_profile_model_sat

Halo profile model of satellite galaxies (for halomod).

halo_profile_params

Packs the cosmology to a dictionary to be passed to the hmf.

hmf_model

Halo mass function model (for hmf).

hod

Initialize and return the HOD model.

hod_mm

Initialize and return the HOD model for matter-matter power spectrum.

hod_model

An HOD model to use

hod_params

Parameters for the HOD model.

hod_settings

Settings for the HOD model.

hod_settings_mm

Settings for the HOD model.

k_vec

Array of wavenumbers.

kh

Return the k vector defined using lnk in hmf.

lnk_max

Maximum natural log of wavenumber (for hmf).

lnk_min

Minimum natural log of wavenumber (for hmf).

log10T_AGN

Log10 of AGN temperature.

m_nu

Neutrino mass.

mass

Return the masses.

mass_avg

Compute the average mass.

matter_power_lin

Linear matter power spectrum.

matter_power_nl

Non-linear matter power spectrum

matter_profile

Compute the matter profile grid in z, k, and M.

matter_profile_2h

Compute the matter profile grid in z, k, and M.

matter_profile_with_feedback

Compute the matter profile grid with feedback.

mb

Gas distribution mass pivot parameter \(M_{\rm b}\).

mdef_model

Mass definition model (for hmf).

mdef_params

Sets the overdensity parameter to the one used in HMCode or to the one for virial collapse.

mead_correction

Correction model from Mead et al.

mean_density0

Return the mean density at redshift zero.

mean_density_z

Return the mean density at the given redshifts.

missing_mass_integral

Compute the integral over the missing mass.

mpivot_cen

Pivot mass for central galaxies.

mpivot_sat

Pivot mass for satellite galaxies.

n_s

Spectral index.

neff

Return the effective spectral index.

nfw_cen

Return the density profile for matter/central galaxies.

nfw_sat

Return the density profile for satellite galaxies.

nonlinear_power

Return the non-linear power spectrum at z (if options passed).

norm_cen

Normalization of c(M) relation for central galaxies.

norm_sat

Normalization of c(M) relation for satellite galaxies.

nu

Return the peak height parameter.

obs

Initialize and return the observable function.

obs_func

Return the observable function in correct units.

obs_func_cen

Return the observable function for central galaxies in correct units.

obs_func_obs

Return the observable function x-axis.

obs_func_sat

Return the observable function for satellite galaxies in correct units.

obs_func_z

Return the redshift for the observable function.

obs_settings

Settings for the observable.

omega_b

Baryon density parameter.

omega_c

Cold dark matter density parameter.

omega_m

Matter density parameter.

one_halo_ktrunc

Truncation wavenumber for the 1-halo term.

one_halo_ktrunc_ia

Truncation wavenumber for the 1-halo IA term.

one_halo_truncation

1-halo term truncation at large scales (small k)

one_halo_truncation_ia

1-halo term truncation for IA.

overdensity

Overdensity parameter.

parameter_values

Dictionary of all parameters and their current values

peff

Return the mixture of linear and non-linear power spectrum.

pointmass

Whether to use point mass approximation.

poisson_func

Calculates the Poisson parameter for use in Pgg integrals.

poisson_model

A Poisson parameter model to use

poisson_params

Parameters for the Poisson distribution.

power

Return the linear power spectrum at z.

power_spectrum_gg

Compute the galaxy-galaxy power spectrum.

power_spectrum_gi

Compute the galaxy-intrinsic alignment power spectrum.

power_spectrum_gm

Compute the galaxy-matter power spectrum.

power_spectrum_ii

Compute the intrinsic-intrinsic alignment power spectrum.

power_spectrum_lin

Return the linear power spectrum.

power_spectrum_mi

Compute the matter-intrinsic alignment power spectrum.

power_spectrum_mm

Compute the matter-matter power spectrum.

r_s_cen

Return the scale radius for matter/central galaxies.

r_s_sat

Return the scale radius for satellite galaxies.

response

Whether to calculate the resulting power spectra in response formalism.

rho_halo

Return the halo density.

rvir_cen

Return the virial radius for matter/central galaxies.

rvir_sat

Return the virial radius for satellite galaxies.

satellite_alignment_profile

Prepare the grid in z, k and mass for the satellite alignment

satellite_galaxy_profile

Compute the galaxy profile for a sample of satellite galaxies.

scale_factor

Return the scale factor.

sigma8_z

Return the amplitude of matter fluctuations on 8 Mpc scales at the given redshifts.

sigma_8

Amplitude of matter fluctuations on 8 Mpc scales.

t_eff

Effective parameter for the Fortuna model.

tcmb

Temperature of the CMB.

transfer_model

Transfer function model (for hmf).

transfer_params

Parameters for the transfer function (for hmf).

two_halo_ktrunc

Truncation wavenumber for the 2-halo term.

two_halo_ktrunc_ia

Truncation wavenumber for the 2-halo IA term.

two_halo_truncation

2-halo term truncation at larger k-values (large k).

two_halo_truncation_ia

2-halo term truncation for IA.

u_dm

Return the normalized density profile for dark matter.

u_sat

Return the normalized density profile for satellite galaxies.

w0

Dark energy equation of state parameter.

wa

Dark energy equation of state parameter.

wkm_sat

Compute the radial alignment profile of satellite galaxies.

z_vec

Array of redshifts.