Commit c723e6799505b55a526bf11323dccb3c631c49be

Authored by Luigi Tibaldo
1 parent 79814b0d

test implementation + debugging

cscripts/obsutils.py
@@ -815,6 +815,12 @@ def get_onoff_obs(cls, obs): @@ -815,6 +815,12 @@ def get_onoff_obs(cls, obs):
815 815
816 onoff_obs = phagen.obs().copy() 816 onoff_obs = phagen.obs().copy()
817 817
818 - #need to reset statistic for fit??? 818 + # On/Off observations are created with CSTAT as default statistic
  819 + # We will change this to the user choice
  820 + if cls['statistic'].string() == 'DEFAULT':
  821 + pass
  822 + else:
  823 + for observation in onoff_obs:
  824 + observation.statistic(cls['statistic'].string())
819 825
820 return onoff_obs 826 return onoff_obs
test/test_cslightcrv.py
@@ -245,8 +245,8 @@ class Test(test): @@ -245,8 +245,8 @@ class Test(test):
245 lcrv['inobs'] = self._offaxis_events 245 lcrv['inobs'] = self._offaxis_events
246 lcrv['inmodel'] = self._model_onoff 246 lcrv['inmodel'] = self._model_onoff
247 lcrv['srcname'] = 'Crab' 247 lcrv['srcname'] = 'Crab'
248 - lcrv['caldb'] = self._caldb  
249 - lcrv['irf'] = self._irf 248 + lcrv['caldb'] = self._caldb
  249 + lcrv['irf'] = self._irf
250 lcrv['tbinalg'] = 'LIN' 250 lcrv['tbinalg'] = 'LIN'
251 lcrv['tmin'] = 'MJD 58849.0008' 251 lcrv['tmin'] = 'MJD 58849.0008'
252 lcrv['tmax'] = 'MJD 58849.0112' 252 lcrv['tmax'] = 'MJD 58849.0112'