Commit 4972e29cb4500266c30dc487230a98d4586a363a
1 parent
2a3dae80
Add tmin to optional columns in csobsdef
Showing
2 changed files
with
8 additions
and
3 deletions
cscripts/csobsdef.py
| @@ -41,6 +41,7 @@ class csobsdef(ctools.cscript): | @@ -41,6 +41,7 @@ class csobsdef(ctools.cscript): | ||
| 41 | dec - Declination of pointing (deg) | 41 | dec - Declination of pointing (deg) |
| 42 | lon - Galactic longitude of pointing (deg) | 42 | lon - Galactic longitude of pointing (deg) |
| 43 | lat - Galactic latitude of pointing (deg) | 43 | lat - Galactic latitude of pointing (deg) |
| 44 | + tmin - Start of pointing (seconds) | ||
| 44 | duration - Duration of pointing (seconds) | 45 | duration - Duration of pointing (seconds) |
| 45 | emin - Lower energy limit (TeV) | 46 | emin - Lower energy limit (TeV) |
| 46 | emax - Upper energy limit (TeV) | 47 | emax - Upper energy limit (TeV) |
| @@ -268,7 +269,9 @@ class csobsdef(ctools.cscript): | @@ -268,7 +269,9 @@ class csobsdef(ctools.cscript): | ||
| 268 | obs.deadc(deadc) | 269 | obs.deadc(deadc) |
| 269 | 270 | ||
| 270 | # Set Good Time Interval. If no information is provided then use | 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 | if 'duration' in header: | 275 | if 'duration' in header: |
| 273 | duration = float(self._pntdef[row, header.index('duration')]) | 276 | duration = float(self._pntdef[row, header.index('duration')]) |
| 274 | else: | 277 | else: |
cscripts/csobsinfo.py
| @@ -306,9 +306,11 @@ class csobsinfo(ctools.cscript): | @@ -306,9 +306,11 @@ class csobsinfo(ctools.cscript): | ||
| 306 | self._log_value(gammalib.TERSE, 'Maximum energy', max_value) | 306 | self._log_value(gammalib.TERSE, 'Maximum energy', max_value) |
| 307 | 307 | ||
| 308 | # Log time range | 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 | self._log_header3(gammalib.TERSE, 'Time range') | 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 | # Log ontime and livetime in different units | 315 | # Log ontime and livetime in different units |
| 314 | on_time = '%.2f s = %.2f min = %.2f h' % \ | 316 | on_time = '%.2f s = %.2f min = %.2f h' % \ |