Commit c723e6799505b55a526bf11323dccb3c631c49be
1 parent
79814b0d
test implementation + debugging
Showing
2 changed files
with
9 additions
and
3 deletions
cscripts/obsutils.py
| ... | ... | @@ -815,6 +815,12 @@ def get_onoff_obs(cls, obs): |
| 815 | 815 | |
| 816 | 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 | 826 | return onoff_obs | ... | ... |
test/test_cslightcrv.py
| ... | ... | @@ -245,8 +245,8 @@ class Test(test): |
| 245 | 245 | lcrv['inobs'] = self._offaxis_events |
| 246 | 246 | lcrv['inmodel'] = self._model_onoff |
| 247 | 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 | 250 | lcrv['tbinalg'] = 'LIN' |
| 251 | 251 | lcrv['tmin'] = 'MJD 58849.0008' |
| 252 | 252 | lcrv['tmax'] = 'MJD 58849.0112' | ... | ... |