firecrown.models.cluster ======================== .. py:module:: firecrown.models.cluster .. autoapi-nested-parse:: Module that contains the cluster model classes. Classes ------- .. autoapisummary:: firecrown.models.cluster.ClusterAbundance firecrown.models.cluster.AbundanceData firecrown.models.cluster.NDimensionalBin firecrown.models.cluster.SaccBin firecrown.models.cluster.TupleBin firecrown.models.cluster.ClusterData firecrown.models.cluster.ClusterDeltaSigma firecrown.models.cluster.DeltaSigmaData firecrown.models.cluster.Integrator firecrown.models.cluster.NumCosmoIntegrator firecrown.models.cluster.ScipyIntegrator firecrown.models.cluster.Completeness firecrown.models.cluster.KernelType firecrown.models.cluster.Purity firecrown.models.cluster.SpectroscopicRedshift firecrown.models.cluster.TrueMass firecrown.models.cluster.MassRichnessGaussian firecrown.models.cluster.MurataBinned firecrown.models.cluster.MurataUnbinned firecrown.models.cluster.ClusterProperty firecrown.models.cluster.ClusterRecipe firecrown.models.cluster.MurataBinnedSpecZDeltaSigmaRecipe firecrown.models.cluster.MurataBinnedSpecZRecipe Package Contents ---------------- .. py:class:: ClusterAbundance(mass_interval, z_interval, halo_mass_function) Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.models.cluster.ClusterAbundance :parts: 1 The class that calculates the predicted number counts of galaxy clusters. The abundance is a function of a specific cosmology, a mass and redshift range, an area on the sky, a halo mass function, as well as multiple kernels, where each kernel represents a different distribution involved in the final cluster abundance integrand. .. py:property:: cosmo :type: pyccl.cosmology.Cosmology | None The cosmology used to predict the cluster number count. .. py:attribute:: kernels :type: firecrown.updatable.UpdatableCollection .. py:attribute:: halo_mass_function .. py:attribute:: min_mass .. py:attribute:: max_mass .. py:attribute:: min_z .. py:attribute:: max_z .. py:method:: update_ingredients(cosmo) Update the cluster abundance calculation with a new cosmology. .. py:method:: comoving_volume(z, sky_area = 0) The differential comoving volume given area sky_area at redshift z. :param sky_area: The area of the survey on the sky in square degrees. .. py:method:: mass_function(mass, z) The mass function at z and mass. .. py:class:: AbundanceData(sacc_data) Bases: :py:obj:`firecrown.models.cluster._cluster_data.ClusterData` .. autoapi-inheritance-diagram:: firecrown.models.cluster.AbundanceData :parts: 1 The class used to wrap a sacc file and return the cluster abundance data. The sacc file is a complicated set of tracers (bins) and surveys. This class manipulates that data and returns only the data relevant for the cluster number count statistic. The data in this class is specific to a single survey name. .. py:method:: get_observed_data_and_indices_by_survey(survey_nm, properties) Returns the observed data for the specified survey and properties. For example if the caller has enabled COUNTS then the observed cluster counts within each N dimensional bin will be returned. .. py:method:: get_bin_edges(survey_nm, properties) Returns the limits for all z, mass bins for the requested data type. .. py:class:: NDimensionalBin Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: firecrown.models.cluster.NDimensionalBin :parts: 1 Class which defines the interface for an N dimensional bin. .. py:property:: z_edges :type: tuple[float, float] :abstractmethod: Redshift bin edges. .. py:property:: mass_proxy_edges :type: tuple[float, float] :abstractmethod: Mass proxy bin edges. .. py:property:: radius_edges :type: tuple[float, float] :abstractmethod: Radius bin edges. .. py:property:: radius_center :type: float :abstractmethod: Radius bin edges. .. py:method:: __str__() Returns a string representation of the bin edges. .. py:class:: SaccBin(coordinate_bins) Bases: :py:obj:`NDimensionalBin` .. autoapi-inheritance-diagram:: firecrown.models.cluster.SaccBin :parts: 1 An implementation of the N dimensional bin using sacc tracers. .. py:attribute:: coordinate_bins .. py:attribute:: dimension .. py:property:: z_edges :type: tuple[float, float] Redshift bin edges. .. py:property:: mass_proxy_edges :type: tuple[float, float] Mass proxy bin edges. .. py:property:: radius_edges :type: tuple[float, float] Radius bin edges. .. py:property:: radius_center :type: float Radius bin center. .. py:method:: __eq__(other) Two bins are equal if they have the same lower/upper bound. .. py:method:: __hash__() One bin's hash is determined by the dimension and lower/upper bound. .. py:class:: TupleBin(coordinate_bins) Bases: :py:obj:`NDimensionalBin` .. autoapi-inheritance-diagram:: firecrown.models.cluster.TupleBin :parts: 1 An implementation of the N dimensional bin using sacc tracers. .. py:attribute:: coordinate_bins .. py:property:: dimension :type: int Number of dimensions for this bin. .. py:property:: mass_proxy_edges :type: tuple[float, float] Mass proxy bin edges. .. py:property:: z_edges :type: tuple[float, float] Redshift bin edges. .. py:property:: radius_edges :type: tuple[float, float] Radius bin edges. .. py:property:: radius_center :type: float Radius bin center. .. py:method:: __eq__(other) Two bins are equal if they have the same lower/upper bound. .. py:method:: __hash__() One bin's hash is determined by the dimension and lower/upper bound. .. py:class:: ClusterData(sacc_data) The class used to wrap a sacc file and return the cluster abundance data. The sacc file is a complicated set of tracers (bins) and surveys. This class manipulates that data and returns only the data relevant for the cluster number count statistic. The data in this class is specific to a single survey name. .. py:attribute:: sacc_data .. py:method:: get_survey_tracer(survey_nm) Returns the SurveyTracer for the specified survey name. .. py:method:: get_observed_data_and_indices_by_survey(survey_nm, properties) :abstractmethod: Returns the observed data for the specified survey and properties. For example if the caller has enabled COUNTS then the observed cluster counts within each N dimensional bin will be returned. .. py:method:: get_bin_edges(survey_nm, properties) :abstractmethod: Returns the limits for all z, mass bins for the requested data type. .. py:class:: ClusterDeltaSigma(mass_interval, z_interval, halo_mass_function, conc_parameter = False) Bases: :py:obj:`firecrown.models.cluster._abundance.ClusterAbundance` .. autoapi-inheritance-diagram:: firecrown.models.cluster.ClusterDeltaSigma :parts: 1 The class that calculates the predicted delta sigma of galaxy clusters. The excess density surface mass density is a function of a specific cosmology, a mass and redshift range, an area on the sky, as well as multiple kernels, where each kernel represents a different distribution involved in the final cluster shear integrand. .. py:attribute:: conc_parameter :value: False .. py:method:: delta_sigma(log_mass, z, radius_center) Delta sigma for clusters. .. py:class:: DeltaSigmaData(sacc_data) Bases: :py:obj:`firecrown.models.cluster._cluster_data.ClusterData` .. autoapi-inheritance-diagram:: firecrown.models.cluster.DeltaSigmaData :parts: 1 The class used to wrap a sacc file and return the cluster deltasigma data. The sacc file is a complicated set of tracers (bins) and surveys. This class manipulates that data and returns only the data relevant for the cluster number count statistic. The data in this class is specific to a single survey name. .. py:method:: get_observed_data_and_indices_by_survey(survey_nm, properties) Returns the observed data for the specified survey and properties. For example if the caller has enabled DELTASIGMA then the observed cluster profile within each N dimensional bin will be returned. .. py:method:: get_bin_edges(survey_nm, properties) Returns the limits for all z, mass bins for the shear data type. .. py:class:: Integrator Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: firecrown.models.cluster.Integrator :parts: 1 The integrator base class. This class acts as an adapter around an integration library. .. py:attribute:: integral_bounds :type: list[tuple[float, float]] :value: [] .. py:attribute:: extra_args :type: numpy.typing.NDArray[numpy.float64] .. py:method:: integrate(func_to_integrate) :abstractmethod: Call this method to integrate the provided integrand argument. .. py:class:: NumCosmoIntegrator(method = None, relative_tolerance = 0.0001, absolute_tolerance = 1e-12) Bases: :py:obj:`Integrator` .. autoapi-inheritance-diagram:: firecrown.models.cluster.NumCosmoIntegrator :parts: 1 The NumCosmo implementation of the Integrator base class. .. py:attribute:: method .. py:method:: integrate(func_to_integrate) Integrate the provided integrand argument with NumCosmo. .. py:class:: ScipyIntegrator(relative_tolerance = 0.0001, absolute_tolerance = 1e-12) Bases: :py:obj:`Integrator` .. autoapi-inheritance-diagram:: firecrown.models.cluster.ScipyIntegrator :parts: 1 The scipy implementation of the Integrator base class using nquad. .. py:method:: integrate(func_to_integrate) Integrate the provided integrand argument with SciPy. .. py:class:: Completeness Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.models.cluster.Completeness :parts: 1 The completeness kernel for the numcosmo simulated survey. This kernel will affect the integrand by accounting for the incompleteness of a cluster selection. .. py:attribute:: ac_nc .. py:attribute:: bc_nc .. py:attribute:: ac_mc .. py:attribute:: bc_mc .. py:method:: distribution(log_mass, z) Evaluates and returns the completeness contribution to the integrand. .. py:class:: KernelType Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: firecrown.models.cluster.KernelType :parts: 1 The kernels that can be included in the cluster abundance integrand. .. py:attribute:: MASS :value: 1 .. py:attribute:: Z :value: 2 .. py:attribute:: MASS_PROXY :value: 3 .. py:attribute:: Z_PROXY :value: 4 .. py:attribute:: COMPLETENESS :value: 5 .. py:attribute:: PURITY :value: 6 .. py:class:: Purity Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.models.cluster.Purity :parts: 1 The purity kernel for the numcosmo simulated survey. This kernel will affect the integrand by accounting for the purity of a cluster selection. .. py:attribute:: ap_nc .. py:attribute:: bp_nc .. py:attribute:: ap_rc .. py:attribute:: bp_rc .. py:method:: distribution(z, mass_proxy, mass_proxy_limits = None) Evaluates and returns the purity contribution to the integrand. .. py:class:: SpectroscopicRedshift The spec-z kernel. Assuming the spectroscopic redshift has no uncertainties, this is akin to multiplying by 1. .. py:method:: distribution() Evaluates and returns the z distribution contribution to the integrand. We have set this to 1.0 (i.e. it does not affect the redshift distribution) .. py:class:: TrueMass The true mass kernel. Assuming we measure the true mass, this will always be 1. .. py:method:: distribution() Evaluates and returns the mass distribution contribution to the integrand. We have set this to 1.0 (i.e. it does not affect the mass distribution) .. py:class:: MassRichnessGaussian(parameter_prefix = None) Bases: :py:obj:`firecrown.updatable.Updatable` .. autoapi-inheritance-diagram:: firecrown.models.cluster.MassRichnessGaussian :parts: 1 The representation of mass richness relations that are of a gaussian form. .. py:method:: observed_value(p, mass, z, pivot_mass, log1p_pivot_redshift) :staticmethod: Return observed quantity corrected by redshift and mass. .. py:method:: get_proxy_mean(mass, z) :abstractmethod: Return observed quantity corrected by redshift and mass. .. py:method:: get_proxy_sigma(mass, z) :abstractmethod: Return observed scatter corrected by redshift and mass. .. py:class:: MurataBinned(pivot_mass, pivot_redshift) Bases: :py:obj:`MassRichnessGaussian` .. autoapi-inheritance-diagram:: firecrown.models.cluster.MurataBinned :parts: 1 The mass richness relation defined in Murata 19 for a binned data vector. .. py:attribute:: pivot_redshift .. py:attribute:: pivot_mass .. py:attribute:: log1p_pivot_redshift .. py:attribute:: mu_p0 .. py:attribute:: mu_p1 .. py:attribute:: mu_p2 .. py:attribute:: sigma_p0 .. py:attribute:: sigma_p1 .. py:attribute:: sigma_p2 .. py:method:: get_proxy_mean(mass, z) Return observed quantity corrected by redshift and mass. .. py:method:: get_proxy_sigma(mass, z) Return observed scatter corrected by redshift and mass. .. py:method:: distribution(mass, z, mass_proxy_limits) Evaluates and returns the mass-richness contribution to the integrand. .. py:class:: MurataUnbinned(pivot_mass, pivot_redshift) Bases: :py:obj:`MassRichnessGaussian` .. autoapi-inheritance-diagram:: firecrown.models.cluster.MurataUnbinned :parts: 1 The mass richness relation defined in Murata 19 for a unbinned data vector. .. py:attribute:: pivot_redshift .. py:attribute:: pivot_mass .. py:attribute:: log1p_pivot_redshift .. py:attribute:: mu_p0 .. py:attribute:: mu_p1 .. py:attribute:: mu_p2 .. py:attribute:: sigma_p0 .. py:attribute:: sigma_p1 .. py:attribute:: sigma_p2 .. py:method:: get_proxy_mean(mass, z) Return observed quantity corrected by redshift and mass. .. py:method:: get_proxy_sigma(mass, z) Return observed scatter corrected by redshift and mass. .. py:method:: distribution(mass, z, mass_proxy) Evaluates and returns the mass-richness contribution to the integrand. .. py:class:: ClusterProperty Bases: :py:obj:`enum.Flag` .. autoapi-inheritance-diagram:: firecrown.models.cluster.ClusterProperty :parts: 1 Flag representing cluster observables. This flag containing the possible cluster properties we can make a theoretical prediction for. .. py:attribute:: NONE :value: 0 .. py:attribute:: COUNTS .. py:attribute:: MASS .. py:attribute:: REDSHIFT .. py:attribute:: SHEAR .. py:attribute:: DELTASIGMA .. py:class:: ClusterRecipe(parameter_prefix = None) Bases: :py:obj:`firecrown.updatable.Updatable`, :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: firecrown.models.cluster.ClusterRecipe :parts: 1 Abstract class defining a cluster recipe. A cluster recipe is a combination of different cluster theoretical predictions and models that produces a single prediction for an observable. .. py:attribute:: my_updatables :type: firecrown.updatable.UpdatableCollection .. py:method:: evaluate_theory_prediction(cluster_theory, this_bin, sky_area, average_on = None) :abstractmethod: Evaluate the theory prediction for this cluster recipe. .. py:class:: MurataBinnedSpecZDeltaSigmaRecipe Bases: :py:obj:`ClusterRecipe` .. autoapi-inheritance-diagram:: firecrown.models.cluster.MurataBinnedSpecZDeltaSigmaRecipe :parts: 1 Cluster recipe with Murata19 mass-richness and spec-zs. This recipe uses the Murata 2019 binned mass-richness relation and assumes perfectly measured spec-zs. .. py:attribute:: integrator .. py:attribute:: redshift_distribution .. py:attribute:: mass_distribution .. py:method:: get_theory_prediction(cluster_theory, average_on = None) Get a callable that evaluates a cluster theory prediction. Returns a callable function that accepts mass, redshift, mass proxy limits, and the sky area of your survey and returns the theoretical prediction for the expected number of clusters. .. py:method:: get_function_to_integrate(prediction) Returns a callable function that can be evaluated by an integrator. This function is responsible for mapping arguments from the numerical integrator to the arguments of the theoretical prediction function. .. py:method:: evaluate_theory_prediction(cluster_theory, this_bin, sky_area, average_on = None) Evaluate the theory prediction for this cluster recipe. Evaluate the theoretical prediction for the observable in the provided bin using the Murata 2019 binned mass-richness relation and assuming perfectly measured redshifts. .. py:method:: get_theory_prediction_counts(cluster_theory) Get a callable that evaluates a cluster theory prediction. Returns a callable function that accepts mass, redshift, mass proxy limits, and the sky area of your survey and returns the theoretical prediction for the expected number of clusters. .. py:method:: get_function_to_integrate_counts(prediction) Returns a callable function that can be evaluated by an integrator. This function is responsible for mapping arguments from the numerical integrator to the arguments of the theoretical prediction function. .. py:method:: evaluate_theory_prediction_counts(cluster_theory, this_bin, sky_area) Evaluate the theory prediction for this cluster recipe. Evaluate the theoretical prediction for the observable in the provided bin using the Murata 2019 binned mass-richness relation and assuming perfectly measured redshifts. .. py:class:: MurataBinnedSpecZRecipe Bases: :py:obj:`ClusterRecipe` .. autoapi-inheritance-diagram:: firecrown.models.cluster.MurataBinnedSpecZRecipe :parts: 1 Cluster recipe with Murata19 mass-richness and spec-zs. This recipe uses the Murata 2019 binned mass-richness relation and assumes perfectly measured spec-zs. .. py:attribute:: integrator .. py:attribute:: redshift_distribution .. py:attribute:: mass_distribution .. py:method:: get_theory_prediction(cluster_theory, average_on = None) Get a callable that evaluates a cluster theory prediction. Returns a callable function that accepts mass, redshift, mass proxy limits, and the sky area of your survey and returns the theoretical prediction for the expected number of clusters. .. py:method:: get_function_to_integrate(prediction) Returns a callable function that can be evaluated by an integrator. This function is responsible for mapping arguments from the numerical integrator to the arguments of the theoretical prediction function. .. py:method:: evaluate_theory_prediction(cluster_theory, this_bin, sky_area, average_on = None) Evaluate the theory prediction for this cluster recipe. Evaluate the theoretical prediction for the observable in the provided bin using the Murata 2019 binned mass-richness relation and assuming perfectly measured redshifts.