Function decompose_distortion

Source
pub fn decompose_distortion(x_grid: &[f64], delta_n: &[f64]) -> DistortionParams
Expand description

Decompose a spectral distortion into μ, y, and temperature shift components.

Default method: Bianchini & Fabbian (2022) nonlinear fit on the band [DEFAULT_DECOMP_X_MIN, DEFAULT_DECOMP_X_MAX] = [0.5, 18].

For the linear alternative (CJ2014 Appendix A Gram-Schmidt), call decompose_gram_schmidt directly. The two methods agree on μ and y to O(μ²) at realistic injection amplitudes (μ ≲ 10⁻³); they differ by a parameterisation-only offset δ_BF = δ_GS + μ/β_μ in the extracted ΔT/T.

Note: B&F absorbs μ inside the Bose-Einstein exponential, so the returned μ is the physical chemical potential (matching FIRAS-convention fits) — NOT Chluba’s orthogonalised “M-shape” μ. The relation is μ_BF = μ_M to leading order; at μ ≳ 0.1 (rare in practice) the nonlinear BE shape diverges from linear M(x) and the methods materially differ.