FIRAS data (spectroxide.firas)#

Loads the COBE/FIRAS monopole spectrum, residuals, and the full 43 × 43 frequency-frequency covariance matrix from the LAMBDA archive into clean numpy arrays. A FIRASData instance is the primary handle: its attributes give the data itself, and its methods provide χ²-based constraint utilities for downstream analysis (μ/y upper limits, joint fits over a free CMB temperature, etc.).

Quick example#

from spectroxide.firas import FIRASData

firas = FIRASData()

# Loaded data
nu = firas.freq_ghz                # frequency channels [GHz]
r  = firas.residual_kJy            # monopole residuals [kJy/sr]
C  = firas.cov                     # full 43 × 43 covariance [(kJy/sr)²]

# χ² of an arbitrary intensity model against the residuals
chi2 = firas.chi2(model_kJy=my_model)

# 95 % CL upper limits on |μ| and y
mu_lim = firas.upper_limit_mu()
y_lim  = firas.upper_limit_y()

Module-level upper limits#

Precomputed FIRAS constraints (Fixsen et al. 1996) exposed as constants for quick use without constructing a FIRASData object.

Constant

Value

Meaning

MU_FIRAS_95

9 × 10⁻⁵

95 % CL upper limit on |μ|.

Y_FIRAS_95

1.5 × 10⁻⁵

95 % CL upper limit on y.

MU_FIRAS_68

4.5 × 10⁻⁵

68 % CL (1σ) upper limit on |μ|.

Y_FIRAS_68

7.5 × 10⁻⁶

68 % CL (1σ) upper limit on y.

spectroxide.firas.MU_FIRAS_95[source]#

Convert a string or number to a floating-point number, if possible.

spectroxide.firas.Y_FIRAS_95[source]#

Convert a string or number to a floating-point number, if possible.

spectroxide.firas.MU_FIRAS_68[source]#

Convert a string or number to a floating-point number, if possible.

spectroxide.firas.Y_FIRAS_68[source]#

Convert a string or number to a floating-point number, if possible.

FIRASData#

FIRAS spectral-distortion constraints with full covariance matrix.

Provides χ² fitting of arbitrary spectral distortions against the COBE/FIRAS monopole residuals using the full 43 × 43 frequency-frequency covariance matrix from the LAMBDA archive.

Data sources#

From https://lambda.gsfc.nasa.gov/product/cobe/firas_products.html:

  • Monopole spectrum: Fixsen et al. 1996, ApJ 473, 576 (Table 4).

  • Covariance matrix: FIRAS_COVARIANCE_MATRIX_LOWF.FITS.

The per-pixel covariance is converted to a monopole covariance using the correlation structure from the pixel covariance and the published monopole 1-σ errors: C_monopole_ij = σ_i σ_j corr_ij.

Usage#

>>> from spectroxide.firas import FIRASData
>>> firas = FIRASData()
>>> chi2 = firas.chi2(model_kJy)             # χ² for a model in kJy/sr
>>> mu_limit = firas.upper_limit_mu()        # 95% CL upper limit on |μ|
>>> result = firas.fit_distortion(delta_n_func)  # joint (μ, y, ΔT/T) fit
class spectroxide.firas.FIRASData[source]#

Bases: object

FIRAS monopole data with full covariance matrix.

Loads the FIRAS monopole spectrum (43 frequency channels, 68–640 GHz) and the full frequency-frequency covariance matrix from the bundled data files.

Parameters:
  • t_cmb (float, optional) – CMB temperature today, in K. Default 2.726 (Fixsen & Mather 2002).

  • t_dust (float, optional) – Effective dust temperature (in K) used by the galactic nuisance template ν² B_ν(T_dust). Default 9.0 (Fixsen 1996 §6.1).

Variables:
  • n_freq (int) – Number of frequency channels (43).

  • freq_cm (ndarray of float64) – Frequencies in cm⁻¹.

  • freq_ghz (ndarray of float64) – Frequencies in GHz.

  • x (ndarray of float64) – Dimensionless frequencies x = h ν / (k_B T_CMB).

  • spectrum_MJy (ndarray of float64) – Monopole spectrum in MJy/sr.

  • residual_kJy (ndarray of float64) – Residual monopole spectrum in kJy/sr.

  • sigma_kJy (ndarray of float64) – 1-σ diagonal uncertainties in kJy/sr.

  • galaxy_kJy (ndarray of float64) – Modelled high-latitude galactic spectrum in kJy/sr.

  • cov (ndarray, shape (43, 43)) – Full monopole covariance matrix in (kJy/sr)².

  • cov_inv (ndarray, shape (43, 43)) – Inverse covariance matrix in (kJy/sr)⁻².

  • corr (ndarray, shape (43, 43)) – Frequency-frequency correlation matrix (dimensionless).

Loaded data#

Attributes populated on construction. cov and cov_inv use the full LAMBDA correlation matrix; sigma_kJy is the diagonal only.

Attribute

Shape

Description

n_freq

int

Number of frequency channels (43).

freq_cm

(43,)

Channel frequencies in cm⁻¹.

freq_ghz

(43,)

Channel frequencies in GHz.

x

(43,)

Dimensionless x = h ν / (k_B T_CMB).

spectrum_MJy

(43,)

Monopole spectrum in MJy/sr.

residual_kJy

(43,)

Monopole residuals in kJy/sr (data minus reference blackbody).

sigma_kJy

(43,)

1-σ diagonal uncertainties in kJy/sr.

galaxy_kJy

(43,)

Modelled high-latitude galactic spectrum in kJy/sr.

cov

(43, 43)

Full monopole covariance in (kJy/sr)².

cov_inv

(43, 43)

Inverse covariance in (kJy/sr)⁻².

corr

(43, 43)

Frequency-frequency correlation matrix (dimensionless).

Constraint utilities#

Full-covariance χ² primitive plus the headline upper-limit and joint-fit routines used in production. Additional helpers (template-builders, amplitude fitters, Fisher-matrix utilities) exist on FIRASData for ad-hoc analysis but are not part of the documented surface.

FIRASData.chi2

Compute χ² of a model prediction against the FIRAS residuals.

FIRASData.upper_limit_mu

FIRAS upper limit on |μ| using the full covariance matrix.

FIRASData.upper_limit_y

FIRAS upper limit on |y| using the full covariance matrix.

FIRASData.profile_limit_floating_T

One-sided profile-likelihood upper limit with the CMB temperature floated.

FIRASData.fit_distortion

Joint fit of (μ, y, ΔT/T) to FIRAS residuals or a model.

FIRASData.chi2(model_kJy)[source]#

Compute χ² of a model prediction against the FIRAS residuals.

Parameters:

model_kJy (array_like, shape (43,)) – Model prediction for the residual spectrum in kJy/sr.

Returns:

floatχ² = (r m)ᵀ C⁻¹ (r m).

FIRASData.upper_limit_mu(cl=0.95, marginalise_y=True, marginalise_galactic=True)[source]#

FIRAS upper limit on |μ| using the full covariance matrix.

Marginalises over G_bb (unobservable temperature shift). Optionally also marginalises over y and over the galactic dust nuisance ν² B_ν(T_dust) (Fixsen 1996 §6.1).

Parameters:
  • cl (float, optional) – Confidence level (default 0.95).

  • marginalise_y (bool, optional) – If True (default), also marginalise over y-distortion.

  • marginalise_galactic (bool, optional) – If True (default), also marginalise over the galactic dust template.

Returns:

float – Upper limit on |μ| at the given CL.

FIRASData.upper_limit_y(cl=0.95, marginalise_mu=True, marginalise_galactic=True)[source]#

FIRAS upper limit on |y| using the full covariance matrix.

Marginalises over G_bb (unobservable temperature shift). Optionally also marginalises over μ and over the galactic dust nuisance ν² B_ν(T_dust) (Fixsen 1996 §6.1).

Parameters:
  • cl (float, optional) – Confidence level (default 0.95).

  • marginalise_mu (bool, optional) – If True (default), also marginalise over μ-distortion.

  • marginalise_galactic (bool, optional) – If True (default), also marginalise over the galactic dust template.

Returns:

float – Upper limit on |y| at the given CL.

FIRASData.profile_limit_floating_T(template_dn_func, cl=0.95, t_range=None, marginalise_galactic=True, use_diagonal=False)[source]#

One-sided profile-likelihood upper limit with the CMB temperature floated.

Fits the model

I_obs(ν) − B(ν, T) = 4π ν³ A · 𝒯(x(T)) + G₀ · ν² B(ν, T_d)

to the 43 FIRAS monopole residuals using the full 43 × 43 covariance matrix. The first term on the RHS converts the occupation-number template 𝒯 (supplied as template_dn_func) to specific intensity at amplitude A. The second term is a galactic dust foreground following Fixsen et al. (1996); residual galactic emission is not perfectly subtracted from the FIRAS monopole and is partially degenerate with broadband distortion shapes, so when marginalise_galactic=True (default) we marginalise over a fixed-shape ν² B(ν, T_d) template with T_d = 9 K and free amplitude G₀.

The CMB reference temperature T is itself a free parameter (it encodes the unobservable temperature shift), and both the residuals and the template shape 𝒯(x(T)) with x(T) = ν / T depend nonlinearly on T. We therefore profile over T by scanning a grid around T₀; at each T the best-fit A and G₀ are obtained analytically (the model is linear in both), and we take the T that minimises χ². The one-sided 95% CL upper limit corresponds to Δχ² = 2.71 on the profile likelihood ratio (Wilks’ theorem).

Parameters:
  • template_dn_func (callable) – template_dn_func(x) returns Delta-n(x) per unit signal amplitude at dimensionless frequencies x = h*nu/(k*T).

  • cl (float) – One-sided confidence level (default 0.95).

  • t_range (tuple of float, optional) – (T_min, T_max) search range for T [K]. Default: (2.720, 2.732), well within FIRAS precision.

  • marginalise_galactic (bool) – If True (default), profile over a galactic dust normalization G₀ with shape ν²·B_ν(T_dust). The dust template is independent of the trial T_CMB.

Returns:

dict with keys

amplitudefloat

Best-fit signal amplitude at profiled T.

sigmafloat

1-sigma uncertainty on amplitude.

upper_limitfloat

One-sided upper limit on amplitude at given CL, clipped at zero.

t_bestfloat

Best-fit blackbody temperature [K].

chi2_minfloat

Minimum chi-squared (profiled over both A and T).

FIRASData.fit_distortion(delta_n=None, model_kJy=None)[source]#

Joint fit of (μ, y, ΔT/T) to FIRAS residuals or a model.

Fits ΔI = μ · M + y · Y + (ΔT/T) · G_bb (in kJy/sr).

  • If delta_n is provided, it is converted to kJy/sr and subtracted from the residual before fitting.

  • If model_kJy is provided, it is also subtracted.

Parameters:
  • delta_n (callable or array_like, optional) – If callable, delta_n(x) returns Δn at the FIRAS frequencies. If array_like, shape (43,), Δn at the FIRAS frequencies. Default None.

  • model_kJy (array_like, shape (43,), optional) – Additional model prediction in kJy/sr to subtract before fitting. Default None.

Returns:

dict – Keys mu, y, delta_t (floats, best-fit parameters), mu_sigma, y_sigma, delta_t_sigma (floats, 1-σ uncertainties), param_cov (ndarray, shape (3, 3)), chi2 (float), ndof (int, 43 − 3 = 40), and pte (float, probability-to-exceed under the χ² null).