firecrown.modeling_tools.ModelingTools#
- class firecrown.modeling_tools.ModelingTools(*, pt_calculator=None, pk_modifiers=None, cluster_abundance=None)[source]#
Bases:
UpdatableModeling 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 (
Optional[EulerianPTCalculator]) –pk_modifiers (
Optional[Collection[PowerspectrumModifier]]) –cluster_abundance (
Optional[ClusterAbundance]) –
Public Methods:
__init__(*[, pt_calculator, pk_modifiers, ...])Updatable initialization.
add_pk(name, powerspectrum)Add a
pyccl.Pk2Dto the table of power spectra.get_pk(name)Access a power spectrum from the table of power spectra.
has_pk(name)Check if a power spectrum with name name is available.
prepare(ccl_cosmo)Prepare the Cosmology for use in likelihoods.
Return the CCL cosmology object.
Return the perturbation theory calculator object.
Inherited from
Updatable__init__([parameter_prefix])Updatable initialization.
__setattr__(key, value)Set the attribute named
keyto the supplied value.set_parameter(key, value)Sets the parameter to the given value.
set_internal_parameter(key, value)Assure this InternalParameter has not already been set, and then set it.
set_sampler_parameter(key, value)Assure this SamplerParameter has not already been set, and then set it.
update(params)Update self by calling to prepare for the next MCMC sample.
Determine if the object has been updated.
reset()Reset the updatable.
Returns a RequiredParameters object.
Returns a collection of derived parameters.
Private Methods:
_reset()Resets all CCL objects in ModelingTools.
Inherited from
Updatable
- _reset()[source]#
Resets all CCL objects in ModelingTools.
This method is called by the Updatable base class when the object is destroyed. It also resets the power spectra, the cosmology and the _prepared state variable.
- Return type:
None
- add_pk(name, powerspectrum)[source]#
Add a
pyccl.Pk2Dto the table of power spectra.- Parameters:
name (
str) –powerspectrum (
Pk2D) –
- Return type:
None
- get_pk(name)[source]#
Access a power spectrum from the table of power spectra.
Either retrive a pyccl.Pk2D from the table of power spectra, or fall back to what the pyccl.Cosmology object can provide.
- Parameters:
name (
str) –- Return type:
Pk2D
- get_pt_calculator()[source]#
Return the perturbation theory calculator object.
- Return type:
EulerianPTCalculator
- has_pk(name)[source]#
Check if a power spectrum with name name is available.
- Parameters:
name (
str) –- Return type:
bool
- prepare(ccl_cosmo)[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:
ccl_cosmo (
Cosmology) – the current CCL cosmology object- Return type:
None