Commit aa44445cd5faf10f151d5a8d9212faf38b6b5d06

Authored by Jürgen Knödlseder
1 parent ec917f94

Change energy dispersion energy axis name in csroo2caldb from "ETRUE" to "ENERG" (#2670).

ChangeLog
1   -2018-08-03
  1 +2018-09-07
2 2  
3 3 * Version 1.6.0 released
4 4 ========================
5 5  
  6 + Use "ENERG" instead of "ETRUE" in energy dispersion axis names in csroot2caldb (#2670)
6 7 Add hidden "use_irf_bkg" parameter to csphagen (#2659)
7 8 Use full RMF true energy range for On/Off analysis in csspec (#2656)
8 9 Defer import of ROOT module in csroot2caldb to run method (#2652)
... ...
1 1 New Features and Important Changes in ctools 1.6.0
2 2  
3   -3 August 2018
  3 +7 September 2018
4 4  
5 5  
6 6 Introduction
... ... @@ -299,6 +299,8 @@ parameter due to a bug in the code. This bug was fixed (#2448).
299 299  
300 300 csroot2caldb - Generates calibration database from ROOT file
301 301 ------------------------------------------------------------
  302 +Change energy dispersion energy axis name from "ETRUE" to "ENERG" (#2670).
  303 +
302 304 Change background template table name from "BGD" to "BKG" (#2343).
303 305  
304 306 The ROOT Python module is now imported in the run method and not globally so
... ...
cscripts/csroot2caldb.py
... ... @@ -1658,7 +1658,7 @@ class csroot2caldb(ctools.cscript):
1658 1658  
1659 1659 def _make_3D_migra(self, array, hdu, name, unit, scale=1.0):
1660 1660 """
1661   - Make 3D data column as function of ETRUE, MIGRA and THETA
  1661 + Make 3D data column as function of ENERG, MIGRA and THETA
1662 1662  
1663 1663 If the HDU has already the energy and offset angle columns, this method
1664 1664 will simply add another data column. If name==None, the method will not
... ... @@ -1699,8 +1699,8 @@ class csroot2caldb(ctools.cscript):
1699 1699 self._log_value(gammalib.NORMAL, 'Number of offsets', noffset)
1700 1700  
1701 1701 # Append axis columns to HDU
1702   - self._append_column_axis(hdu, 'ETRUE_LO', 'TeV', etrue, log=True)
1703   - self._append_column_axis(hdu, 'ETRUE_HI', 'TeV', etrue, log=True)
  1702 + self._append_column_axis(hdu, 'ENERG_LO', 'TeV', etrue, log=True)
  1703 + self._append_column_axis(hdu, 'ENERG_HI', 'TeV', etrue, log=True)
1704 1704 self._append_column_axis(hdu, 'MIGRA_LO', '', migra)
1705 1705 self._append_column_axis(hdu, 'MIGRA_HI', '', migra)
1706 1706 self._append_column_axis(hdu, 'THETA_LO', 'deg', offsets)
... ... @@ -1719,7 +1719,7 @@ class csroot2caldb(ctools.cscript):
1719 1719 hdu[name][0,index] = value * scale
1720 1720  
1721 1721 # Collect boundary information
1722   - bd_eng = 'ETRUE(%.4f-%.2f)TeV' % \
  1722 + bd_eng = 'ENERG(%.4f-%.2f)TeV' % \
1723 1723 (pow(10.0, etrue.GetBinLowEdge(1)),
1724 1724 pow(10.0, etrue.GetBinUpEdge(netrue)))
1725 1725 bd_migra = 'MIGRA(%.3f-%.3f)' % \
... ...
doc/source/admin/release_history/1.6.rst
... ... @@ -32,6 +32,9 @@ Bug fixes
32 32 Improvements
33 33 ------------
34 34  
  35 +* [`2670 <https://cta-redmine.irap.omp.eu/issues/2670>`_] -
  36 + Use ``ENERG`` instead of ``ETRUE`` in energy dispersion axis names in
  37 + :ref:`csroot2caldb`
35 38 * [`2659 <https://cta-redmine.irap.omp.eu/issues/2659>`_] -
36 39 Add hidden ``use_irf_bkg`` parameter to :ref:`csphagen`
37 40 * [`2656 <https://cta-redmine.irap.omp.eu/issues/2656>`_] -
... ...
examples/show_irf.py
... ... @@ -2,7 +2,7 @@
2 2 # ==========================================================================
3 3 # Display Instrument Response Function
4 4 #
5   -# Copyright (C) 2017 Juergen Knoedlseder
  5 +# Copyright (C) 2017-2018 Juergen Knoedlseder
6 6 #
7 7 # This program is free software: you can redistribute it and/or modify
8 8 # 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,
249 249 Number of offset angles
250 250 """
251 251 # Determine energy range
252   - ieng = edisp.table().axis('ETRUE')
  252 + if edisp.table().has_axis('ENERG'):
  253 + ieng = edisp.table().axis('ENERG')
  254 + else:
  255 + ieng = edisp.table().axis('ETRUE')
253 256 neng = edisp.table().axis_bins(ieng)
254 257 if emin == None:
255 258 emin = edisp.table().axis_lo(ieng, 0)
... ...