diff --git a/ChangeLog b/ChangeLog index e41c05a..d0274ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2016-10-17 +2016-11-10 * Version 1.2.0 released ======================== + Fix energy boundary handline in cssens (#1873) Add outcovmat parameter to ctlike (#1863) Add publish parameter and methods to ctobssim, ctselect, cslightcrv and csspec (#1871) Add csviscube script (#1853) diff --git a/NEWS b/NEWS index 29e3ee5..a758b89 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.2.0 -17 October 2016 +10 November 2016 Introduction @@ -213,6 +213,9 @@ a Sun constraint, but no Moon constraint (#1835). A publish() method has been added to cslightcrv and csspec that publishes the results on a VO hub (#1871). +Fix energy boundary handling in cssens that has been corrupted during code +refactoring (#1873). + Examples -------- diff --git a/cscripts/cssens.py b/cscripts/cssens.py index 9d99909..5d3a8b0 100755 --- a/cscripts/cssens.py +++ b/cscripts/cssens.py @@ -201,11 +201,11 @@ class cssens(ctools.cscript): Maximum energy """ # Loop over all observations in container - for obs in self._obs: + for i, obs in enumerate(self._obs): - # Get observation energy boundaries - obs_ebounds = obs.events().ebounds() - + # Get energy boundaries of the observation + obs_ebounds = self._obs_ebounds[i] + # Get minimum and maximum energy of the observation obs_emin = obs_ebounds.emin() obs_emax = obs_ebounds.emax() @@ -546,9 +546,10 @@ class cssens(ctools.cscript): # Get parameters self._get_parameters() - # Loop over observations and store ebounds + # Loop over observations and store a deep copy of the energy + # boundaries for later use for obs in self._obs: - self._obs_ebounds.append(obs.events().ebounds()) + self._obs_ebounds.append(obs.events().ebounds().copy()) # Initialise script colnames = ['loge', 'emin', 'emax', 'crab_flux', 'photon_flux',