From 4972e29cb4500266c30dc487230a98d4586a363a Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Mon, 27 Feb 2017 12:10:17 +0100 Subject: [PATCH] Add tmin to optional columns in csobsdef --- cscripts/csobsdef.py | 5 ++++- cscripts/csobsinfo.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cscripts/csobsdef.py b/cscripts/csobsdef.py index cc780c2..c06bf78 100755 --- a/cscripts/csobsdef.py +++ b/cscripts/csobsdef.py @@ -41,6 +41,7 @@ class csobsdef(ctools.cscript): dec - Declination of pointing (deg) lon - Galactic longitude of pointing (deg) lat - Galactic latitude of pointing (deg) + tmin - Start of pointing (seconds) duration - Duration of pointing (seconds) emin - Lower energy limit (TeV) emax - Upper energy limit (TeV) @@ -268,7 +269,9 @@ class csobsdef(ctools.cscript): obs.deadc(deadc) # Set Good Time Interval. If no information is provided then use - # the user parameter value "duration". + # the user parameter values "tmin" and "duration". + if 'tmin' in header: + self._tmin = float(self._pntdef[row, header.index('tmin')]) if 'duration' in header: duration = float(self._pntdef[row, header.index('duration')]) else: diff --git a/cscripts/csobsinfo.py b/cscripts/csobsinfo.py index f93aee8..eae9633 100755 --- a/cscripts/csobsinfo.py +++ b/cscripts/csobsinfo.py @@ -306,9 +306,11 @@ class csobsinfo(ctools.cscript): self._log_value(gammalib.TERSE, 'Maximum energy', max_value) # Log time range + tstart = '%.f (%s)' % (self._gti.tstart().mjd(), self._gti.tstart().utc()) + tstop = '%.f (%s)' % (self._gti.tstop().mjd(), self._gti.tstop().utc()) self._log_header3(gammalib.TERSE, 'Time range') - self._log_value(gammalib.TERSE, 'Start (MJD)', self._gti.tstart().mjd()) - self._log_value(gammalib.TERSE, 'Stop (MJD)', self._gti.tstop().mjd()) + self._log_value(gammalib.TERSE, 'Start (MJD)', tstart) + self._log_value(gammalib.TERSE, 'Stop (MJD)', tstop) # Log ontime and livetime in different units on_time = '%.2f s = %.2f min = %.2f h' % \ -- libgit2 0.21.4