post_processing module
Contains functions for post-processing of covariance matrices/blocks.
- post_processing.bin_blocks(input_dir, input_filemask, input_label, binmat_path, output_dir)
Apply a binning matrix to all covariance blocks inside the input directory matching the input filemask.
- Parameters
input_dir (str) – Path to input directory.
input_filemask (str) – Glob filemask for input files within input directory (excluding path to directory).
input_label (str) – Label for covariance block within input .npz file. Should be ‘cov_block’ for Cov_G blocks output by gaussian_cov.get_cov_blocks, or ‘cov_mixed’ for the output from mix_blocks.
binmat_path (str) – Path to binning matrix.
output_dir (str) – Path to output directory.
- post_processing.combine_blocks(input_filemask, input_label, save_path, n_spec, n_bp)
Combine covariance blocks into a full covariance matrix.
- Parameters
input_filemask (str) – Filemask for input blocks, with {spec1} and {spec2} placeholders for the indices of the two power spectra.
input_label (str) – Label for covariance block within input .npz file. Should be ‘cov_binned’ for output from bin_blocks.
save_path (str) – Path to save output covariance matrix to.
n_spec (int) – Total number of power spectra.
n_bp (int) – Number of bandpowers.
- post_processing.get_composite_covs(cov_g_path, cov_ss_path, cov_cng_path, output_path)
Form composite covariances from different combinations of G, SS and CNG, and save to disk.
- Parameters
cov_g_path (str) – Path to Gaussian covariance.
cov_ss_path (str) – Path to super-sample covariance.
cov_cng_path (str) – Path to connected non-Gaussian covariance.
output_path (str) – Output path, with {label} placeholder which will be replaced by g, g_ss, g_cng or tot.
- post_processing.get_mixmat(mask_path, nside, lmax_mix, lmax_out, save_path)
Produce the EE->EE mixing matrix for a given mask.
- Parameters
mask_path (str) – Path to mask fits file, or set to None for full sky.
nside (int) – Healpix map resolution to use - input mask will be up/downgraded to this resolution.
lmax_mix (int) – Maximum l to include mixing to/from.
lmax_out (int) – Maximum l to support output to.
save_path (str) – Path to save mixing matrix as a .npz file.
- post_processing.mix_blocks(input_dir, input_filemask, mixmat_path, output_dir, lmin, lmax_in, lmax_out)
Apply a mixing matrix to all covariance blocks inside the input directory matching the input filemask.
- Parameters
input_dir (str) – Path to input directory.
input_filemask (str) – Glob filemask for input files within input directory (excluding path to directory).
mixmat_path (str) – Path to mixing matrix.
output_dir (str) – Path to output directory.
lmin (int) – Minimum l in input covariance blocks.
lmax_in (int) – Maximum l in input covariance blocks.
lmax_out (int) – Maximum l in output.