Skip to content

Commit

Permalink
fix hdf5 bug with new cgm options
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed Dec 13, 2024
1 parent 078bada commit 4f8baa1
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions eazy/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pass

from . import photoz
from . import param
from . import utils
from . import templates as templates_code

Expand Down Expand Up @@ -339,16 +340,36 @@ def __init__(self, h5file, verbose=True):
Om0=self.param['OMEGA_M'],
Ode0=self.param['OMEGA_L'],
Tcmb0=2.725, Ob0=0.048)

self.set_tempfilt()

if self.param['ADD_CGM'] in utils.TRUE_VALUES:
self.add_cgm = True

if 'ADD_CGM' in self.param:
if self.param['ADD_CGM'] in utils.TRUE_VALUES:
self.add_cgm = True
self.max_fuv_wav = 2000.

Check warning on line 347 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L344-L347

Added lines #L344 - L347 were not covered by tests
else:
self.add_cgm = False
self.max_fuv_wav = 1300

Check warning on line 350 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L349-L350

Added lines #L349 - L350 were not covered by tests

self.sigmoid_params = (

Check warning on line 352 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L352

Added line #L352 was not covered by tests
self.param['SIGMOID_PARAM1'],
self.param['SIGMOID_PARAM2'],
self.param['SIGMOID_PARAM3']
)

else:
self.add_cgm = False
self.param['ADD_CGM'] = False

Check warning on line 359 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L359

Added line #L359 was not covered by tests

sigmoid_params = (self.param['SIGMOID_PARAM1'], self.param['SIGMOID_PARAM2'], self.param['SIGMOID_PARAM3'])
self.sigmoid_params = sigmoid_params
defaults = param.EazyParam(verbose=False)

Check warning on line 361 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L361

Added line #L361 was not covered by tests

self.sigmoid_params = (

Check warning on line 363 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L363

Added line #L363 was not covered by tests
defaults['SIGMOID_PARAM1'],
defaults['SIGMOID_PARAM2'],
defaults['SIGMOID_PARAM3']
)

self.add_cgm = False
self.max_fuv_wav = 1300

Check warning on line 370 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L369-L370

Added lines #L369 - L370 were not covered by tests

self.set_tempfilt()

Check warning on line 372 in eazy/hdf5.py

View check run for this annotation

Codecov / codecov/patch

eazy/hdf5.py#L372

Added line #L372 was not covered by tests


def info(self):
Expand Down

0 comments on commit 4f8baa1

Please sign in to comment.