From fd542967ef0897023c048be81c01ce33daffd40a Mon Sep 17 00:00:00 2001 From: Bastien Carreres Date: Mon, 26 Feb 2024 11:54:40 -0500 Subject: [PATCH] reverse set param order --- snsim/astrobj.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/snsim/astrobj.py b/snsim/astrobj.py index 09269c6..6b27942 100644 --- a/snsim/astrobj.py +++ b/snsim/astrobj.py @@ -290,19 +290,17 @@ def _set_model_par(self, model): # beta*c : scattering due to color and stretch} + {coherent intrinsic scattering} self._sim_par['mb'] = self.SALTTripp( M0, - self._sim_par['alpha'], - self._sim_par['beta'], - self._sim_par['x1'], - self._sim_par['c']) + self.mu + self._sim_par['alpha'], + self._sim_par['beta'], + self._sim_par['x1'], + self._sim_par['c']) + self.mu # Compute the x0 parameter - model.set( - x1=self._sim_par['x1'], - c=self._sim_par['c']) + model.set_source_peakmag(self._sim_par['mb'], 'bessellb', 'ab') self._sim_par['x0'] = model.get('x0') - + elif self._relation.lower() == 'salttrip_BS20': # TODO : COMPLETE BS20 using dev_damiano self._obj_attrs.extend(['alpha', 'beta', 'RV', 'Edust', 'x0', 'x1', 'c']) @@ -316,16 +314,16 @@ def _set_model_par(self, model): self._sim_par['c']) + self.mu # Compute the x0 parameter - model.set( - x1=self._sim_par['x1'], - c=self._sim_par['c']) - model.set_source_peakmag(self._sim_par['mb'], 'bessellb', 'ab') self._sim_par['x0'] = model.get('x0') - + else: # TODO - BC : Find a way to use lambda function for relation raise ValueError('Relation not available') + + model.set( + x1=self._sim_par['x1'], + c=self._sim_par['c']) return model @staticmethod