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

ModelingTools

Modeling tools for likelihoods.

PowerspectrumModifier

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

Inheritance diagram of firecrown.modeling_tools.ModelingTools

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:
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.Pk2D to 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_ccl_cosmology()[source]

Return the CCL cosmology object.

Return type:

pyccl.Cosmology

get_pt_calculator()[source]

Return the perturbation theory calculator object.

Return type:

pyccl.nl_pt.EulerianPTCalculator

get_hm_calculator()[source]

Return the halo model calculator object.

Return type:

pyccl.halos.HMCalculator

get_cM_relation()[source]

Return the concentration-mass relation.

Return type:

str

class firecrown.modeling_tools.PowerspectrumModifier(parameter_prefix=None)[source]

Bases: firecrown.updatable.Updatable, abc.ABC

Inheritance diagram of firecrown.modeling_tools.PowerspectrumModifier

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