Commit 4972e29cb4500266c30dc487230a98d4586a363a

Authored by Jürgen Knödlseder
1 parent 2a3dae80

Add tmin to optional columns in csobsdef

cscripts/csobsdef.py
... ... @@ -41,6 +41,7 @@ class csobsdef(ctools.cscript):
41 41 dec - Declination of pointing (deg)
42 42 lon - Galactic longitude of pointing (deg)
43 43 lat - Galactic latitude of pointing (deg)
  44 + tmin - Start of pointing (seconds)
44 45 duration - Duration of pointing (seconds)
45 46 emin - Lower energy limit (TeV)
46 47 emax - Upper energy limit (TeV)
... ... @@ -268,7 +269,9 @@ class csobsdef(ctools.cscript):
268 269 obs.deadc(deadc)
269 270  
270 271 # Set Good Time Interval. If no information is provided then use
271   - # the user parameter value "duration".
  272 + # the user parameter values "tmin" and "duration".
  273 + if 'tmin' in header:
  274 + self._tmin = float(self._pntdef[row, header.index('tmin')])
272 275 if 'duration' in header:
273 276 duration = float(self._pntdef[row, header.index('duration')])
274 277 else:
... ...
cscripts/csobsinfo.py
... ... @@ -306,9 +306,11 @@ class csobsinfo(ctools.cscript):
306 306 self._log_value(gammalib.TERSE, 'Maximum energy', max_value)
307 307  
308 308 # Log time range
  309 + tstart = '%.f (%s)' % (self._gti.tstart().mjd(), self._gti.tstart().utc())
  310 + tstop = '%.f (%s)' % (self._gti.tstop().mjd(), self._gti.tstop().utc())
309 311 self._log_header3(gammalib.TERSE, 'Time range')
310   - self._log_value(gammalib.TERSE, 'Start (MJD)', self._gti.tstart().mjd())
311   - self._log_value(gammalib.TERSE, 'Stop (MJD)', self._gti.tstop().mjd())
  312 + self._log_value(gammalib.TERSE, 'Start (MJD)', tstart)
  313 + self._log_value(gammalib.TERSE, 'Stop (MJD)', tstop)
312 314  
313 315 # Log ontime and livetime in different units
314 316 on_time = '%.2f s = %.2f min = %.2f h' % \
... ...