tjpcov.covariance_io
====================

.. py:module:: tjpcov.covariance_io


Classes
-------

.. autoapisummary::

   tjpcov.covariance_io.CovarianceIO


Module Contents
---------------

.. py:class:: CovarianceIO(config)

   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.

   :param config: If dict, it returns the configuration
                  dictionary directly. If string, it asumes a YAML file and
                  parses it.
   :type config: dict or str


   .. py:attribute:: config


   .. py:attribute:: sacc_file
      :value: None



   .. py:attribute:: outdir


   .. py:method:: _read_config(config)

      Return the configuration dictionary.

      :param config: If dict, it returns the configuration
                     dictionary directly. If string, it asumes a YAML file and
                     parses it.
      :type config: dict or str

      :returns: Configuration dictionary
      :rtype: dict



   .. py:method:: _parse(filename)
      :staticmethod:


      Parse a configuration file.

      :param filename: The config file to parse. Should be YAML formatted.
      :type filename: str

      :returns: The raw config file as a dictionary.
      :rtype: dict



   .. py:method:: create_sacc_cov(cov, output='cls_cov.fits', overwrite=False)

      Write created cov to a new sacc object.

      :param output: filename output. Defaults to "cls_cov.fits"
      :type output: str, optional
      :param overwrite: 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.
      :type overwrite: bool, optional

      :returns: The final sacc file with the covariance
                matrix included.
      :rtype: :obj:`sacc.sacc.Sacc`



   .. py:method:: get_outdir()

      Return the path to save the sacc file.



   .. py:method:: get_sacc_file()

      Return the input sacc file.



