Validation of weak-lensing catalogues (galaxy and star shapes and other parameters) produced by ShapePipe.
Authors: the CosmoStat lab at CEA Paris-Saclay — Martin Kilbinger, Cail Daley, Sacha Guerrini.
Contributors: Emma Ayçoberry, Lucie Baumont, Clara Bonini, Samuel Farrens, Lisa Goh, Axel Guinot, Fabian Hervas Peters.
Contact: martin.kilbinger@cea.fr
This package contains a library and several scripts and notebooks. The main
tasks that can be performed by sp_validation are:
- Shear validation, in particular for the output of the
shapepipepipeline. This task takes on input a shear catalogue with metacal information, performs the calibration and carries out various tests, e.g. PSF leakage. A calibrated shear catalogue is then created on output. - Post processing. A number of scripts allow further processing of the above output calibrated shear catalogue.
- Cosmology validation. This task uses the calibrated shear catalogue from above to run detailed diagnostics useful for further cosmology analysis, e.g. rho- and tau-statistics, E-/B-mode decomposition. Several catalogues can be compared and useful plots are created.
- Cosmology inference. This task uses the calibrated shear catalogue from a shear validation run and performes cosmology inference using the two-point correlation function.
src/sp_validation/ library code (incl. glass_mock core)
cosmo_val/ validation: code + config (promoted from notebooks/)
cosmo_inference/ inference: code + config (cosmosis / cosmocov)
workflow/ ALL analysis — modular Snakemake, multi-person → results/
papers/ final-figure assembly only (PDF, colour, layout)
scripts/ real reduction + runner scripts (catalog builders, masking, glass-mock runners)
scratch/ per-person — ad hoc work + personal workflows (tracked)
results/ analysis products + diagnostic plots (contents gitignored, dir kept)
docs/ tests/ config/
The dividing line is the inputs to a paper figure. Everything up to that
point is analysis and lives in workflow/: generic, reusable, modular
Snakemake, organized for several people, producing both products and diagnostic
plots into a single top-level results/. The figure itself is presentation
and lives in papers/<paper>/: final-figure assembly only — PDF, colour, layout
— tied to one paper, and free to never touch Snakemake. scratch/<person>/ is
personal and ad hoc, tracked because sharing scratch is useful. cosmo_val/ and
cosmo_inference/ are the side-by-side code+config homes for the validation and
inference stages.
The workflow scales by being modular, not monolithic: Snakemake's module
directive imports the shared rules under each run's own config and an output
prefix, so runs namespace under results/<name>/ without clobbering one
another.
sp_validation runs from a pre-built container: CI builds an image carrying
the full scientific stack on every push and publishes it to the
GitHub Container Registry.
The bundled spv-container CLI installs and manages your personal copy of it:
git clone https://github.com/CosmoStat/sp_validation.git
cd sp_validation
ln -s "$PWD/src/sp_validation/container.py" ~/.local/bin/spv-container
spv-container pull # fetch the image (~1.5 GB)
spv-container exec python -c "import sp_validation" # confirm it worksThat is the whole install. pull puts the image at its canonical per-user
path (~/.cache/sp_validation/), and everything else finds it there —
spv-container exec for one-off commands (spv-container exec bash for an
interactive shell) and the Snakemake workflow for cluster jobs.
spv-container status says what you have and how current it is;
spv-container sandbox gives you a writable copy for mid-analysis
pip installs. On a cluster, run the pull from a compute node.
To run the analysis workflow (workflow/), see
workflow/README.md: Snakemake runs on the host, and
the profile puts each job in the container itself. For Docker, development
installs, and more depth, see the
installation docs.
The following flow chart illustrates the steps required to go from ShapePipe output products to calibrated and well-selected galaxy catalogues.
See the documentation for instructions on how to set up and run sp_validation.
The output(s) of one or more shear validation runs can be processed further with post-processing scripts. See here for details.
In one command, set up the container and compute the blinded tomographic pseudo-Cℓ of the UNIONS v2.0.0 release:
apptainer pull sp_validation.sif docker://ghcr.io/cosmostat/sp_validation:develop
apptainer exec sp_validation.sif python -c 'from sp_validation.cosmo_val import CosmologyValidation; CosmologyValidation(["SP_v2.0.0"], compute_tomography=True).calculate_pseudo_cl()'The catalogue config's SP_v2.0.0 entry describes the release: calibrated
catalogue, n(z), masks and blind. Without a local copy, sp_validation fetches
what the run reads from the CADC vault into ~/.cache/sp_validation/vos/
(about 15 GB, once), which needs membership of the CADC group cfis-read and a
proxy certificate (cadc-get-cert -u <user> writes ~/.ssl/cadcproxy.pem).
Cℓ_EE is written concealed under the UNIONS blind; Cℓ_BB and Cℓ_EB are not
blinded. The SACC lands in output/. All ten bin pairs take 3 min on 32 cores
and 11 GB of memory, plus about 10 min for the first fetch from the vault.
See the corresponding documentation.
