Introduce src/sp_validation/sacc_io.py: a single module that writes every sp_validation weak-lensing data product (ξ±, pseudo-Cℓ, COSEBIs, pure-E/B, ρ/τ PSF diagnostics, n(z), covariance) into self-describing SACC files in one fixed, self-consistent layout. This is pure format work — it defines the on-disk contract that the converter, migration, and blinding stages all consume, and nothing about it depends on where theory comes from.
Desired end state
Per-statistic builder functions, mirror reader functions, a covariance assembler, and thin save/load helpers, with round-trip tests proving every product's numeric payload survives write→read bit-exact (insertion order, covariance alignment, and n(z) all reconstruct exactly).
Each catalogue version is serialized as one SACC file — {version}.sacc — holding everything: NZ tracers source_i, reporting-grid ξ±, pseudo-Cℓ (EE/BB/EB) with bandpower windows, COSEBIs at the fiducial scale cut, pure-E/B, ρ/τ, and the integration-grid ξ± COSEBIs/pure-EB input as grid='integration' tagged points. The covariance is BlockDiagonal: the analysis blocks with zero cross-blocks (the same independence assumption the current assembly makes), plus a dense per-pair integration-ξ block from the analytic integration covariance when it exists, with the TreeCorr varxip/varxim diagonal as the explicit degraded fallback. Insertion order puts the analysis points contiguous first, then the integration points, so the blocks tile the mean.
At the production integration binning (1000 θ bins, 0.5–300′) the dense block is ~32 MB per pair — unremarkable. Extreme convergence-check grids (the one-off 10 000-bin run) degrade to a diagonal block; they don't fork the file format.
The API is tomography-native throughout (bins=(i,j); single-bin is (0,0)); NZ tracers are named source_i.
Acceptance
Round-trip tests pass bit-exact for every product; the terminal file builds and reloads with insertion order, covariance alignment, and n(z) intact.
— Fable on behalf of Cail.
Introduce
src/sp_validation/sacc_io.py: a single module that writes every sp_validation weak-lensing data product (ξ±, pseudo-Cℓ, COSEBIs, pure-E/B, ρ/τ PSF diagnostics, n(z), covariance) into self-describing SACC files in one fixed, self-consistent layout. This is pure format work — it defines the on-disk contract that the converter, migration, and blinding stages all consume, and nothing about it depends on where theory comes from.Desired end state
Per-statistic builder functions, mirror reader functions, a covariance assembler, and thin save/load helpers, with round-trip tests proving every product's numeric payload survives write→read bit-exact (insertion order, covariance alignment, and n(z) all reconstruct exactly).
Each catalogue version is serialized as one SACC file —
{version}.sacc— holding everything: NZ tracerssource_i, reporting-grid ξ±, pseudo-Cℓ (EE/BB/EB) with bandpower windows, COSEBIs at the fiducial scale cut, pure-E/B, ρ/τ, and the integration-grid ξ± COSEBIs/pure-EB input asgrid='integration'tagged points. The covariance isBlockDiagonal: the analysis blocks with zero cross-blocks (the same independence assumption the current assembly makes), plus a dense per-pair integration-ξ block from the analytic integration covariance when it exists, with the TreeCorrvarxip/varximdiagonal as the explicit degraded fallback. Insertion order puts the analysis points contiguous first, then the integration points, so the blocks tile the mean.At the production integration binning (1000 θ bins, 0.5–300′) the dense block is ~32 MB per pair — unremarkable. Extreme convergence-check grids (the one-off 10 000-bin run) degrade to a diagonal block; they don't fork the file format.
The API is tomography-native throughout (
bins=(i,j); single-bin is(0,0)); NZ tracers are namedsource_i.Acceptance
Round-trip tests pass bit-exact for every product; the terminal file builds and reloads with insertion order, covariance alignment, and n(z) intact.
— Fable on behalf of Cail.