sp_validation.cosmo_val.pseudo_cl

Pseudo-Cl / harmonic-space diagnostic for cosmology validation.

This mixin holds the pseudo-Cl (harmonic-space) machinery: NaMaster field/workspace construction, the analytic (iNKA) Gaussian covariance, the OneCovariance Gaussian + non-Gaussian covariance, map- and catalog-based pseudo-Cl estimation, random-rotation noise debiasing, and plotting. It depends on pymaster (NaMaster), healpy, and OneCovariance.

class PseudoClMixin[source]

Bases: object

property pseudo_cls
property pseudo_cls_onecov
get_namaster_bin(lmin, lmax, b_lmax)[source]

Build NaMaster binning object (thin wrapper, state -> primitive).

get_variance_map(nside, e1, e2, w, unique_pix, idx_rep)[source]

Create a variance map from the input catalog.

get_field_and_workspace_from_map(mask, lmax, b)[source]

Create a NaMaster field and workspace from the input map.

calculate_pseudo_cl_eb_cov()[source]

Compute a theoretical Gaussian covariance of the Pseudo-Cl for EE, EB and BB.

calculate_pseudo_cl_onecovariance()[source]

Compute the pseudo-Cl covariance using OneCovariance.

_modify_onecov_config(template_config, config_path, out_dir, mask_path, redshift_distr_path, ver)[source]

Modify OneCovariance configuration file with correct mask, redshift distribution, and ellipticity dispersion parameters.

Parameters:
  • template_config (str) – Path to the template configuration file

  • config_path (str) – Path where the modified configuration will be saved

  • mask_path (str) – Path to the mask file

  • redshift_distr_path (str) – Path to the redshift distribution file

_load_onecovariance_cov(out_dir, ver)[source]
calculate_pseudo_cl_g_ng_cov(gaussian_part='iNKA')[source]
calculate_pseudo_cl()[source]

Compute the pseudo-Cl of given catalogs.

calculate_pseudo_cl_map(ver, nside, out_path)[source]
calculate_pseudo_cl_catalog(ver, out_path)[source]
get_n_gal_map(params, nside, cat_gal)[source]

Weighted galaxy number-density map (thin wrapper -> primitive).

get_gaussian_real(params, nside, lmax, cat_gal, n_gal, mask, unique_pix, idx_rep, rng=None)[source]
get_sample(params, nside, lmax, b, cat_gal, n_gal, mask, unique_pix, idx_rep, rng=None)[source]
get_pseudo_cls_map(map, mask, wsp=None)[source]

Map-based pseudo-cl (thin wrapper, state -> primitive).

get_pseudo_cls_catalog(catalog, params, wsp=None)[source]

Catalog-based pseudo-cl (thin wrapper, state -> primitive).

apply_random_rotation(e1, e2, rng=None)[source]

Random ellipticity rotation (thin wrapper -> primitive).

Pass a seeded rng for reproducible noise realizations.

save_pseudo_cl(ell_eff, pseudo_cl, out_path)[source]

Save pseudo-Cl’s to a FITS file.

Parameters:
  • pseudo_cl (np.array) – Pseudo-Cl’s to save.

  • out_path (str) – Path to save the pseudo-Cl’s to.

plot_pseudo_cl()[source]

Plot pseudo-Cl’s for given catalogs.