# Cosmology Assumptions

**Status: RESOLVED (2026-09-07).** See "Resolved values" below for the citation and
exact numbers. All comoving-coordinate code must import these from
`configs/fiducial_cosmology.yaml` (single source of truth), never re-hardcode them.

## Why this matters

RA/Dec/redshift → comoving-coordinate conversion (Section 7 of the project brief)
requires a fiducial flat-ΛCDM cosmology (H0, Ωm at minimum) to compute comoving
distance via the standard integral

    D_C(z) = (c / H0) ∫[0,z] dz' / E(z')
    E(z) = sqrt(Ωm (1+z)^3 + ΩΛ)

An incorrect or unstated fiducial cosmology silently biases every downstream
clustering-scale measurement (r in ξ(r), k in P(k)). This is explicitly called out as
a unit-bug-class risk in Section 55 of the project brief.

## What we will NOT do

- We will NOT hardcode a remembered Planck/DESI parameter set from training-data
  memory without citing the actual source document for THIS data release.
- We will NOT silently default to `astropy.cosmology.Planck18` unless we've confirmed
  that is in fact what DESI's LSS catalog construction used (DESI's own fiducial
  cosmology, used for computing `NZ` and BAO-template quantities, may differ subtly
  from Planck18 — e.g. rounded Ωm, different neutrino-mass treatment).

## Resolution plan

1. When DESI LRG SGC clustering catalog + randoms are downloaded, inspect the FITS
   header (`fitsio`/`astropy.io.fits` `HDU.header`) for any cosmology keywords.
2. Cross-check against the DESI DR1 LSS catalog paper, Ross et al. 2025
   (arXiv:2411.12020), and the DR1 release paper (arXiv:2503.14745), for the explicit
   fiducial cosmology table used to build `NZ` and any BAO-template comoving distances.
3. Record the resolved values here with the exact citation (paper + section/table
   number, or FITS header keyword) before writing `src/cosmoscope/coords/`.
4. Implement via `astropy.cosmology.FlatLambdaCDM(H0=..., Om0=...)` with the verified
   values, parameterized in `configs/` (not hardcoded), so a future run can swap
   cosmology and see the sensitivity.

## Resolved values

**Source:** DESI DR1 LSS catalogs paper, Ross et al. 2025, arXiv:2411.12020,
introduction section (immediately before Section 2 "Data"), quoted verbatim:

> ωb = 0.02237, ωcdm = 0.12, h = 0.6736, A_s = 2.083 × 10⁻⁹, n_s = 0.9649,
> N_eff = 3.044, Σm_ν = 0.06 eV (single massive-neutrino eigenstate)

The paper states this model "matches the mean of the posterior from fitting to the
CMB temperature, polarisation and lensing power spectra as measured by Planck."

**Derived flat-ΛCDM parameters used for comoving-distance calculations:**

- H0 = 67.36 km/s/Mpc (h = 0.6736)
- Ω_m = (ωb + ωcdm) / h² = (0.02237 + 0.12) / 0.6736² = **0.3137721** (computed
  directly from the quoted values above, not independently re-quoted from any other
  source)
- Ω_Λ = 1 − Ω_m = 0.6862279 (flat)

**Implementation note (documented approximation):** `astropy.cosmology.FlatLambdaCDM`
does not natively separate a single massive-neutrino eigenstate from the total matter
budget in the same way CLASS/CAMB do. For comoving-distance purposes at the LRG sample
redshifts (0.4 ≤ z ≤ 1.1, per the observed range in the downloaded catalog — see
`data_provenance.md`), we use `FlatLambdaCDM(H0=67.36, Om0=0.3137721)` treating Ω_m as
the total non-relativistic matter density today, which is the standard simplification
used across the survey-clustering literature at these redshifts and introduces
negligible (sub-percent) distance error relative to a full massive-neutrino
Boltzmann-code treatment. This approximation is recorded here explicitly per the
brief's "unit bugs can invalidate the project" caution (Section 55) — it is a
documented choice, not a silent shortcut.

Values are stored machine-readably in `configs/fiducial_cosmology.yaml` so all
pipeline code references one source instead of re-hardcoding constants.
