firecrown.modeling_tools.ModelingTools#

class firecrown.modeling_tools.ModelingTools(*, pt_calculator=None, pk_modifiers=None, cluster_abundance=None)[source]#

Bases: Updatable

Modeling tools for likelihoods.

A class that bundles together a pyccl.Cosmology object and associated objects, such as perturbation theory or halo model calculator workspaces.

Parameters:
  • pt_calculator (None | pyccl.nl_pt.EulerianPTCalculator) –

  • pk_modifiers (None | Collection[PowerspectrumModifier]) –

  • cluster_abundance (None | ClusterAbundance) –

Public Methods:

__init__(*[, pt_calculator, pk_modifiers, ...])

Updatable initialization.

add_pk(name, powerspectrum)

Add a pyccl.Pk2D to 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.

get_ccl_cosmology()

Return the CCL cosmology object.

get_pt_calculator()

Return the perturbation theory calculator object.

Inherited from Updatable

__init__([parameter_prefix])

Updatable initialization.

__setattr__(key, value)

Set the attribute named key to 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.

is_updated()

Determine if the object has been updated.

reset()

Reset the updatable.

required_parameters()

Returns a RequiredParameters object.

get_derived_parameters()

Returns a collection of derived parameters.

Private Methods:

_reset()

Resets all CCL objects in ModelingTools.

Inherited from Updatable

_update(params)

Method for auxiliary updates to be made to an updatable.

_reset()

Abstract method implemented by all concrete classes to update self.

_required_parameters()

Return a RequiredParameters object containing the information for this class.

_get_derived_parameters()

Returns the derived parameters of an implementation.


_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.Pk2D to the table of power spectra.

Parameters:
  • name (str) –

  • powerspectrum (Pk2D) –

Return type:

None

get_ccl_cosmology()[source]#

Return the CCL cosmology object.

Return type:

Cosmology

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