Skip to content

Update cluster_theory_pred to match CLPFirecrown and add a tutorial - #40

Open
eduardojsbarroso wants to merge 2 commits into
mainfrom
fix_cluster_theory_pred
Open

eduardojsbarroso wants to merge 2 commits into
mainfrom
fix_cluster_theory_pred

Conversation

@eduardojsbarroso

Copy link
Copy Markdown
Collaborator

clpipe/cluster_theory_pred.py was out of date with clp_firecrown.py and the redmapper example. It used a hard-coded cosmology (sampled omega_c and sigma_8 were silently dropped), different defaults and purity model, and never called the recipe setup. On the redmapper data the counts came out 5 to 10% low.

The module now builds the same likelihood as the likelihood_file.py written by CLPFirecrown and evaluates it with Firecrown at one point. The defaults come from CLPFirecrown.config_options and the cosmology from the fiducial cosmology file plus the cosmological_parameters overrides. Parameters take the values written in priors_file.ini (starting value when sampled), or the ones passed in params, for example a chain best fit. Chain column names like cosmological_parameters--omega_c also work.

from clpipe.cluster_theory_pred import compute_cluster_predictions

pred = compute_cluster_predictions(config_file, sacc_file, fiducial_cosmology, params=None)
pred.counts.theory, pred.counts.data, pred.counts.errors, pred.shear.theory, pred.chi2

build_cluster_recipes_from_config is kept but now needs fiducial_cosmology=.

The new tests compare the predictions with the likelihood and values files generated by CLPFirecrown on the mock SACC. I also checked on CC with firecrown_developer_clp against the likelihood_file.py of the redmapper baseline run, and got the same theory vector and chi2 (246.2).

The tutorial is in tutorials/theory_prediction_tutorial. It compares the redmapper baseline data with the predictions at the starting point and at the chain best fit, and shows a quick hmf comparison. It needs the example data from the portal (see README).

Two things to keep in mind. There will be a small conflict with #39 in the docstring of cluster_theory_pred.py, keep this version. Also use_grid: false is not covered by the comparison test yet, because clp_firecrown.py on main does not import ExactBinnedClusterRecipe (fixed in #39).

…ample

- Build the same Firecrown likelihood as the likelihood_file.py written by
  CLPFirecrown, with the stage defaults taken from CLPFirecrown.config_options
- Cosmology from the fiducial cosmology file plus the cosmological_parameters
  overrides (CosmoSIS names), instead of a hard-coded cosmology
- Parameters take the values written in priors_file.ini (starting value when
  sampled), and can be replaced with params, e.g. a chain best fit
- New compute_cluster_predictions returning theory, data, covariance, bins and chi2
- Tests comparing against the likelihood and values files generated by CLPFirecrown
Compares the cosmoDC2 redMaPPer baseline data with the predictions at the
starting point and at the best fit of the chain.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant