Commit eab4eddca15268cd768664166d2eaede5c2c535c
1 parent
2ef938fe
Add "name" parameter to csobsdef script
Showing
3 changed files
with
7 additions
and
3 deletions
cscripts/csobsdef.par
| @@ -23,6 +23,7 @@ outobs, f, a, obs.xml,,, "Output observation definition XML file" | @@ -23,6 +23,7 @@ outobs, f, a, obs.xml,,, "Output observation definition XML file" | ||
| 23 | # Common pointing parameter values | 23 | # Common pointing parameter values |
| 24 | #================================= | 24 | #================================= |
| 25 | duration, r, a, 1800.0,,, "Pointing duration (seconds)" | 25 | duration, r, a, 1800.0,,, "Pointing duration (seconds)" |
| 26 | +name, s, h, None,,, "Observation name" | ||
| 26 | caldb, s, h, ,,, "Calibration database" | 27 | caldb, s, h, ,,, "Calibration database" |
| 27 | irf, s, h, ,,, "Instrument response function" | 28 | irf, s, h, ,,, "Instrument response function" |
| 28 | emin, r, h, UNDEF,,, "Lower energy limit (TeV)" | 29 | emin, r, h, UNDEF,,, "Lower energy limit (TeV)" |
cscripts/csobsdef.py
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | # ========================================================================== | 2 | # ========================================================================== |
| 3 | # Generation of an observation definition file | 3 | # Generation of an observation definition file |
| 4 | # | 4 | # |
| 5 | -# Copyright (C) 2015-2016 Juergen Knoedlseder | 5 | +# Copyright (C) 2015-2017 Juergen Knoedlseder |
| 6 | # | 6 | # |
| 7 | # This program is free software: you can redistribute it and/or modify | 7 | # This program is free software: you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by | 8 | # it under the terms of the GNU General Public License as published by |
| @@ -85,7 +85,7 @@ class csobsdef(ctools.cscript): | @@ -85,7 +85,7 @@ class csobsdef(ctools.cscript): | ||
| 85 | """ | 85 | """ |
| 86 | # Set name and version | 86 | # Set name and version |
| 87 | self._name = 'csobsdef' | 87 | self._name = 'csobsdef' |
| 88 | - self._version = '1.2.0' | 88 | + self._version = '1.3.0' |
| 89 | 89 | ||
| 90 | # Initialise class members | 90 | # Initialise class members |
| 91 | self._obs = gammalib.GObservations() | 91 | self._obs = gammalib.GObservations() |
| @@ -217,7 +217,7 @@ class csobsdef(ctools.cscript): | @@ -217,7 +217,7 @@ class csobsdef(ctools.cscript): | ||
| 217 | if 'name' in header: | 217 | if 'name' in header: |
| 218 | name = self._pntdef[row, header.index('name')] | 218 | name = self._pntdef[row, header.index('name')] |
| 219 | else: | 219 | else: |
| 220 | - name = 'None' | 220 | + name = self['name'].string() |
| 221 | obs.name(name) | 221 | obs.name(name) |
| 222 | 222 | ||
| 223 | # Set observation identifier. If no observation identified was | 223 | # Set observation identifier. If no observation identified was |
doc/source/users/reference_manual/csobsdef.rst
| @@ -62,6 +62,9 @@ General parameters | @@ -62,6 +62,9 @@ General parameters | ||
| 62 | ``duration [real]`` | 62 | ``duration [real]`` |
| 63 | Duration of observation (in seconds). | 63 | Duration of observation (in seconds). |
| 64 | 64 | ||
| 65 | +``(name = "") [string]`` | ||
| 66 | + Observation name. | ||
| 67 | + | ||
| 65 | ``(caldb = "") [string]`` | 68 | ``(caldb = "") [string]`` |
| 66 | Calibration database. | 69 | Calibration database. |
| 67 | 70 |