sp_validation.blinding¶
Blinds, the theory a blind shifts by, and the call that conceals a SACC.
A blind is a named secret, <paths.blinds>/<name>.blind.json holding a
seed, the envelope the hidden point is drawn in and the fiducial point. It is
drawn once, python -m sp_validation.blinding init <name>, and never
committed (*.blind.json is gitignored). Each catalogue entry of the
catalogue config declares blind: none (public) or blind: <name>
(blind_of()).
conceal() adds the blind’s shift, t(hidden) − t(fiducial), to every row
of a SACC; Smokescreen draws the hidden point from the seed and evaluates the
theory t at both points.
A theory is a function theory(params, s):
paramsis a dict of cosmological parameters with the keys offiducial()(S8,Omega_m,Omega_b,h,n_s,m_nu,w0,wa,logT_AGN,A_IA). The fiducial and hidden points differ only inS8andOmega_m.sis thesacc.Saccbeing concealed: its rows carry a data type, a tracer pair and a θ or ℓ tag, its tracers the n(z).It returns an array shaped like the data,
len(s.mean)values in the order ofs.data: the prediction for each row, zero where the cosmology has no effect.
For Cℓ_EE/BB/EB bandpowers, for example:
def my_theory(params, s):
out = np.zeros(len(s.mean))
ee = s.indices(sacc_io.CL_EE)
window = s.get_bandpower_windows(ee)
out[ee] = window.weight.T @ my_cl_ee(params, window.values)
return out # Cℓ_BB and Cℓ_EB stay zero
shear() is the default theory; no_signal() is that of a statistic
with no cosmological signal (ρ/τ).
The host Snakemake loads this module by path, so at import it needs only the standard library.
- exception BlindingError[source]¶
Bases:
RuntimeErrorA blind cannot be opened or applied; the message carries no hidden value.
- class Blind(name: str, path: Path | None = None)[source]¶
Bases:
objectA blind’s name and the path of its record;
nonehas no record.
- blind_of(catalogues, entry)[source]¶
The
blind:of catalogue-config entryentry.Refuses an entry that declares none, and entries reading one shear file under different blinds.
- open_blind(name, catalogues)[source]¶
Blind
nameof the catalogue configcatalogues; its record must exist.
- conceal(s, blind, theory=None)[source]¶
A copy of SACC
swithblind’s shift added to every row.The shift is t(hidden) − t(fiducial), t being
theory(defaultshear()). A failure raisesBlindingErrornaming only the exception type, so no message or traceback shows the hidden point.
- shear(params, s)[source]¶
Cosmic-shear ξ± and Cℓ_EE from pyccl; zeros for Cℓ_BB and Cℓ_EB.
ξ± is evaluated at each row’s stored θ (TreeCorr’s
meanr) and Cℓ_EE through each row’s bandpower window. Any other data type raises: pass your own theory.
- cosmology(params)[source]¶
The
pyccl.Cosmologyatparams, built once per point.Built through
cs_util.cosmo.get_cosmoon the CAMB HMCode2020-feedback route the CosmoSIS inference runs, with σ8 = S8/√(Ωm/0.3);get_cosmosubtracts CAMB’s Ω_ν fromOmega_mfor Ω_c.
- _ell()[source]¶
The multipoles the ξ± Hankel transform integrates over: every ℓ below 50, then 200 log-spaced up to 6·10⁴.