Describe the bug
When changing the gain model in the st.config to a numpy array, you get an error that arrays are not JSON seriazable. When changing this array to a list you get an indexing error, since lists can not be indexed by arrays.
To Reproduce
Insert the MWE of how to reproduce the error
gains = straxen.URLConfig.evaluate_dry(st.config['gain_model'])
median_top_gain = np.median(gains[:253])
gains_all_pmts_on = np.where(gains == 0, median_top_gain, gains)
st.set_config(dict(gain_model=gains_all_pmts_on))
Supposed fix / workaround
Changing the way we load the gain model here to self.to_pe = np.array(self.gain_model) works. We could also make a type check beforehand.
Describe the bug
When changing the gain model in the
st.configto a numpy array, you get an error that arrays are not JSON seriazable. When changing this array to a list you get an indexing error, since lists can not be indexed by arrays.To Reproduce
Insert the MWE of how to reproduce the error
Supposed fix / workaround
Changing the way we load the gain model here to
self.to_pe = np.array(self.gain_model)works. We could also make a type check beforehand.