BaryonForge.utils.concentration module
- class BaryonForge.utils.concentration.BaseGenericConcentration(self, *, mass_def)[source]
Bases:
ConcentrationGeneric concentration re-mapper between halo mass definitions.
This base class converts a concentration–mass relation defined for an input mass definition (
mdef_in) to a target mass definition (mass_def), preserving the scale radius \(r_s\). Subclasses should set the class attributescmodel(a concentration model factory) andmdef_in(the inputpyccl.halos.massdef.HaloMassDef), then initialize this class with the desired targetmass_def.- Parameters:
mass_def (pyccl.halos.massdef.HaloMassDef) – Target halo mass definition for which concentrations will be returned (e.g.,
MassDef200m(),MassDef200c(),MassDefVir(), etc.).
- cmodel
A factory for a concentration model that accepts
mass_def=and returns a callablec(M, a). It will be invoked ascmodel(mass_def=self.mdef_in)(cosmo, M, a).- Type:
callable
- mdef_in
Input mass definition on which the underlying concentration–mass model is calibrated.
- Type:
pyccl.halos.massdef.HaloMassDef
- M_in_lo
Lower bound of the internal sampling range for mass translation (default:
1e10).- Type:
float, optional
- M_in_hi
Upper bound of the internal sampling range for mass translation (default:
1e16).- Type:
float, optional
- M_in_N
Number of logarithmically spaced samples between
M_in_loandM_in_hiused to construct the translation grid (default:100).- Type:
int, optional
- Call Signature
- --------------
- __call__(cosmo, M, a)
Remap the concentration–mass relation to the target
mass_defand evaluate it at the requested massesM.
- Parameters:
cosmo (pyccl.Cosmology) – Cosmology object used by pyCCL.
M (array_like) – Halo masses in the target mass definition
mass_def. Must be broadcastable to a 1D array. Units must be consistent with your pyCCL configuration (typically \(M_\odot/h\)).a (float) – Scale factor \(a = 1/(1+z)\).
- Returns:
c_use – Concentrations evaluated at
Mfor the target mass definitionmass_def; same shape asM.- Return type:
numpy.ndarray
Notes
The algorithm computes the
cdelta-Mdeltarelation for the input mass definition. Then we convertMdeltato the target massMoutwith the right mass definition. We can then take the scale radiusrscomputed from the input mass definition and use it with the radiusRoutof the output mass definition, to get concentrationcout.Examples
Define a subclass that remaps a calibrated model from 200c to 200m:
>>> from pyccl.halos import massdef >>> class MyDuffyRemapper(BaseGenericConcentration): ... cmodel = Duffy08Concentration # factory taking mass_def=... ... mdef_in = massdef.MassDef200c() ... >>> cm = MyDuffyRemapper(mass_def=massdef.MassDef200m()) >>> c = cm(cosmo, M=[1e12, 1e13], a=1.0)
- cmodel = None
- mdef_in = None
- M_in_lo = 10000000000.0
- M_in_hi = 1e+16
- M_in_N = 100
- name = 'BaseGeneric'
- class BaryonForge.utils.concentration.GenericConcentrationDuffy08(self, *, mass_def)[source]
Bases:
BaseGenericConcentration- cmodel
alias of
ConcentrationDuffy08
- class BaryonForge.utils.concentration.GenericConcentrationKlypin11(self, *, mass_def)[source]
Bases:
BaseGenericConcentration- cmodel
alias of
ConcentrationKlypin11
- class BaryonForge.utils.concentration.GenericConcentrationPrada12(self, *, mass_def)[source]
Bases:
BaseGenericConcentration- cmodel
alias of
ConcentrationPrada12
- class BaryonForge.utils.concentration.GenericConcentrationDiemer15(self, *, mass_def)[source]
Bases:
BaseGenericConcentration- cmodel
alias of
ConcentrationDiemer15
- class BaryonForge.utils.concentration.GenericConcentrationIshiyama21(self, *, mass_def)[source]
Bases:
BaseGenericConcentration- cmodel
alias of
ConcentrationIshiyama21