Skip to content

Comments

run_cosmo_val: save results, summarize_bmodes, snakemake rule#184

Merged
martinkilbinger merged 3 commits intodevelopfrom
feature/run-cosmo-val-improvements
Feb 23, 2026
Merged

run_cosmo_val: save results, summarize_bmodes, snakemake rule#184
martinkilbinger merged 3 commits intodevelopfrom
feature/run-cosmo-val-improvements

Conversation

@cailmdaley
Copy link
Collaborator

@cailmdaley cailmdaley commented Feb 21, 2026

Summary

  • summarize_bmodes() — new method on CosmologyValidation that prints a per-version PTE table across all five statistics (ξ+B, ξ−B, Combined, COSEBIs, C_ℓBB) at a configurable fiducial scale cut
  • save_pure_eb_results() / save_cosebis_results() — save B-mode results to .npz for downstream use
  • _pure_eb_results / _cosebis_results stored on the instance so summarize_bmodes() can aggregate across statistics without recomputation
  • Bug fixes: cc[ver]['mask'] top-level key (not shear.mask), cc[ver]['shear']['redshift_path'] (not redshift_distr), npatchnpatch1 for scalar patch count

Example output

From a UNIONS run over two catalog versions (SP_v1.4.6 and SP_v1.4.11.3):

COSEBIs results [1.0-250.0 arcmin]:  chi2(E) = 578.31, chi2(B) = 21.51, PTE(B) = 0.3679
COSEBIs results [2.0-250.0 arcmin]:  chi2(E) = 471.94, chi2(B) = 27.33, PTE(B) = 0.1262
COSEBIs results [5.0-250.0 arcmin]:  chi2(E) = 370.74, chi2(B) = 19.12, PTE(B) = 0.5140
COSEBIs results [10.0-250.0 arcmin]: chi2(E) = 227.64, chi2(B) = 11.04, PTE(B) = 0.9453
COSEBIs results [12.0-83.0 arcmin]:  chi2(E) =  64.79, chi2(B) = 13.04, PTE(B) = 0.8757
COSEBIs results [15.0-250.0 arcmin]: chi2(E) = 114.12, chi2(B) = 10.70, PTE(B) = 0.9536
COSEBIs results [20.0-250.0 arcmin]: chi2(E) = 101.77, chi2(B) = 14.68, PTE(B) = 0.7945

C_l^BB PTE summary:
  SP_v1.4.6_leak_corr:     C_l^BB PTE = 0.0979 (chi2/dof = 42.7/32)
  SP_v1.4.11.3_leak_corr:  C_l^BB PTE = 0.0000 (chi2/dof = 122.2/32)

B-mode summary [12-83 arcmin]
──────────────────────────────────────────────────────────────────────
Version                           xi+B      xi-B  Combined   COSEBIS    C_l^BB
──────────────────────────────────────────────────────────────────────
SP_v1.4.6_leak_corr             0.8391    0.3345    0.6807    0.8757    0.0979
SP_v1.4.11.3_leak_corr          0.8103    0.4556    0.6301        --    0.0000
──────────────────────────────────────────────────────────────────────
Covariance: Gaussian (NaMaster), jackknife (100 patches)

🤖 Generated with Claude Code

…g fixes

- Add save_pure_eb_results/save_cosebis_results to b_modes.py
- Add summarize_bmodes() summary table to CosmologyValidation
- Store _pure_eb_results/_cosebis_results on instance for summarize_bmodes
- Fix cc[ver]['shear']['mask'] → cc[ver]['mask'] (mask at top level in cat_config)
- Fix self.data_base_dir + redshift_distr → cc[ver]['shear']['redshift_path']
- Comment out plot_objectwise_leakage_aux() (method doesn't exist)
- Comment out calculate_pseudo_cl_g_ng_cov() (OneCovariance needs hmf, not in container)
- Add explicit scale_cuts param to calculate_cosebis/plot_cosebis
- claims.smk: filter _ecut from VERSIONS_LEAK_CORR, add explicit versions params

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cailmdaley cailmdaley force-pushed the feature/run-cosmo-val-improvements branch from 8562702 to be323a0 Compare February 21, 2026 20:06
@cailmdaley
Copy link
Collaborator Author

Note: these changes are already on develop (pushed directly). When merging, please use squash or rebase rather than a merge commit to avoid duplicating the changes.

"6.3" contains a dot — would produce invalid TeX macro names like
\configPte6.3Xip. Add "6.3" → "SixThree" to the version mapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

@martinkilbinger martinkilbinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, but there are conflicts, could you please fix them?

Take develop's refactored versions throughout:
- b_modes.py: use _EB_KEYS loop, _cosebis_result_to_dict helper, cleaner
  is_multi pattern in save_cosebis_results
- cosmo_val.py: loop over stats tuple, has_multi_scale_cuts variable,
  col_labels dict, compact row-printing in summarize_bmodes
- run_cosmo_val.py: use FIDUCIAL_SCALE_CUT constant, max_sep_int=300,
  %% section comments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cailmdaley
Copy link
Collaborator Author

oops missed that! should be good now @martinkilbinger

@martinkilbinger martinkilbinger merged commit 6175862 into develop Feb 23, 2026
1 check passed
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.

2 participants