tjpcov.covariance_calculator#

Module Contents#

Classes#

CovarianceCalculator

Class for the end user that will compute all covariance terms.

class tjpcov.covariance_calculator.CovarianceCalculator(config)[source]#

Class for the end user that will compute all covariance terms.

This will read the configuration file which will contain information of what covariances are requested (by giving the Class names) and add all their contributions.

Initialize the class with a config file or dictionary.

Parameters:

config (dict or str) – If dict, it returns the configuration dictionary directly. If string, it asumes a YAML file and parses it.

get_covariance_classes()[source]#

Return a dictionary with the covariance classes initialized.

Returns:

Dictionary with keys the covariance types (‘gauss’, SSC’, .. ) and values instances of the corresponding classes.

Return type:

dict

get_covariance()[source]#

Return the covariance with all the contributions added up.

Returns:

Final covariance with all the requested contributions added up.

Return type:

array

get_covariance_terms()[source]#

Return a dictionary with the covariance contributions.

The dictionary has keys the covariace types and values their covariance contributions. We add all the contributions for different tracer types (e.g. ClxCl + ClxN + NxN). Since they are independent it is easy to recover each of them independently.

Returns:

dictionary with keys the covariace types and values their covariance contributions.

Return type:

dict

create_sacc_cov(output='cls_cov.fits', save_terms=True)[source]#

Write the sacc file with the total covariance.

Parameters:
  • output (str, optional) – Filename. This will be joined to the outdir path specified in the configuration file. Default “cls_cov.fits”

  • save_terms (bool, optional) – If true, save individual files for each of the requested contributions. The will have the covariance term (e.g. gauss) appended to the filename (before the extension, e.g. cls_cov_gauss.fits)

Returns:

The final sacc file with the covariance matrix included.

Return type:

sacc.sacc.Sacc