sp_validation.nz.pipeline¶
Run an n(z) recipe: SOM direct calibration of a shear catalogue’s bins.
A recipe names its inputs, every choice of the calibration and its output
directory. run reads the calibrators and sources (inputs), and
calibrate trains the SOM on the calibrators, groups its cells, places the
bin edges, assigns every source, selects gold groups on the sources
themselves, and writes:
nz_tomo.txt: z and one density per bin, integrating to the bin’s share of the retained shear weight (cosmo_val’sshear.redshift_path);nz_nontomo.txt: their sum, the n(z) of everyTOM_BIN_ID > 0row;tom_bin.parquet:OBJECT_ID,TOM_BIN_IDandZBAND, row-aligned with the catalogue;realisations.npz: draws of every bin at once (ensemble), fromensemble_inputs.npz(per-group source tables, their response to magnitude offsets, and the calibrators’ BPZ gradients);summary.json: bin edges, means and weights, and the photometry match (inputs.match_report());calibrators.npz,som_model.npzandcalibration_arrays.npz;recipe.yaml: the recipe file, byte for byte.
- run(recipe, output=None, *, workers=1)[source]¶
Calibrate the catalogue of the recipe file
recipe.Products go to the recipe’s
outputdirectory, or tooutput.
- calibrate(config, cal, src, output, *, workers=1)[source]¶
Calibrate sources
srcon calibratorscaland write the products.calandsrcare the arrays ofinputs.calibrators()andinputs.sources();configis a loaded recipe.@sc [label:coupling] calibrator-edges-are-source-edges One set of edges, computed from the sources, bins the sources (
model["edges"]), the calibrators (calibration.calibrate()) and, throughcalibration_arrays.npz, the ensemble; a bin’s sources are calibrated only by the spectra in the same BPZ interval.