cosmicfishpie.CMBsurvey package

Submodules

cosmicfishpie.CMBsurvey.CMB_cov module

CMB MAIN

This is the main engine for CMB Fisher Matrix.

class cosmicfishpie.CMBsurvey.CMB_cov.CMBCov(cosmopars, print_info_specs=False)[source]

Bases: object

CMB covariance and derivatives for Fisher forecasts.

This class: - computes fiducial CMB spectra (via CMB_obs.ComputeCls) - adds instrumental noise given cfg.specs beam/noise settings - constructs a per-ell covariance matrix - computes numerical derivatives w.r.t. cfg.freeparams

Notes

The CMB implementation currently supports the observables CMB_T, CMB_E, CMB_B. Lensing spectra (e.g. phi-phi) are not implemented yet.

compute_covmat()[source]

Compute fiducial CMB spectra, add noise, and build covariance matrices.

Returns:

(noisy_cls, covvec) where noisy_cls is a dict of spectra arrays and covvec is a list of per-ell pandas DataFrames.

Return type:

tuple

compute_derivs(print_info_specs=False)[source]

Compute numerical derivatives of CMB spectra w.r.t. free parameters.

get_covmat(noisy_cls)[source]

Data covariance

Parameters:

noisy_cls (dict) – dictionary containing cls with noise

Returns:

  • list

  • data covariance matrix

getcls(allpars)[source]

Compute (noise-free) CMB C_ell for a given parameter dictionary.

getclsnoise(cls)[source]

Noise value

Parameters:

cls (dict) – cls dictionary

Returns:

Noise value[ell,bin]

Return type:

array

Note

Implements the following equation:

\[N_\ell^X = ...\]
sum_inv_linear(arr)[source]

Combine channels as inverse-noise weighted sum.

sum_inv_squares(arr)[source]

Combine multiple channels by inverse-variance weighting.

cosmicfishpie.CMBsurvey.CMB_obs module

CMB angular power spectra (C_ell).

This module provides a small wrapper that computes CMB angular power spectra (CMB_T, CMB_E, CMB_B) using the configured cosmology backend.

The numerical settings are taken from cosmicfishpie.configs.config:

  • cfg.specs[“lmin_CMB”], cfg.specs[“lmax_CMB”]

  • beam/noise settings are handled in cosmicfishpie.CMBsurvey.CMB_cov

class cosmicfishpie.CMBsurvey.CMB_obs.ComputeCls(cosmopars, print_info_specs=False)[source]

Bases: object

Compute CMB angular power spectra for the configured observables.

Parameters:
  • cosmopars (dict) – Cosmological parameters in CosmicFishPie basis (e.g. Omegam, h, …).

  • print_info_specs (bool, optional) – If True, print the numerical specifications currently stored in cfg.specs.

Notes

Results are stored in the result attribute after calling compute_all(). The result is a dictionary with at least:

  • ells: 1D array of multipoles

  • <obs1>x<obs2> arrays for each requested combination (e.g. CMB_TxCMB_T)

compute_all()[source]

Compute all requested CMB spectra and store them in self.result.

computecls()[source]

Return a dictionary of CMB C_ell arrays.

Returns:

Dictionary with ells and obs1xobs2 arrays.

Return type:

dict

print_numerical_specs()[source]

Print the contents of cfg.specs (debug helper).