dsf.modelling package¶
Submodules¶
Module contents¶
Cosmological and astrophysical models and corrections.
- dsf.modelling.delta_sigma_lens_mag_correction(r, a_lens, a_source, cosmo, alpha_lens)[source]¶
Compute the lens-magnification correction to Delta Sigma.
This returns the comoving correction to the excess surface density profile caused by magnification of the lens sample. The correction is evaluated at lens scale factor
a_lens, source scale factora_source, and projected comoving radiir.The returned correction has the same radial shape as
rand is intended to be subtracted from the measured Delta Sigma signal.- Parameters:
r (NDArray[float64]) – Comoving projected radii in Mpc.
a_lens (float) – Lens scale factor.
a_source (float) – Source scale factor.
cosmo (Cosmology) – CCL cosmology object.
alpha_lens (float) – Lens-sample magnification-bias slope. The correction is proportional to
alpha_lens - 1.
- Returns:
Comoving lens-magnification correction in \(M_\odot / \mathrm{pc}^2\).
- Raises:
ValueError – If the radius array, lens scale factor, source scale factor,
lens magnification-bias slope, or derived lens/source redshift pair is invalid. –
- Return type:
NDArray[float64]
- dsf.modelling.get_lens_mag_integ_params()[source]¶
Return the lens-magnification integration parameters.
- Returns:
Copy of the current lens-magnification integration parameter dictionary.
- Return type:
dict[str, int | float]
- dsf.modelling.hod_galaxy_bias(cosmo, *, a, concentration=None, **hod_kwargs)[source]¶
Calculate the occupation-weighted linear galaxy bias.
The effective bias is computed by averaging the halo bias over the central and satellite occupations, weighted by the halo mass function.
- Parameters:
cosmo (Cosmology) – CCL cosmology.
a (float) – Scale factor.
concentration (Concentration | None) – Optional CCL concentration model. Defaults to Duffy08. The model must be compatible with the 200c halo mass definition.
**hod_kwargs (Any) – HOD profile parameters.
- Returns:
Effective linear galaxy bias.
- Raises:
ValueError – If the scale factor is invalid or the galaxy normalization is nonfinite or nonpositive.
- Return type:
float
- dsf.modelling.make_ccl_cosmology(cosmology=None, **kwargs)[source]¶
Construct a CCL cosmology, supporting Omega_m and S8 parameterizations.
- Parameters:
cosmology (Mapping[str, Any] | None) – Optional mapping of fiducial cosmological parameters.
**kwargs (Any) – Cosmological parameters overriding the fiducial values.
- Returns:
CCL cosmology object.
- Raises:
ValueError – If incompatible parameterizations are supplied.
KeyError – If parameters required for conversion are missing.
- Return type:
Cosmology
Notes
Omega_m is interpreted as Omega_c + Omega_b, assuming massless neutrinos. Keyword overrides may replace the fiducial density or amplitude parameterization.
- dsf.modelling.pk2d_hod(cosmo, *, k_array, a_array, concentration=None, **hod_kwargs)[source]¶
Construct standard HOD power spectra.
- Parameters:
cosmo (Cosmology) – CCL cosmology.
k_array (NDArray[float64]) – Wavenumber grid.
a_array (NDArray[float64]) – Scale-factor grid.
concentration (Concentration | None) – Optional CCL concentration model. Defaults to Duffy08. The model must be compatible with the 200c halo mass definition.
**hod_kwargs (Any) – HOD profile parameters.
- Returns:
Dictionary containing
pk_deltasigma,pk_gm, andpk_gg.- Return type:
dict[str, Pk2D]
- dsf.modelling.pk2d_hod_baryonified(cosmo, *, k_array, a_array, f_c=1.0, concentration=None, **hod_kwargs)[source]¶
Construct HOD power spectra with baryonic concentration rescaling.
- Parameters:
cosmo (Cosmology) – CCL cosmology.
k_array (NDArray[float64]) – Wavenumber grid.
a_array (NDArray[float64]) – Scale-factor grid.
f_c (float) – Multiplicative concentration rescaling.
concentration (Concentration | None) – Optional CCL concentration model. Defaults to Duffy08.
**hod_kwargs (Any) – HOD profile parameters.
- Returns:
Density-weighted galaxy-matter, galaxy-matter, and galaxy-galaxy spectra.
- Return type:
dict[str, Pk2D]
- dsf.modelling.pk2d_hod_baryonified_with_nla(cosmo, *, k_array, a_array, f_c=1.0, A_IA=0.0, C1rhocrit=0.0134, b_g=None, a_bias=1.0, concentration=None, **hod_kwargs)[source]¶
Construct baryonified HOD spectra with an optional NLA contribution.
- Parameters:
cosmo (Cosmology) – CCL cosmology.
k_array (NDArray[float64]) – Wavenumber grid.
a_array (NDArray[float64]) – Scale-factor grid.
f_c (float) – Baryonic concentration rescaling.
A_IA (float) – Intrinsic alignment amplitude.
C1rhocrit (float) – NLA normalization.
b_g (float | None) – Galaxy bias, computed from the HOD if
None.a_bias (float) – Scale factor for the HOD bias calculation.
concentration (Concentration | None) – Optional CCL concentration model.
**hod_kwargs (Any) – HOD profile parameters.
- Returns:
Delta Sigma spectrum including NLA and baryonified HOD covariance spectra.
- Return type:
dict[str, Pk2D]
- dsf.modelling.pk2d_hod_with_nla(cosmo, *, k_array, a_array, A_IA=0.0, C1rhocrit=0.0134, b_g=None, a_bias=1.0, concentration=None, **hod_kwargs)[source]¶
Construct HOD spectra with an optional NLA contribution.
- Parameters:
cosmo (Cosmology) – CCL cosmology.
k_array (NDArray[float64]) – Wavenumber grid.
a_array (NDArray[float64]) – Scale-factor grid.
A_IA (float) – Intrinsic alignment amplitude.
C1rhocrit (float) – NLA normalization.
b_g (float | None) – Galaxy bias, computed from the HOD if
None.a_bias (float) – Scale factor for the HOD bias calculation.
concentration (Concentration | None) – Optional CCL concentration model.
**hod_kwargs (Any) – HOD profile parameters.
- Returns:
Delta Sigma spectrum including NLA and HOD-only covariance spectra.
- Return type:
dict[str, Pk2D]
- dsf.modelling.pk2d_nla(cosmo, *, k_array, a_array, A_IA, C1rhocrit=0.0134, b_g=1.0)[source]¶
Construct nonlinear alignment galaxy-intrinsic power spectra.
The galaxy-intrinsic spectrum follows the nonlinear alignment model, with a constant intrinsic alignment amplitude and galaxy bias.
- Parameters:
cosmo (Cosmology) – CCL cosmology.
k_array (NDArray[float64]) – Wavenumber grid.
a_array (NDArray[float64]) – Scale-factor grid.
A_IA (float) – Intrinsic alignment amplitude.
C1rhocrit (float) – Intrinsic alignment normalization.
b_g (float) – Linear galaxy bias.
- Returns:
Dictionary containing
pk_deltasigmaandpk_gi.- Return type:
dict[str, Pk2D]
- dsf.modelling.set_lens_mag_integ_params(**kwargs)[source]¶
Update the lens-magnification integration parameters.
- Parameters:
**kwargs (Any) – Integration parameters to update. Supported keys are
n_ell,ell_min,ell_max,z_stepsize,z_min, anduse_hankel_offset.use_hankel_offsetapplies an offset to the logarithmic spacing of the output, which can reduce numerical ringing at the cost of some accuracy.- Raises:
KeyError – If an unknown integration parameter is supplied.
ValueError – If the updated integration parameters are invalid.
- Return type:
None