From 3c906a62eaca5c43e4c8c8abded6f9445200983e Mon Sep 17 00:00:00 2001 From: Gabriel Brammer Date: Tue, 17 Dec 2024 15:19:56 +0100 Subject: [PATCH] fix bug with param defaults --- eazy/hdf5.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eazy/hdf5.py b/eazy/hdf5.py index 978898d3..c8958d67 100644 --- a/eazy/hdf5.py +++ b/eazy/hdf5.py @@ -341,6 +341,8 @@ def __init__(self, h5file, verbose=True): Ode0=self.param['OMEGA_L'], Tcmb0=2.725, Ob0=0.048) + param_defaults = param.EazyParam(verbose=False) + if 'ADD_CGM' in self.param: if self.param['ADD_CGM'] in utils.TRUE_VALUES: self.add_cgm = True @@ -357,18 +359,20 @@ def __init__(self, h5file, verbose=True): else: self.param['ADD_CGM'] = False - - defaults = param.EazyParam(verbose=False) self.sigmoid_params = ( - defaults['SIGMOID_PARAM1'], - defaults['SIGMOID_PARAM2'], - defaults['SIGMOID_PARAM3'] + param_defaults['SIGMOID_PARAM1'], + param_defaults['SIGMOID_PARAM2'], + param_defaults['SIGMOID_PARAM3'] ) self.add_cgm = False self.max_fuv_wav = 1300 + for par in param_defaults.param_names: + if par not in self.param: + self.param[par] = param_defaults[par] + self.set_tempfilt()