Skip to content

Commit

Permalink
Merge pull request #141 from joezuntz/more-sacc
Browse files Browse the repository at this point in the history
Add more data types and features to sacc
  • Loading branch information
joezuntz authored Nov 21, 2024
2 parents 71bdff7 + a6a4541 commit 967c70e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion likelihood/sacc/sacc_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"galaxy_shear_cl_eb": "shear_cl_eb",
"cl_be": "shear_cl_be",
"galaxy_shear_cl_be": "shear_cl_be",
"galaxy_density_cl": "galaxy_cl",
"galaxy_shearDensity_cl_e": "galaxy_shear_cl",
}


Expand All @@ -38,6 +40,7 @@ class SaccClLikelihood(GaussianLikelihood):
def __init__(self, options):
self.save_theory = options.get_string("save_theory", "")
self.save_realization = options.get_string("save_realization", "")
self.flip = options.get_string("flip", "").split()

super().__init__(options)

Expand Down Expand Up @@ -127,7 +130,7 @@ def build_data(self):
elif name in default_sections:
section = default_sections[name]
else:
raise ValueError(f"SACC likelihood does not yet understand data type {data_type}")
raise ValueError(f"SACC likelihood does not yet understand data type {name}")
print(f"Will look for theory prediction for data set {name} in section {section}")
self.sections_for_names[name] = section

Expand Down Expand Up @@ -332,6 +335,9 @@ def extract_spectrum_prediction(self, block, data_type):
i = int(b1.split("_")[-1]) + 1
j = int(b2.split("_")[-1]) + 1

if data_type in self.flip:
i, j = j, i

try:
cl_theory = block[section, f"bin_{i}_{j}"]
except BlockError:
Expand Down

0 comments on commit 967c70e

Please sign in to comment.