Commit 49bfb301c17bb49dce2503ae60a9bf3c95dd1a15
1 parent
2152fc74
Add maximal pointing definition file for maximal csobsdef test coverage (#1828)
Showing
4 changed files
with
19 additions
and
19 deletions
cscripts/Makefile.am
| @@ -129,7 +129,8 @@ testdata = $(top_srcdir)/test/data/crab.xml \ | @@ -129,7 +129,8 @@ testdata = $(top_srcdir)/test/data/crab.xml \ | ||
| 129 | $(top_srcdir)/test/data/tsmap_0.fits \ | 129 | $(top_srcdir)/test/data/tsmap_0.fits \ |
| 130 | $(top_srcdir)/test/data/tsmap_1.fits \ | 130 | $(top_srcdir)/test/data/tsmap_1.fits \ |
| 131 | $(top_srcdir)/test/data/exclusion.reg \ | 131 | $(top_srcdir)/test/data/exclusion.reg \ |
| 132 | - $(top_srcdir)/test/data/pntdef.dat \ | 132 | + $(top_srcdir)/test/data/pntdef_minimal.dat \ |
| 133 | + $(top_srcdir)/test/data/pntdef_maximal.dat \ | ||
| 133 | $(top_srcdir)/test/data/models.txt \ | 134 | $(top_srcdir)/test/data/models.txt \ |
| 134 | $(top_srcdir)/test/data/tsmaps.txt \ | 135 | $(top_srcdir)/test/data/tsmaps.txt \ |
| 135 | $(top_srcdir)/test/data/model_cube_background.xml \ | 136 | $(top_srcdir)/test/data/model_cube_background.xml \ |
test/data/pntdef_maximal.dat
0 → 100644
test/data/pntdef.dat renamed to test/data/pntdef_minimal.dat
test/test_csobsdef.py
| @@ -43,7 +43,8 @@ class Test(test): | @@ -43,7 +43,8 @@ class Test(test): | ||
| 43 | test.__init__(self) | 43 | test.__init__(self) |
| 44 | 44 | ||
| 45 | # Set members | 45 | # Set members |
| 46 | - self._pntdef = self._datadir + '/pntdef.dat' | 46 | + self._pntdef_min = self._datadir + '/pntdef_minimal.dat' |
| 47 | + self._pntdef_max = self._datadir + '/pntdef_maximal.dat' | ||
| 47 | 48 | ||
| 48 | # Return | 49 | # Return |
| 49 | return | 50 | return |
| @@ -72,7 +73,7 @@ class Test(test): | @@ -72,7 +73,7 @@ class Test(test): | ||
| 72 | csobsdef = self._script('csobsdef') | 73 | csobsdef = self._script('csobsdef') |
| 73 | 74 | ||
| 74 | # Setup csobsdef command | 75 | # Setup csobsdef command |
| 75 | - cmd = csobsdef+' inpnt="'+self._pntdef+'"'+ \ | 76 | + cmd = csobsdef+' inpnt="'+self._pntdef_min+'"'+ \ |
| 76 | ' outobs="csobsdef_cmd1.xml"'+ \ | 77 | ' outobs="csobsdef_cmd1.xml"'+ \ |
| 77 | ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ | 78 | ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ |
| 78 | ' emin=0.1 emax=100.0 duration=1800.0 rad=5.0'+ \ | 79 | ' emin=0.1 emax=100.0 duration=1800.0 rad=5.0'+ \ |
| @@ -108,9 +109,9 @@ class Test(test): | @@ -108,9 +109,9 @@ class Test(test): | ||
| 108 | """ | 109 | """ |
| 109 | Test csobsdef from Python | 110 | Test csobsdef from Python |
| 110 | """ | 111 | """ |
| 111 | - # Set-up csobsdef | 112 | + # Set-up csobsdef with minimal pointing definition file |
| 112 | obsdef = cscripts.csobsdef() | 113 | obsdef = cscripts.csobsdef() |
| 113 | - obsdef['inpnt'] = self._pntdef | 114 | + obsdef['inpnt'] = self._pntdef_min |
| 114 | obsdef['outobs'] = 'csobsdef_py1.xml' | 115 | obsdef['outobs'] = 'csobsdef_py1.xml' |
| 115 | obsdef['caldb'] = self._caldb | 116 | obsdef['caldb'] = self._caldb |
| 116 | obsdef['irf'] = self._irf | 117 | obsdef['irf'] = self._irf |
| @@ -129,16 +130,10 @@ class Test(test): | @@ -129,16 +130,10 @@ class Test(test): | ||
| 129 | # Check model file | 130 | # Check model file |
| 130 | self._check_obsdef_file('csobsdef_py1.xml') | 131 | self._check_obsdef_file('csobsdef_py1.xml') |
| 131 | 132 | ||
| 132 | - # Set-up csobsdef | 133 | + # Set-up csobsdef with maximal pointing definition file |
| 133 | obsdef = cscripts.csobsdef() | 134 | obsdef = cscripts.csobsdef() |
| 134 | - obsdef['inpnt'] = self._pntdef | 135 | + obsdef['inpnt'] = self._pntdef_max |
| 135 | obsdef['outobs'] = 'csobsdef_py2.xml' | 136 | obsdef['outobs'] = 'csobsdef_py2.xml' |
| 136 | - obsdef['caldb'] = self._caldb | ||
| 137 | - obsdef['irf'] = self._irf | ||
| 138 | - obsdef['emin'] = 0.1 | ||
| 139 | - obsdef['emax'] = 100.0 | ||
| 140 | - obsdef['duration'] = 1800.0 | ||
| 141 | - obsdef['rad'] = 5.0 | ||
| 142 | obsdef['logfile'] = 'csobsdef_py2.log' | 137 | obsdef['logfile'] = 'csobsdef_py2.log' |
| 143 | obsdef['chatter'] = 3 | 138 | obsdef['chatter'] = 3 |
| 144 | 139 | ||
| @@ -149,7 +144,7 @@ class Test(test): | @@ -149,7 +144,7 @@ class Test(test): | ||
| 149 | self._check_obsdef_file('csobsdef_py2.xml') | 144 | self._check_obsdef_file('csobsdef_py2.xml') |
| 150 | 145 | ||
| 151 | # Load CSV table | 146 | # Load CSV table |
| 152 | - csv = gammalib.GCsv(self._pntdef, ',') | 147 | + csv = gammalib.GCsv(self._pntdef_min, ',') |
| 153 | 148 | ||
| 154 | # Set-up csobsdef | 149 | # Set-up csobsdef |
| 155 | obsdef = cscripts.csobsdef() | 150 | obsdef = cscripts.csobsdef() |
| @@ -190,15 +185,15 @@ class Test(test): | @@ -190,15 +185,15 @@ class Test(test): | ||
| 190 | self.test_value(o.instrument(), 'CTA', | 185 | self.test_value(o.instrument(), 'CTA', |
| 191 | 'Check for "CTA" instrument') | 186 | 'Check for "CTA" instrument') |
| 192 | self.test_value(o.ontime(), 1800.0, 1.0e-6, | 187 | self.test_value(o.ontime(), 1800.0, 1.0e-6, |
| 193 | - 'Check for ontime of 1800 sec') | 188 | + 'Check for ontime') |
| 194 | self.test_value(o.deadc(), 0.95, 1.0e-6, | 189 | self.test_value(o.deadc(), 0.95, 1.0e-6, |
| 195 | - 'Check for deadtime correction of 0.95') | 190 | + 'Check for deadtime correction') |
| 196 | self.test_value(o.events().ebounds().emin().TeV(), 0.1, 1.0e-6, | 191 | self.test_value(o.events().ebounds().emin().TeV(), 0.1, 1.0e-6, |
| 197 | - 'Check for minimum energy of 0.1 TeV') | 192 | + 'Check for minimum energy') |
| 198 | self.test_value(o.events().ebounds().emax().TeV(), 100.0, 1.0e-6, | 193 | self.test_value(o.events().ebounds().emax().TeV(), 100.0, 1.0e-6, |
| 199 | - 'Check for maximum energy of 100 TeV') | 194 | + 'Check for maximum energy') |
| 200 | self.test_value(o.roi().radius(), 5.0, 1.0e-6, | 195 | self.test_value(o.roi().radius(), 5.0, 1.0e-6, |
| 201 | - 'Check for ROI radois of 5 deg') | 196 | + 'Check for ROI radius') |
| 202 | 197 | ||
| 203 | # Return | 198 | # Return |
| 204 | return | 199 | return |