sp_validation.cosmo_val.sacc_writers¶
Born-as-SACC writers for the cosmo_val data products.
A thin, pure layer between the cosmo_val mixins (which compute statistics as
TreeCorr / NaMaster / b_modes arrays) and sp_validation.sacc_io (which
knows the file layout). Each *_to_sacc function turns one already-computed
statistic into a single-statistic SACC — a part — carrying that statistic’s
own covariance as its one block. assemble_analysis_sacc() rebuilds the
single {version}.sacc analysis file from these parts.
Everything here is single-bin today (bins=(0, 0)); the interface is
tomography-native so a future round supplies real bin pairs unchanged.
- xi_to_sacc(nz, metadata, theta, xip, xim, *, grid, theta_nom=None, npairs=None, weight=None, variances=None, covariance=None)[source]¶
One ξ± part (
bins=(0, 0)) on a named angular grid.The grid’s covariance comes in one of two shapes:
covariance, the dense[ξ+; ξ−]-ordered block (a jackknife estimate), orvariances, the concatenated[varxip; varxim]diagonal. At most one may be given.
- pseudo_cl_to_sacc(nz, metadata, ell_eff, cl_all, wsp, covariance=None, nside=None)[source]¶
One pseudo-Cℓ part: EE/BB/EB with the shared bandpower window.
cl_allis NaMaster’s decoupled(4, nbp)array (EE, EB, BE, BB); the window comes frombandpower_window_from_workspace(). Supplynsideonly for HEALPix-map spectra, whose measured spectrum includespw²(ℓ); catalogue-based spectra have no pixel window.covariance, when given, is the dense[EE; BB; EB]-ordered block matching insertion.
- cosebis_to_sacc(nz, metadata, result, scale_cut)[source]¶
One COSEBIs part at the fiducial scale cut.
resultis a single scale-cut result dict fromb_modes.calculate_cosebis—{"En", "Bn", "cov", ...}— wherecovis the[En; Bn]-ordered COSEBIs covariance.
- pure_eb_to_sacc(nz, metadata, theta, eb, covariance=None)[source]¶
One pure-E/B part: the six
sacc_io.PURE_KEYSblocks.ebis a mapping with the six keys (xip_E…xim_amb); each array is sampled attheta.covariance, when given, is the dense block inPURE_KEYSorder (matchingb_modes._EB_KEYSand the insertion order).
- rho_tau_to_sacc(nz, metadata, rho_stats, tau_stats, tau_cov_th=None)[source]¶
One ρ/τ part: ρ_0…ρ_5 autos and τ_0/τ_2/τ_5 leakage.
rho_stats/tau_statsare theshear_psf_leakagehandler tables (columnstheta,rho_{k}_p,varrho_{k}_p, … and the τ analogue). ρ carries avarrhodiagonal; τ carries avartaudiagonal, withtau_cov_th— a(3·nbin, 3·nbin)k-major matrix over the τ-plus points only — scattered into the τ-plus rows/columns when given.tau_cov_th=Noneleaves the τ block fully diagonal.
- assemble_analysis_sacc(parts)[source]¶
Rebuild the single
{version}.saccanalysis file from parts.Each part is a single-statistic Sacc (from a
*_to_saccwriter, loaded from disk) carrying its own covariance = its block. Tracers and metadata are seeded fromparts[0](every part describes the same catalogue version). Data points are re-added in the order the parts are given, which must be the canonical order (ξ± reporting, pseudo-Cℓ, COSEBIs, pure-E/B, ρ/τ), and the per-part blocks become oneBlockDiagonalCovariance. Insertion order and block order therefore agree by construction — validated bysp_validation.sacc_io.assemble_covariance().- Parameters:
parts (sequence of sacc.Sacc) – Single-statistic parts, each with a covariance, in canonical order.
- Returns:
The analysis Sacc with a
BlockDiagonalCovariancecovering every point.- Return type:
sacc.Sacc