From aa44445cd5faf10f151d5a8d9212faf38b6b5d06 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 7 Sep 2018 15:36:46 +0200 Subject: [PATCH] Change energy dispersion energy axis name in csroo2caldb from "ETRUE" to "ENERG" (#2670). --- ChangeLog | 3 ++- NEWS | 4 +++- cscripts/csroot2caldb.py | 8 ++++---- doc/source/admin/release_history/1.6.rst | 3 +++ examples/show_irf.py | 7 +++++-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11be241..80bf4e7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2018-08-03 +2018-09-07 * Version 1.6.0 released ======================== + Use "ENERG" instead of "ETRUE" in energy dispersion axis names in csroot2caldb (#2670) Add hidden "use_irf_bkg" parameter to csphagen (#2659) Use full RMF true energy range for On/Off analysis in csspec (#2656) Defer import of ROOT module in csroot2caldb to run method (#2652) diff --git a/NEWS b/NEWS index 000361e..6b09d07 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.6.0 -3 August 2018 +7 September 2018 Introduction @@ -299,6 +299,8 @@ parameter due to a bug in the code. This bug was fixed (#2448). csroot2caldb - Generates calibration database from ROOT file ------------------------------------------------------------ +Change energy dispersion energy axis name from "ETRUE" to "ENERG" (#2670). + Change background template table name from "BGD" to "BKG" (#2343). The ROOT Python module is now imported in the run method and not globally so diff --git a/cscripts/csroot2caldb.py b/cscripts/csroot2caldb.py index 604ffe6..c0a9aeb 100755 --- a/cscripts/csroot2caldb.py +++ b/cscripts/csroot2caldb.py @@ -1658,7 +1658,7 @@ class csroot2caldb(ctools.cscript): def _make_3D_migra(self, array, hdu, name, unit, scale=1.0): """ - Make 3D data column as function of ETRUE, MIGRA and THETA + Make 3D data column as function of ENERG, MIGRA and THETA If the HDU has already the energy and offset angle columns, this method will simply add another data column. If name==None, the method will not @@ -1699,8 +1699,8 @@ class csroot2caldb(ctools.cscript): self._log_value(gammalib.NORMAL, 'Number of offsets', noffset) # Append axis columns to HDU - self._append_column_axis(hdu, 'ETRUE_LO', 'TeV', etrue, log=True) - self._append_column_axis(hdu, 'ETRUE_HI', 'TeV', etrue, log=True) + self._append_column_axis(hdu, 'ENERG_LO', 'TeV', etrue, log=True) + self._append_column_axis(hdu, 'ENERG_HI', 'TeV', etrue, log=True) self._append_column_axis(hdu, 'MIGRA_LO', '', migra) self._append_column_axis(hdu, 'MIGRA_HI', '', migra) self._append_column_axis(hdu, 'THETA_LO', 'deg', offsets) @@ -1719,7 +1719,7 @@ class csroot2caldb(ctools.cscript): hdu[name][0,index] = value * scale # Collect boundary information - bd_eng = 'ETRUE(%.4f-%.2f)TeV' % \ + bd_eng = 'ENERG(%.4f-%.2f)TeV' % \ (pow(10.0, etrue.GetBinLowEdge(1)), pow(10.0, etrue.GetBinUpEdge(netrue))) bd_migra = 'MIGRA(%.3f-%.3f)' % \ diff --git a/doc/source/admin/release_history/1.6.rst b/doc/source/admin/release_history/1.6.rst index 06080fc..40a50dc 100644 --- a/doc/source/admin/release_history/1.6.rst +++ b/doc/source/admin/release_history/1.6.rst @@ -32,6 +32,9 @@ Bug fixes Improvements ------------ +* [`2670 `_] - + Use ``ENERG`` instead of ``ETRUE`` in energy dispersion axis names in + :ref:`csroot2caldb` * [`2659 `_] - Add hidden ``use_irf_bkg`` parameter to :ref:`csphagen` * [`2656 `_] - diff --git a/examples/show_irf.py b/examples/show_irf.py index b40b4ec..440e7e5 100755 --- a/examples/show_irf.py +++ b/examples/show_irf.py @@ -2,7 +2,7 @@ # ========================================================================== # Display Instrument Response Function # -# Copyright (C) 2017 Juergen Knoedlseder +# Copyright (C) 2017-2018 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -249,7 +249,10 @@ def plot_edisp(edisp, emin=None, emax=None, tmin=None, tmax=None, Number of offset angles """ # Determine energy range - ieng = edisp.table().axis('ETRUE') + if edisp.table().has_axis('ENERG'): + ieng = edisp.table().axis('ENERG') + else: + ieng = edisp.table().axis('ETRUE') neng = edisp.table().axis_bins(ieng) if emin == None: emin = edisp.table().axis_lo(ieng, 0) -- libgit2 0.21.4