firecrown.modeling_tools ======================== .. py:module:: firecrown.modeling_tools .. autoapi-nested-parse:: Basic Cosmology and cosmological tools definitions. :mod:`modeling_tools` contains the :class:`ModelingTools` class, which is built around the :class:`pyccl.Cosmology` class. This is used by likelihoods that need to access reusable objects, such as perturbation theory or halo model calculators. Classes ------- .. autoapisummary:: firecrown.modeling_tools.ModelingTools firecrown.modeling_tools.PowerspectrumModifier Module Contents --------------- .. py:class:: ModelingTools(*, pt_calculator = None, hm_calculator = None, cM_relation = None, pk_modifiers = None, cluster_abundance = None, cluster_deltasigma = None, ccl_factory = None) Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.modeling_tools.ModelingTools :parts: 1 Modeling tools for likelihoods. A class that bundles together a :class:`pyccl.Cosmology` object and associated objects, such as perturbation theory or halo model calculator workspaces. .. py:attribute:: ccl_cosmo :type: None | pyccl.Cosmology :value: None .. py:attribute:: pt_calculator :type: None | pyccl.nl_pt.EulerianPTCalculator :value: None .. py:attribute:: hm_calculator :type: None | pyccl.halos.HMCalculator :value: None .. py:attribute:: cM_relation :type: None | str :value: None .. py:attribute:: pk_modifiers :type: firecrown.updatable.UpdatableCollection .. py:attribute:: powerspectra :type: dict[str, pyccl.Pk2D] .. py:attribute:: cluster_abundance :value: None .. py:attribute:: cluster_deltasigma :value: None .. py:attribute:: ccl_factory .. py:method:: add_pk(name, powerspectrum) Add a :class:`pyccl.Pk2D` to the table of power spectra. :param name: the name of the power spectrum :param powerspectrum: the power spectrum .. py:method:: get_pk(name) 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 .. py:method:: has_pk(name) Check if a power spectrum with name `name` is available. .. py:method:: prepare(*, calculator_args = None) 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. :param calculator_args: the CCL calculator arguments .. py:method:: get_ccl_cosmology() Return the CCL cosmology object. .. py:method:: get_pt_calculator() Return the perturbation theory calculator object. .. py:method:: get_hm_calculator() Return the halo model calculator object. .. py:method:: get_cM_relation() Return the concentration-mass relation. .. py:class:: PowerspectrumModifier(parameter_prefix = None) Bases: :py:obj:`firecrown.updatable.Updatable`, :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: firecrown.modeling_tools.PowerspectrumModifier :parts: 1 Abstract base class for power spectrum modifiers. .. py:attribute:: name :type: str :value: 'base:base' .. py:method:: compute_p_of_k_z(tools) :abstractmethod: Compute the 3D power spectrum P(k, z).