Repository navigation
Working tomographic n(z): SOM calibration in sp_validation, read by cosmo_val as a file - #468
Open
cailmdaley wants to merge 6 commits into
Open
cailmdaley wants to merge 6 commits into
cailmdaley wants to merge 6 commits into
Conversation
…p duplicate reweighting figure Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JK7o9G4LJE9R9mdaj4rJ4J
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude (Opus) on behalf of Cail.
A working tomographic n(z) for v2 now has a home in sp_validation. cosmo_val reads it from the catalogue entry like any other n(z) file, and the code that made it can regenerate it from a recipe. This is the stand-in Martin and Cail discussed on #weak-lensing-3x2 (2 Nov). The calibration lives with the shape catalogues, and the photo-z group can later replace the method without changing the file cosmo_val reads.
Using it.
SP_v2.0incosmo_val/cat_config.yamlis the blinded v2 tomographic run's entry. It pointsshear.redshift_pathat the four-bin n(z) andtomo_bin_colatTOM_BIN_ID. cosmo_val only reads that file; it never runs the calibration or touches photometry. To use the n(z) elsewhere, copy the one text file and pointredshift_pathat it. On candide it is/n17data/cdaley/unions/analyses/shear_tomographic/nz_v2_full/calibration/nz_tomo.txt(world-readable). The entry is Nibi-only, so it declareshost: nibi, and the candide path guard skips entries declared for another host.Regenerating it.
cosmo_val/nz/v2_bound9.yamlrecords the recipe once. Run these inside the container on an allocation:python scripts/prepare_nz_photometry.py cosmo_val/nz/v2_bound9.yaml # attach DR6 ugriz + BPZ to the shear selection python scripts/calibrate_nz.py cosmo_val/nz/v2_bound9.yaml --workers 16 [--figures DIR] [--rebuild-model]The method is a SOM direct calibration in the KiDS style, kept deliberately simple:
The code is
src/sp_validation/nz_{photometry,calibration,pipeline,diagnostics}.py.Result. Per-bin ⟨z⟩ is 0.286 / 0.448 / 0.612 / 0.929. Bins shift by at most 0.006 between the full area and the original 600-tile calibration.
The second z filter carries the coverage. Gold retains 51% of the bound-9 shear weight with z2 and 32% with canonical z alone. Over the full area only 39% of the weight has canonical-z photometry.
The four-bin sum has ⟨z⟩ = 0.566. Published v1.4.6.3 has 0.596; the gap sits in the tail above z ≈ 0.8.
SOM diagnostics: SOM plane, gold masks, BPZ vs spec-z
Limits.
TOM_BIN_ID > 0, about 58% of n_eff. A non-tomographic run over all objects pairs an all-object sample with a gold-only n(z).Checks.
TOM_BIN_IDchanges and ⟨z⟩ equal to 9e-16, from both the frozen model and--rebuild-model. The rebuilt SOM, groups and gold masks are bit-identical. The gate code is inscratch/cdaley/nz_som_reproduction/.Closes #455. #274 (the photo-z group's SOM n(z)) stays open; this is the placeholder it will replace.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JK7o9G4LJE9R9mdaj4rJ4J