tjpcov.covariance_io#

Module Contents#

Classes#

CovarianceIO

Class to handle the input/output of the covariances.

class tjpcov.covariance_io.CovarianceIO(config)[source]#

Class to handle the input/output of the covariances.

This class does not compute anything and it is initialized inside the CovarianceBuilder and CovarianceCalculator classes.

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.

_read_config(config)[source]#

Return the configuration dictionary.

Parameters:

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

Returns:

Configuration dictionary

Return type:

dict

static _parse(filename)[source]#

Parse a configuration file.

Parameters:

filename (str) – The config file to parse. Should be YAML formatted.

Returns:

The raw config file as a dictionary.

Return type:

dict

create_sacc_cov(cov, output='cls_cov.fits', overwrite=False)[source]#

Write created cov to a new sacc object.

Parameters:
  • output (str, optional) – filename output. Defaults to “cls_cov.fits”

  • overwrite (bool, optional) – True if you want to overwrite an existing file. If False, it will not overwrite the file but will append the UTC time to the output to avoid losing the computed covariance. Defaults to False.

Returns:

The final sacc file with the covariance matrix included.

Return type:

sacc.sacc.Sacc

get_outdir()[source]#

Return the path to save the sacc file.

get_sacc_file()[source]#

Return the input sacc file.