Skip to content

Commit

Permalink
Add cov rescale
Browse files Browse the repository at this point in the history
  • Loading branch information
andreicuceu committed Dec 1, 2023
1 parent fa89614 commit 542ed82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vega/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def __init__(self, corr_item):
data_path = corr_item.config['data'].get('filename')
dmat_path = corr_item.config['data'].get('distortion-file', None)
cov_path = corr_item.config['data'].get('covariance-file', None)
cov_rescale = corr_item.config['data'].getfloat('cov_rescale', None)

self._read_data(data_path, corr_item.config['cuts'], dmat_path, cov_path)
self._read_data(data_path, corr_item.config['cuts'], dmat_path, cov_path, cov_rescale)
self.corr_item.init_coordinates(
self.model_coordinates, self.dist_model_coordinates, self.data_coordinates)

Expand Down Expand Up @@ -204,7 +205,7 @@ def has_distortion(self):
"""
return self._distortion_mat is not None

def _read_data(self, data_path, cuts_config, dmat_path=None, cov_path=None):
def _read_data(self, data_path, cuts_config, dmat_path=None, cov_path=None, cov_rescale=None):
"""Read the data, mask it and prepare the environment.
Parameters
Expand Down Expand Up @@ -259,6 +260,9 @@ def _read_data(self, data_path, cuts_config, dmat_path=None, cov_path=None):
elif 'CO' in hdul[1].columns.names:
self._cov_mat = hdul[1].data['CO']

if cov_rescale is not None:
self._cov_mat *= cov_rescale

Check warning on line 264 in vega/data.py

View check run for this annotation

Codecov / codecov/patch

vega/data.py#L264

Added line #L264 was not covered by tests

# Get the cosmological parameters
if "OMEGAM" in header:
self.cosmo_params = {}
Expand Down

0 comments on commit 542ed82

Please sign in to comment.