firecrown.modeling_tools
Basic Cosmology and cosmological tools definitions.
modeling_tools contains the ModelingTools class, which is
built around the pyccl.Cosmology class. This is used by likelihoods
that need to access reusable objects, such as perturbation theory or halo model
calculators.
Classes
Modeling tools for likelihoods. |
|
Abstract base class for power spectrum modifiers. |
Module Contents
- class firecrown.modeling_tools.ModelingTools(*, pt_calculator=None, hm_calculator=None, cM_relation=None, pk_modifiers=None, cluster_abundance=None, cluster_deltasigma=None, ccl_factory=None)[source]
Bases:
firecrown.updatable.Updatable
Modeling tools for likelihoods.
A class that bundles together a
pyccl.Cosmologyobject and associated objects, such as perturbation theory or halo model calculator workspaces.- Parameters:
pt_calculator (None | pyccl.nl_pt.EulerianPTCalculator)
hm_calculator (None | pyccl.halos.HMCalculator)
cM_relation (None | str)
pk_modifiers (None | Collection[PowerspectrumModifier])
cluster_abundance (None | firecrown.models.cluster.abundance.ClusterAbundance)
cluster_deltasigma (None | firecrown.models.cluster.deltasigma.ClusterDeltaSigma)
ccl_factory (None | firecrown.ccl_factory.CCLFactory)
- ccl_cosmo: None | pyccl.Cosmology = None
- pt_calculator: None | pyccl.nl_pt.EulerianPTCalculator = None
- hm_calculator: None | pyccl.halos.HMCalculator = None
- cM_relation: None | str = None
- pk_modifiers: firecrown.updatable.UpdatableCollection
- powerspectra: dict[str, pyccl.Pk2D]
- cluster_abundance = None
- cluster_deltasigma = None
- ccl_factory
- add_pk(name, powerspectrum)[source]
Add a
pyccl.Pk2Dto the table of power spectra.- Parameters:
name (str) – the name of the power spectrum
powerspectrum (pyccl.Pk2D) – the power spectrum
- Return type:
None
- get_pk(name)[source]
Access a power spectrum from the table of power spectra.
Either retrieve a pyccl.Pk2D from the table of power spectra, or fall back to what the pyccl.Cosmology object can provide. :param name: the name of the desired power spectrum
- Parameters:
name (str)
- Return type:
pyccl.Pk2D
- has_pk(name)[source]
Check if a power spectrum with name name is available.
- Parameters:
name (str)
- Return type:
bool
- prepare(*, calculator_args=None)[source]
Prepare the Cosmology for use in likelihoods.
This method will prepare the ModelingTools for use in likelihoods. This includes building the perturbation theory and halo model calculators if they are needed.
- Parameters:
calculator_args (None | firecrown.ccl_factory.CCLCalculatorArgs) – the CCL calculator arguments
- Return type:
None
- get_pt_calculator()[source]
Return the perturbation theory calculator object.
- Return type:
pyccl.nl_pt.EulerianPTCalculator
- class firecrown.modeling_tools.PowerspectrumModifier(parameter_prefix=None)[source]
Bases:
firecrown.updatable.Updatable,abc.ABC
Abstract base class for power spectrum modifiers.
- Parameters:
parameter_prefix (None | str)
- name: str = 'base:base'
- abstractmethod compute_p_of_k_z(tools)[source]
Compute the 3D power spectrum P(k, z).
- Parameters:
tools (ModelingTools)
- Return type:
pyccl.Pk2D