crow.recipes.binned_exact module
Module for defining the classes used in the BinnedClusterRecipe cluster recipe.
- class crow.recipes.binned_exact.ExactBinnedClusterRecipe(cluster_theory, redshift_distribution, mass_distribution, completeness: Completeness = None, purity: Purity = None, mass_interval: tuple[float, float] = (11.0, 17.0), true_z_interval: tuple[float, float] = (0.0, 5.0))[source]
Bases:
BinnedClusterRecipeConcrete implementation of BinnedClusterRecipe using direct numerical integration.
This recipe evaluates cluster observables by explicitly integrating over mass, redshift, and mass proxy using a numerical integrator. It assumes:
Murata et al. (2019) mass–richness relation
Perfectly measured spectroscopic redshifts
No precomputed grids or interpolation (fully numerical evaluation)
The integration is performed using a configurable integrator (NumCosmoIntegrator), which maps the theoretical prediction into an integrable function over the relevant parameter space.
Compared to other implementations, this class: - Does not rely on interpolation tables - Computes predictions on-the-fly via numerical quadrature - Handles purity/completeness through explicit modification of the integrand
Notes
This implementation is computationally more expensive but provides a reference "exact" evaluation of the model under the stated assumptions.
- evaluate_theory_prediction_counts(z_edges, log_proxy_edges, sky_area: float, average_on: None | ClusterProperty = None) float[source]
Compute predicted cluster number counts within a bin.
This method performs a multidimensional numerical integral over:
halo mass
redshift
mass proxy
- Parameters:
z_edges (array-like of shape (2,)) -- Redshift bin limits.
log_proxy_edges (array-like of shape (2,)) -- Mass proxy bin limits in log10 space.
sky_area (float) -- Survey area in square degrees.
average_on (ClusterProperty, optional) -- Observable over which to average (e.g., mass, redshift).
- Returns:
Expected number of clusters in the bin.
- Return type:
float
Notes
Uses NumCosmoIntegrator for numerical quadrature.
Handles purity and completeness internally by modifying the integrand.
Assumes perfect redshift measurements.
- evaluate_theory_prediction_lensing_profile(z_edges, log_proxy_edges, radius_centers, sky_area: float, average_on: None | ClusterProperty = None) float[source]
Compute the predicted stacked lensing (shear) profile.
This method integrates the theoretical lensing signal over:
halo mass
redshift
mass proxy
and evaluates it at multiple radial bins.
- Parameters:
z_edges (array-like of shape (2,)) -- Redshift bin limits.
log_proxy_edges (array-like of shape (2,)) -- Mass proxy bin limits in log10 space.
radius_centers (array-like) -- Radii at which the shear profile is evaluated.
sky_area (float) -- Survey area in square degrees.
average_on (ClusterProperty, optional) -- Observable defining the weighting of the prediction. Must include shear-related properties.
- Returns:
Predicted shear profile evaluated at each radius.
- Return type:
ndarray
Notes
Each radius is integrated independently.
- The integrand includes the halo shear profile computed from the
underlying cluster theory model.
- Purity and completeness modify the integrand similarly to the
number counts case.
- setup()[source]
Perform any necessary pre-computation before evaluation.
This method is intended to be implemented by subclasses. It should initialize any internal quantities required for evaluating theoretical predictions (e.g., reseting/ precomputing grids, normalization factors, or integrators).
Notes
This method must be called before any evaluation method.