firecrown.models.cluster
Module that contains the cluster model classes.
Classes
The class that calculates the predicted number counts of galaxy clusters. |
|
The class used to wrap a sacc file and return the cluster abundance data. |
|
Class which defines the interface for an N dimensional bin. |
|
An implementation of the N dimensional bin using sacc tracers. |
|
An implementation of the N dimensional bin using sacc tracers. |
|
The class used to wrap a sacc file and return the cluster abundance data. |
|
The class that calculates the predicted delta sigma of galaxy clusters. |
|
The class used to wrap a sacc file and return the cluster deltasigma data. |
|
The integrator base class. |
|
The NumCosmo implementation of the Integrator base class. |
|
The scipy implementation of the Integrator base class using nquad. |
|
The completeness kernel for the numcosmo simulated survey. |
|
The kernels that can be included in the cluster abundance integrand. |
|
The purity kernel for the numcosmo simulated survey. |
|
The spec-z kernel. |
|
The true mass kernel. |
|
The representation of mass richness relations that are of a gaussian form. |
|
The mass richness relation defined in Murata 19 for a binned data vector. |
|
The mass richness relation defined in Murata 19 for a unbinned data vector. |
|
Flag representing cluster observables. |
|
Abstract class defining a cluster recipe. |
|
Cluster recipe with Murata19 mass-richness and spec-zs. |
|
Cluster recipe with Murata19 mass-richness and spec-zs. |
Package Contents
- class firecrown.models.cluster.ClusterAbundance(mass_interval, z_interval, halo_mass_function)
Bases:
firecrown.updatable.Updatable
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.
- Parameters:
mass_interval (tuple[float, float])
z_interval (tuple[float, float])
halo_mass_function (pyccl.halos.MassFunc)
- property cosmo: pyccl.cosmology.Cosmology | None
The cosmology used to predict the cluster number count.
- Return type:
pyccl.cosmology.Cosmology | None
- halo_mass_function
- min_mass
- max_mass
- min_z
- max_z
- update_ingredients(cosmo)
Update the cluster abundance calculation with a new cosmology.
- Parameters:
cosmo (pyccl.cosmology.Cosmology)
- Return type:
None
- comoving_volume(z, sky_area=0)
The differential comoving volume given area sky_area at redshift z.
- Parameters:
sky_area (float) – The area of the survey on the sky in square degrees.
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- mass_function(mass, z)
The mass function at z and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.AbundanceData(sacc_data)
Bases:
firecrown.models.cluster._cluster_data.ClusterData
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.
- Parameters:
sacc_data (sacc.Sacc)
- 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.
- Parameters:
survey_nm (str)
properties (firecrown.models.cluster._properties.ClusterProperty)
- Return type:
tuple[list[float], list[int]]
- get_bin_edges(survey_nm, properties)
Returns the limits for all z, mass bins for the requested data type.
- Parameters:
survey_nm (str)
properties (firecrown.models.cluster._properties.ClusterProperty)
- Return type:
list[firecrown.models.cluster._binning.SaccBin]
- class firecrown.models.cluster.NDimensionalBin
Bases:
abc.ABC
Class which defines the interface for an N dimensional bin.
- property z_edges: tuple[float, float]
- Abstractmethod:
- Return type:
tuple[float, float]
Redshift bin edges.
- property mass_proxy_edges: tuple[float, float]
- Abstractmethod:
- Return type:
tuple[float, float]
Mass proxy bin edges.
- property radius_edges: tuple[float, float]
- Abstractmethod:
- Return type:
tuple[float, float]
Radius bin edges.
- property radius_center: float
- Abstractmethod:
- Return type:
float
Radius bin edges.
- __str__()
Returns a string representation of the bin edges.
- Return type:
str
- class firecrown.models.cluster.SaccBin(coordinate_bins)
Bases:
NDimensionalBin
An implementation of the N dimensional bin using sacc tracers.
- Parameters:
coordinate_bins (list[sacc.BaseTracer])
- coordinate_bins
- dimension
- property z_edges: tuple[float, float]
Redshift bin edges.
- Return type:
tuple[float, float]
- property mass_proxy_edges: tuple[float, float]
Mass proxy bin edges.
- Return type:
tuple[float, float]
- property radius_edges: tuple[float, float]
Radius bin edges.
- Return type:
tuple[float, float]
- property radius_center: float
Radius bin center.
- Return type:
float
- __eq__(other)
Two bins are equal if they have the same lower/upper bound.
- Parameters:
other (object)
- Return type:
bool
- __hash__()
One bin’s hash is determined by the dimension and lower/upper bound.
- Return type:
int
- class firecrown.models.cluster.TupleBin(coordinate_bins)
Bases:
NDimensionalBin
An implementation of the N dimensional bin using sacc tracers.
- Parameters:
coordinate_bins (list[tuple])
- coordinate_bins
- property dimension: int
Number of dimensions for this bin.
- Return type:
int
- property mass_proxy_edges: tuple[float, float]
Mass proxy bin edges.
- Return type:
tuple[float, float]
- property z_edges: tuple[float, float]
Redshift bin edges.
- Return type:
tuple[float, float]
- property radius_edges: tuple[float, float]
Radius bin edges.
- Return type:
tuple[float, float]
- property radius_center: float
Radius bin center.
- Return type:
float
- __eq__(other)
Two bins are equal if they have the same lower/upper bound.
- Parameters:
other (object)
- Return type:
bool
- __hash__()
One bin’s hash is determined by the dimension and lower/upper bound.
- Return type:
int
- class firecrown.models.cluster.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.
- Parameters:
sacc_data (sacc.Sacc)
- sacc_data
- get_survey_tracer(survey_nm)
Returns the SurveyTracer for the specified survey name.
- Parameters:
survey_nm (str)
- Return type:
sacc.tracers.SurveyTracer
- abstractmethod 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.
- Parameters:
survey_nm (str)
properties (firecrown.models.cluster._properties.ClusterProperty)
- Return type:
tuple[list[float], list[int]]
- abstractmethod get_bin_edges(survey_nm, properties)
Returns the limits for all z, mass bins for the requested data type.
- Parameters:
survey_nm (str)
properties (firecrown.models.cluster._properties.ClusterProperty)
- Return type:
list[firecrown.models.cluster._binning.SaccBin]
- class firecrown.models.cluster.ClusterDeltaSigma(mass_interval, z_interval, halo_mass_function, conc_parameter=False)
Bases:
firecrown.models.cluster._abundance.ClusterAbundance
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.
- Parameters:
mass_interval (tuple[float, float])
z_interval (tuple[float, float])
halo_mass_function (pyccl.halos.MassFunc)
conc_parameter (bool)
- conc_parameter = False
- delta_sigma(log_mass, z, radius_center)
Delta sigma for clusters.
- Parameters:
log_mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
radius_center (float)
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.DeltaSigmaData(sacc_data)
Bases:
firecrown.models.cluster._cluster_data.ClusterData
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.
- Parameters:
sacc_data (sacc.Sacc)
- 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.
- Parameters:
survey_nm (str)
properties (firecrown.models.cluster._properties.ClusterProperty)
- Return type:
tuple[list[float], list[int]]
- get_bin_edges(survey_nm, properties)
Returns the limits for all z, mass bins for the shear data type.
- Parameters:
survey_nm (str)
properties (firecrown.models.cluster._properties.ClusterProperty)
- Return type:
list[firecrown.models.cluster._binning.SaccBin]
- class firecrown.models.cluster.Integrator
Bases:
abc.ABC
The integrator base class.
This class acts as an adapter around an integration library.
- integral_bounds: list[tuple[float, float]] = []
- extra_args: numpy.typing.NDArray[numpy.float64]
- abstractmethod integrate(func_to_integrate)
Call this method to integrate the provided integrand argument.
- Parameters:
func_to_integrate (collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]], numpy.typing.NDArray[numpy.float64]])
- Return type:
float
- class firecrown.models.cluster.NumCosmoIntegrator(method=None, relative_tolerance=0.0001, absolute_tolerance=1e-12)
Bases:
Integrator
The NumCosmo implementation of the Integrator base class.
- Parameters:
method (None | NumCosmoIntegralMethod)
relative_tolerance (float)
absolute_tolerance (float)
- method
- integrate(func_to_integrate)
Integrate the provided integrand argument with NumCosmo.
- Parameters:
func_to_integrate (collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]], numpy.typing.NDArray[numpy.float64]])
- Return type:
float
- class firecrown.models.cluster.ScipyIntegrator(relative_tolerance=0.0001, absolute_tolerance=1e-12)
Bases:
Integrator
The scipy implementation of the Integrator base class using nquad.
- Parameters:
relative_tolerance (float)
absolute_tolerance (float)
- integrate(func_to_integrate)
Integrate the provided integrand argument with SciPy.
- Parameters:
func_to_integrate (collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]], numpy.typing.NDArray[numpy.float64]])
- Return type:
float
- class firecrown.models.cluster.Completeness
Bases:
firecrown.updatable.Updatable
The completeness kernel for the numcosmo simulated survey.
This kernel will affect the integrand by accounting for the incompleteness of a cluster selection.
- ac_nc
- bc_nc
- ac_mc
- bc_mc
- distribution(log_mass, z)
Evaluates and returns the completeness contribution to the integrand.
- Parameters:
log_mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.KernelType
Bases:
enum.Enum
The kernels that can be included in the cluster abundance integrand.
- MASS = 1
- Z = 2
- MASS_PROXY = 3
- Z_PROXY = 4
- COMPLETENESS = 5
- PURITY = 6
- class firecrown.models.cluster.Purity
Bases:
firecrown.updatable.Updatable
The purity kernel for the numcosmo simulated survey.
This kernel will affect the integrand by accounting for the purity of a cluster selection.
- ap_nc
- bp_nc
- ap_rc
- bp_rc
- distribution(z, mass_proxy, mass_proxy_limits=None)
Evaluates and returns the purity contribution to the integrand.
- Parameters:
z (numpy.typing.NDArray[numpy.float64])
mass_proxy (numpy.typing.NDArray[numpy.float64])
mass_proxy_limits (tuple[float, float] | None)
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.SpectroscopicRedshift
The spec-z kernel.
Assuming the spectroscopic redshift has no uncertainties, this is akin to multiplying by 1.
- 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)
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.TrueMass
The true mass kernel.
Assuming we measure the true mass, this will always be 1.
- 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)
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.MassRichnessGaussian(parameter_prefix=None)
Bases:
firecrown.updatable.Updatable
The representation of mass richness relations that are of a gaussian form.
- Parameters:
parameter_prefix (None | str)
- static observed_value(p, mass, z, pivot_mass, log1p_pivot_redshift)
Return observed quantity corrected by redshift and mass.
- Parameters:
p (tuple[float, float, float])
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
pivot_mass (float)
log1p_pivot_redshift (float)
- Return type:
numpy.typing.NDArray[numpy.float64]
- abstractmethod get_proxy_mean(mass, z)
Return observed quantity corrected by redshift and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- abstractmethod get_proxy_sigma(mass, z)
Return observed scatter corrected by redshift and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.MurataBinned(pivot_mass, pivot_redshift)
Bases:
MassRichnessGaussian
The mass richness relation defined in Murata 19 for a binned data vector.
- Parameters:
pivot_mass (float)
pivot_redshift (float)
- pivot_redshift
- pivot_mass
- log1p_pivot_redshift
- mu_p0
- mu_p1
- mu_p2
- sigma_p0
- sigma_p1
- sigma_p2
- get_proxy_mean(mass, z)
Return observed quantity corrected by redshift and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- get_proxy_sigma(mass, z)
Return observed scatter corrected by redshift and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- distribution(mass, z, mass_proxy_limits)
Evaluates and returns the mass-richness contribution to the integrand.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
mass_proxy_limits (tuple[float, float])
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.MurataUnbinned(pivot_mass, pivot_redshift)
Bases:
MassRichnessGaussian
The mass richness relation defined in Murata 19 for a unbinned data vector.
- Parameters:
pivot_mass (float)
pivot_redshift (float)
- pivot_redshift
- pivot_mass
- log1p_pivot_redshift
- mu_p0
- mu_p1
- mu_p2
- sigma_p0
- sigma_p1
- sigma_p2
- get_proxy_mean(mass, z)
Return observed quantity corrected by redshift and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- get_proxy_sigma(mass, z)
Return observed scatter corrected by redshift and mass.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- distribution(mass, z, mass_proxy)
Evaluates and returns the mass-richness contribution to the integrand.
- Parameters:
mass (numpy.typing.NDArray[numpy.float64])
z (numpy.typing.NDArray[numpy.float64])
mass_proxy (numpy.typing.NDArray[numpy.float64])
- Return type:
numpy.typing.NDArray[numpy.float64]
- class firecrown.models.cluster.ClusterProperty
Bases:
enum.Flag
Flag representing cluster observables.
This flag containing the possible cluster properties we can make a theoretical prediction for.
- NONE = 0
- COUNTS
- MASS
- REDSHIFT
- SHEAR
- DELTASIGMA
- class firecrown.models.cluster.ClusterRecipe(parameter_prefix=None)
Bases:
firecrown.updatable.Updatable,abc.ABC
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.
- Parameters:
parameter_prefix (None | str)
- my_updatables: firecrown.updatable.UpdatableCollection
- abstractmethod evaluate_theory_prediction(cluster_theory, this_bin, sky_area, average_on=None)
Evaluate the theory prediction for this cluster recipe.
- Parameters:
this_bin (firecrown.models.cluster._binning.SaccBin)
sky_area (float)
average_on (None | firecrown.models.cluster._properties.ClusterProperty)
- Return type:
float
- class firecrown.models.cluster.MurataBinnedSpecZDeltaSigmaRecipe
Bases:
ClusterRecipe
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.
- integrator
- redshift_distribution
- mass_distribution
- 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.
- Parameters:
cluster_theory (firecrown.models.cluster._deltasigma.ClusterDeltaSigma)
average_on (None | firecrown.models.cluster._properties.ClusterProperty)
- Return type:
collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], tuple[float, float], float, float], numpy.typing.NDArray[numpy.float64]]
- 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.
- Parameters:
prediction (collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], tuple[float, float], float, float], numpy.typing.NDArray[numpy.float64]])
- Return type:
collections.abc.Callable[[numpy.typing.NDArray, numpy.typing.NDArray], numpy.typing.NDArray]
- 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.
- Parameters:
cluster_theory (firecrown.models.cluster._deltasigma.ClusterDeltaSigma)
this_bin (firecrown.models.cluster._binning.NDimensionalBin)
sky_area (float)
average_on (None | firecrown.models.cluster._properties.ClusterProperty)
- Return type:
float
- 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.
- Parameters:
cluster_theory (firecrown.models.cluster._deltasigma.ClusterDeltaSigma)
- Return type:
collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], tuple[float, float], float], numpy.typing.NDArray[numpy.float64]]
- 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.
- Parameters:
prediction (collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], tuple[float, float], float], numpy.typing.NDArray[numpy.float64]])
- Return type:
collections.abc.Callable[[numpy.typing.NDArray, numpy.typing.NDArray], numpy.typing.NDArray]
- 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.
- Parameters:
cluster_theory (firecrown.models.cluster._deltasigma.ClusterDeltaSigma)
this_bin (firecrown.models.cluster._binning.NDimensionalBin)
sky_area (float)
- Return type:
float
- class firecrown.models.cluster.MurataBinnedSpecZRecipe
Bases:
ClusterRecipe
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.
- integrator
- redshift_distribution
- mass_distribution
- 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.
- Parameters:
cluster_theory (firecrown.models.cluster._abundance.ClusterAbundance)
average_on (None | firecrown.models.cluster._properties.ClusterProperty)
- Return type:
collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], tuple[float, float], float], numpy.typing.NDArray[numpy.float64]]
- 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.
- Parameters:
prediction (collections.abc.Callable[[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], tuple[float, float], float], numpy.typing.NDArray[numpy.float64]])
- Return type:
collections.abc.Callable[[numpy.typing.NDArray, numpy.typing.NDArray], numpy.typing.NDArray]
- 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.
- Parameters:
cluster_theory (firecrown.models.cluster._abundance.ClusterAbundance)
this_bin (firecrown.models.cluster._binning.NDimensionalBin)
sky_area (float)
average_on (None | firecrown.models.cluster._properties.ClusterProperty)
- Return type:
float