Skip to content

cosmo_val: render diagnostics from cached computation products - #430

Open
cailmdaley wants to merge 18 commits into
developfrom
feat/cosmo-val-plot-split
Open

cailmdaley wants to merge 18 commits into
developfrom
feat/cosmo-val-plot-split

Conversation

@cailmdaley

Copy link
Copy Markdown
Collaborator

Every cosmo_val figure can now be redrawn from cached products without rerunning a transform, PSF fit or catalogue measurement.
cosmo_val_all still requests the complete analysis; the new cosmo_val_plots aggregate requests all figures and their required caches.
Plotting modules are explicit inputs, so editing their style invalidates figures rather than computations.

Closes #429.

Cached products and plot rules

Computation / existing product Plot-only consumer
Pure E/B → sealed SACC + NPZ with comparison vectors cv_plot_pure_eb: four figures
COSEBIs → sealed SACC + NPZ with every cut, integration edges and exact selected indices cv_plot_cosebis: three figures
ρ/τ fits → posterior and propagated PSF-error NPZ cv_plot_rho_tau_fits; cv_ratio_xi_sys_xi also reads sealed reporting ξ
Footprints → sparse pixel/count NPZ; weights → histogram NPZ; objectwise regression → coefficient JSON cv_plot_footprints (NGC, SGC, fullsky), cv_plot_weights, cv_plot_objectwise_leakage
Existing ρ/τ FITS + explicit τ covariance; reporting ξ SACC; pseudo-Cℓ SACC/covariance cv_plot_rho_stats, cv_plot_tau_stats, cv_plot_2pcf, cv_plot_pseudo_cl
OneCovariance .dat, with its own plotting disabled covariance_plot: correlation PDF

Figures are declared outputs, replacing plot sentinels, and renderers overwrite existing figures.
The objectwise computation now calls the spin-2 regression directly instead of the exploratory driver that also emitted undeclared plots.
Presentation fixes retain signed PSF/pseudo-Cℓ signals, include uncertainties in pure-E/B limits, align COSEBIs heatmaps with the actual integration bins, and improve labels/layout.

Blinding contract

Pure-E/B and COSEBIs caches derive only from the already-sealed integration SACC; no unsealed ξ vector is added for plotting.
Their NPZs carry the inherited blind stamp, including none for public products, using the same sacc_io.derived_stamp check as derived SACC writers.
NPZ loaders fail closed on missing stamps and use sacc_io.expect to reject mismatches before reading signal arrays.
Plot rules and the B-mode summary pass the expected catalogue blind.
Old unstamped caches require a compute pass from the sealed products; manually stamping them is not a supported migration.

Plot-only command

Use the full run's config and output roots, on an allocation with the host's container/bind settings:

plot_rules=(cosmo_val_plots cv_plot_rho_stats cv_plot_tau_stats \
    cv_plot_rho_tau_fits cv_plot_footprints cv_plot_objectwise_leakage \
    cv_plot_weights cv_plot_2pcf cv_ratio_xi_sys_xi cv_plot_pure_eb \
    cv_plot_cosebis cv_plot_pseudo_cl covariance_plot)
snakemake --profile workflow/profiles/default -s workflow/Snakefile \
    --configfile /path/to/run.yaml --cores 4 --forceall \
    --allowed-rules "${plot_rules[@]}" -- cosmo_val_plots

The restricted rule list prevents computations, and the aggregate requires every cache even when all figures already exist.
A missing cache therefore stops the command.
Ordinary incremental restyling can use cosmo_val_plots without forcing; don't use unrestricted --forceall.
The pseudo-Cℓ include flag is respected.

Validation

  • 198 passed, 2 skipped (catalogue-dependent), 257 warnings, in 204.29 s: Slurm job 25027245, def-sfabbro, 4 CPUs, 16 GiB, 1 hour requested; completed with exit code 0.
  • Ran all 12 test files listed in the plot-split review report, plus test_plotfix_cell.py, test_plotfix_layout.py, test_plotfix_psf.py and Decode FITS logical columns to booleans before writing HDF5 catalogues #423's test_catalog_logical_roundtrip.py.
  • Used /project/6001537/cdaley/containers/sp_validation-ddd58fe0.sif with this checkout's src/ first on PYTHONPATH; host Snakemake 9.23.1 supplied the workflow dry-runs.
    Log: /scratch/cdaley/cosmo-val-v2/plotsplit-review-25027245.log.
  • uvx ruff check and uvx ruff format --check: all 29 changed/new, non-deleted Python files pass.
    git diff --check passes.

The workflow regressions exercise pseudo-Cℓ enabled/disabled, exclude compute jobs from the forced plot-only DAG, and remove every required cache with all figures already present to verify refusal.
Synthetic renderer tests forbid catalogue reads; provenance tests cover public and named-blind consumers.
The branch is rebased onto develop at 158c6d30, retaining #423's logical-column decoding and #424's default mask unchanged.

Not verified in this landing pass: no real-catalogue cosmo_val run, production write, production-scale timing measurement, or full-survey numerical comparison.
The public figures below illustrate the outputs; they aren't a new production validation run.

Example figures from the public blinded v2 dashboard

Source: production dashboard.
All four image URLs were checked with curl -I and returned HTTP 200.

Pure E/B and ambiguous ξ components

Pure E/B and ambiguous components

COSEBIs mode amplitudes

COSEBIs E- and B-mode amplitudes

Galaxy–PSF/residual τ correlations

Tau correlations

NGC footprint counts

NGC galaxy counts per sky pixel

🤖 Generated with Claude Code

@cailmdaley
cailmdaley force-pushed the feat/cosmo-val-plot-split branch from b7d5405 to e480521 Compare October 28, 2026 18:59

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.

cosmo_val: decouple plotting from computation

1 participant