gaussian_cov module

Module to calculate Gaussian covariance using the Improved NKA method implemented using NaMaster.

class gaussian_cov.PowerSpectrum(zbin_1, zbin_2)

Bases: tuple

property zbin_1

Alias for field number 0

property zbin_2

Alias for field number 1

gaussian_cov.get_cov_blocks(n_zbin, she_she_input_filemask, lmax_in, lmin_in, she_nl_path, noise_lmin, mask_path, nside, lmax_mix, lmax_out, lmin_out, save_path)

Use NaMaster with the “improved NKA” method (Nicola et al. arXiv:2010.09717) to calculate N-bin shear covariance, with each block saved separately to disk.

Parameters
  • n_zbin (int) – Number of redshift bins.

  • she_she_input_mask (str) – Path to input shear-shear noise power spectra, with placeholders for {hi_zbin} and {lo_zbin}.

  • lmax_in (int) – Maximum l to read from input power spectra.

  • lmin_in (int) – l corresponding to first line in input power spectra.

  • she_nl_path (str) – Path to shear noise power spectrum, or None for no noise.

  • noise_lmin (int) – Minimum l for the shear noise power spectrum (0 for no noise).

  • mask_path (str) – Path to mask fits file, or None for full sky.

  • nside (int) – Healpix mask resolution to use - mask will be up/downgraded to this resolution.

  • lmax_mix (int) – Maximum l to account for mixing to/from.

  • lmax_out (int) – Maximum l to include in the covariance.

  • lmin_out (int) – Minimum l to include in the covariance.

  • save_path (str) – Path to save each block to, with placeholders for {spec1_idx} and {spec2_idx}.

gaussian_cov.load_cls(signal_paths, noise_paths, lmax_in, lmax_out, signal_lmin, noise_lmin)

Load a list of power spectra, adding noise as appropriate. If any supplied path is None the corresponding signal or noise power spectrum is assumed to be zero.

Parameters
  • signal_paths (list) – List of paths to signal power spectra - if any is None it is taken to be zero.

  • noise_paths (list) – List of paths to noise power spectra - if any is None it is taken to be zero.

  • lmax_in (int) – Maximum l to read in.

  • lmax_out (int) – Maximum l to output. If > lmax_in, power spectra are padded with zeros.

  • signal_lmin (int) – If > 0, signal power spectra are padded with zeros to start at l = 0.

  • noise_lmin (int) – If > 0, noise power spectra are padded with zeros to start at l = 0.

Returns

List of signal + noise power spectra in the same order they were supplied in.

Return type

list

gaussian_cov.spectrum_from_fields(zbin_a, zbin_b)

Returns the PowerSpectrum of the supplied bins in the correct order for indexing within this module, i.e. lower redshift bin first.

Note that this is unrelated to the ordering when loading from CosmoSIS output.

Parameters
  • zbin_a (int) – One redshift bin.

  • zbin_b (int) – The other redshift bin.

Returns

PowerSpectrum corresponding to the two given redshift bins.

Return type

PowerSpectrum