Commit 4cf2e59ef455b0129ed6406690192a9813d463ca

Authored by Jürgen Knödlseder
1 parent 357f7fae

Update Crab test dataset.

The Crab test event data are now derived from the Prod2 South_0.5h IRF with an offset angle of 0.5 deg and a simulation radius of 3 deg.
cscripts/Makefile.am
@@ -175,7 +175,7 @@ testdata = $(top_srcdir)/test/data/crab.xml \ @@ -175,7 +175,7 @@ testdata = $(top_srcdir)/test/data/crab.xml \
175 $(top_srcdir)/test/data/pntdef_maximal.dat \ 175 $(top_srcdir)/test/data/pntdef_maximal.dat \
176 $(top_srcdir)/test/data/models.txt \ 176 $(top_srcdir)/test/data/models.txt \
177 $(top_srcdir)/test/data/tsmaps.txt \ 177 $(top_srcdir)/test/data/tsmaps.txt \
178 - $(top_srcdir)/test/data/model_cube_background.xml \ 178 + $(top_srcdir)/test/data/model_cube_background1.xml \
179 $(top_srcdir)/test/data/model_cube_background2.xml \ 179 $(top_srcdir)/test/data/model_cube_background2.xml \
180 $(top_srcdir)/test/data/crab_bkgcube.xml \ 180 $(top_srcdir)/test/data/crab_bkgcube.xml \
181 $(top_srcdir)/test/data/irf.root \ 181 $(top_srcdir)/test/data/irf.root \
examples/make_ts_distributions.py
@@ -111,11 +111,10 @@ def make_ts_distribution(): @@ -111,11 +111,10 @@ def make_ts_distribution():
111 111
112 # Loop over energy bands. The energy bands are those that are also 112 # Loop over energy bands. The energy bands are those that are also
113 # used for sensitivity computation. 113 # used for sensitivity computation.
114 - for ieng in range(20): 114 + for ieng in range(18):
115 115
116 # Set energies 116 # Set energies
117 - loge = -1.7 + ieng * 0.2  
118 - #emean = pow(10.0, loge) 117 + loge = -1.3 + ieng * 0.2
119 emin = pow(10.0, loge-0.1) 118 emin = pow(10.0, loge-0.1)
120 emax = pow(10.0, loge+0.1) 119 emax = pow(10.0, loge+0.1)
121 if loge < 0: 120 if loge < 0:
test/data/crab.xml
@@ -11,14 +11,11 @@ @@ -11,14 +11,11 @@
11 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/> 11 <parameter name="DEC" scale="1.0" value="22.0145" min="-90" max="90" free="0"/>
12 </spatialModel> 12 </spatialModel>
13 </source> 13 </source>
14 - <source name="Background" type="RadialAcceptance" instrument="CTA">  
15 - <spectrum type="PowerLaw">  
16 - <parameter name="Prefactor" scale="1e-6" value="61.8" min="0.0" max="1000.0" free="1"/>  
17 - <parameter name="Index" scale="-1" value="1.85" min="0.0" max="+5.0" free="1"/>  
18 - <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/> 14 + <source name="CTABackgroundModel" type="CTAIrfBackground" instrument="CTA">
  15 + <spectrum type="PowerLaw">
  16 + <parameter name="Prefactor" scale="1.0" value="1.0" min="1e-3" max="1e+3" free="1"/>
  17 + <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
  18 + <parameter name="PivotEnergy" scale="1e6" value="1.0" min="0.01" max="1000.0" free="0"/>
19 </spectrum> 19 </spectrum>
20 - <radialModel type="Gaussian">  
21 - <parameter name="Sigma" scale="1.0" value="3.0" min="0.01" max="10.0" free="1"/>  
22 - </radialModel>  
23 - </source> 20 + </source>
24 </source_library> 21 </source_library>
test/data/crab_events.fits.gz
No preview for this file type
test/data/model_cube_background.xml renamed to test/data/model_cube_background1.xml
1 <?xml version="1.0" standalone="no"?> 1 <?xml version="1.0" standalone="no"?>
2 <source_library title="source library"> 2 <source_library title="source library">
3 - <source name="CTABackgroundModel" type="CTACubeBackground" instrument="CTA"> 3 + <source name="CTABackgroundModel1" type="CTACubeBackground" instrument="CTA">
4 <spectrum type="PowerLaw"> 4 <spectrum type="PowerLaw">
5 <parameter name="Prefactor" scale="1.0" value="1.0" min="1e-3" max="1e+3" free="1"/> 5 <parameter name="Prefactor" scale="1.0" value="1.0" min="1e-3" max="1e+3" free="1"/>
6 <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/> 6 <parameter name="Index" scale="1.0" value="0.0" min="-5.0" max="+5.0" free="1"/>
test/data/model_temporal_phasecurve.xml
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 </spatialModel> 12 </spatialModel>
13 <temporal type="PhaseCurve" file="model_temporal_phasecurve.fits"> 13 <temporal type="PhaseCurve" file="model_temporal_phasecurve.fits">
14 <parameter name="Normalization" scale="1" value="1.0" min="0.0" max="1000.0" free="0"/> 14 <parameter name="Normalization" scale="1" value="1.0" min="0.0" max="1000.0" free="0"/>
15 - <parameter name="MJD" scale="1" value="51544.5" min="0.0" max="100000.0" free="0"/> 15 + <parameter name="MJD" scale="1" value="58849.0" min="0.0" max="100000.0" free="0"/>
16 <parameter name="Phase" scale="1" value="0.0" min="0.0" max="1.0" free="0"/> 16 <parameter name="Phase" scale="1" value="0.0" min="0.0" max="1.0" free="0"/>
17 <parameter name="F0" scale="1" value="1.0" min="0.0" max="1000.0" free="0"/> 17 <parameter name="F0" scale="1" value="1.0" min="0.0" max="1000.0" free="0"/>
18 <parameter name="F1" scale="1" value="0.1" min="0.0" max="1000.0" free="0"/> 18 <parameter name="F1" scale="1" value="0.1" min="0.0" max="1000.0" free="0"/>
test/data/models.txt
1 -model_cube_background.xml 1 +model_cube_background1.xml
2 model_cube_background2.xml 2 model_cube_background2.xml
test/test_cslightcrv.py
@@ -76,8 +76,9 @@ class Test(test): @@ -76,8 +76,9 @@ class Test(test):
76 cmd = cslightcrv+' inobs="'+self._events+'"'+ \ 76 cmd = cslightcrv+' inobs="'+self._events+'"'+ \
77 ' inmodel="'+self._model+'" srcname="Crab"'+ \ 77 ' inmodel="'+self._model+'" srcname="Crab"'+ \
78 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ 78 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
79 - ' tbinalg="LIN" tmin="MJD 51544.50" tmax="MJD 51544.53"'+ \  
80 - ' tbins=3 method="3D" enumbins=0 emin=0.1 emax=100.0'+ \ 79 + ' tbinalg=LIN '+ \
  80 + ' tmin=2020-01-01T00:00:00 tmax=2020-01-01T00:30:00'+ \
  81 + ' tbins=3 method=3D enumbins=0 emin=0.1 emax=100.0'+ \
81 ' outfile="lightcurve_cmd1.fits"'+ \ 82 ' outfile="lightcurve_cmd1.fits"'+ \
82 ' logfile="cslightcrv_cmd1.log" chatter=1' 83 ' logfile="cslightcrv_cmd1.log" chatter=1'
83 84
@@ -90,14 +91,15 @@ class Test(test): @@ -90,14 +91,15 @@ class Test(test):
90 'Check successful execution from command line') 91 'Check successful execution from command line')
91 92
92 # Check light curve 93 # Check light curve
93 - self._check_light_curve('lightcurve_cmd1.fits', 3, 1.6e-16) 94 + self._check_light_curve('lightcurve_cmd1.fits', 3)
94 95
95 # Setup cslightcrv command 96 # Setup cslightcrv command
96 cmd = cslightcrv+' inobs="events_that_do_not_exist.fits"'+ \ 97 cmd = cslightcrv+' inobs="events_that_do_not_exist.fits"'+ \
97 ' inmodel="'+self._model+'" srcname="Crab"'+ \ 98 ' inmodel="'+self._model+'" srcname="Crab"'+ \
98 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ 99 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
99 - ' tbinalg="LIN" tmin="MJD 51544.50" tmax="MJD 51544.53"'+ \  
100 - ' tbins=3 method="3D" enumbins=0 emin=0.1 emax=100.0'+ \ 100 + ' tbinalg=LIN '+ \
  101 + ' tmin=2020-01-01T00:00:00 tmax=2020-01-01T00:30:00'+ \
  102 + ' tbins=3 method=3D enumbins=0 emin=0.1 emax=100.0'+ \
101 ' outfile="lightcurve_cmd1.fits"'+ \ 103 ' outfile="lightcurve_cmd1.fits"'+ \
102 ' logfile="cslightcrv_cmd2.log" debug=yes' 104 ' logfile="cslightcrv_cmd2.log" debug=yes'
103 105
@@ -124,8 +126,8 @@ class Test(test): @@ -124,8 +126,8 @@ class Test(test):
124 lcrv['caldb'] = self._caldb 126 lcrv['caldb'] = self._caldb
125 lcrv['irf'] = self._irf 127 lcrv['irf'] = self._irf
126 lcrv['tbinalg'] = 'LIN' 128 lcrv['tbinalg'] = 'LIN'
127 - lcrv['tmin'] = 'MJD 51544.50'  
128 - lcrv['tmax'] = 'MJD 51544.53' 129 + lcrv['tmin'] = '2020-01-01T00:00:00'
  130 + lcrv['tmax'] = '2020-01-01T00:30:00'
129 lcrv['tbins'] = 3 131 lcrv['tbins'] = 3
130 lcrv['method'] = '3D' 132 lcrv['method'] = '3D'
131 lcrv['enumbins'] = 0 133 lcrv['enumbins'] = 0
@@ -142,14 +144,14 @@ class Test(test): @@ -142,14 +144,14 @@ class Test(test):
142 lcrv.save() 144 lcrv.save()
143 145
144 # Check light curve 146 # Check light curve
145 - self._check_light_curve('cslightcrv_py1.fits', 3, 1.6e-16) 147 + self._check_light_curve('cslightcrv_py1.fits', 3)
146 148
147 # Now use FILE as time bin algorithm. For this we need first to 149 # Now use FILE as time bin algorithm. For this we need first to
148 # create an ASCII file. We use now 6 time bins. The ASCII file 150 # create an ASCII file. We use now 6 time bins. The ASCII file
149 # is saved into the file "lightcurve_py2.dat". 151 # is saved into the file "lightcurve_py2.dat".
150 csv = gammalib.GCsv(2,2) 152 csv = gammalib.GCsv(2,2)
151 - tmin = 51544.50  
152 - tdelta = 0.01 153 + tmin = 58849.00
  154 + tdelta = 0.0104166
153 for i in range(csv.nrows()): 155 for i in range(csv.nrows()):
154 csv[i,0] = '%.5f' % (tmin + i * tdelta) 156 csv[i,0] = '%.5f' % (tmin + i * tdelta)
155 csv[i,1] = '%.5f' % (tmin + (i+1) * tdelta) 157 csv[i,1] = '%.5f' % (tmin + (i+1) * tdelta)
@@ -177,7 +179,7 @@ class Test(test): @@ -177,7 +179,7 @@ class Test(test):
177 lcrv.execute() 179 lcrv.execute()
178 180
179 # Check light curve 181 # Check light curve
180 - self._check_light_curve('cslightcrv_py2.fits', 2, 1.6e-16) 182 + self._check_light_curve('cslightcrv_py2.fits', 2)
181 183
182 # Now we setup an observation container on input. We attached the 184 # Now we setup an observation container on input. We attached the
183 # model to the observation container so that cslightcrv should 185 # model to the observation container so that cslightcrv should
@@ -206,7 +208,7 @@ class Test(test): @@ -206,7 +208,7 @@ class Test(test):
206 lcrv.execute() 208 lcrv.execute()
207 209
208 # Check light curve 210 # Check light curve
209 - self._check_light_curve('cslightcrv_py3.fits', 1, 1.6e-16) 211 + self._check_light_curve('cslightcrv_py3.fits', 1)
210 212
211 # Binned cslightcrv 213 # Binned cslightcrv
212 lcrv = cscripts.cslightcrv() 214 lcrv = cscripts.cslightcrv()
@@ -216,8 +218,8 @@ class Test(test): @@ -216,8 +218,8 @@ class Test(test):
216 lcrv['caldb'] = self._caldb 218 lcrv['caldb'] = self._caldb
217 lcrv['irf'] = self._irf 219 lcrv['irf'] = self._irf
218 lcrv['tbinalg'] = 'LIN' 220 lcrv['tbinalg'] = 'LIN'
219 - lcrv['tmin'] = 'MJD 51544.50'  
220 - lcrv['tmax'] = 'MJD 51544.53' 221 + lcrv['tmin'] = '2020-01-01T00:00:00'
  222 + lcrv['tmax'] = '2020-01-01T00:30:00'
221 lcrv['tbins'] = 2 223 lcrv['tbins'] = 2
222 lcrv['method'] = '3D' 224 lcrv['method'] = '3D'
223 lcrv['emin'] = 0.1 225 lcrv['emin'] = 0.1
@@ -238,7 +240,7 @@ class Test(test): @@ -238,7 +240,7 @@ class Test(test):
238 lcrv.execute() 240 lcrv.execute()
239 241
240 # Check light curve 242 # Check light curve
241 - self._check_light_curve('cslightcrv_py4.fits', 2, 1.6e-16) 243 + self._check_light_curve('cslightcrv_py4.fits', 2)
242 244
243 # cslightcrv with classical analysis 245 # cslightcrv with classical analysis
244 lcrv = cscripts.cslightcrv() 246 lcrv = cscripts.cslightcrv()
@@ -268,13 +270,13 @@ class Test(test): @@ -268,13 +270,13 @@ class Test(test):
268 lcrv.execute() 270 lcrv.execute()
269 271
270 # Check light curve 272 # Check light curve
271 - self._check_light_curve('cslightcrv_py5.fits', 2, 6.e-16) 273 + self._check_light_curve('cslightcrv_py5.fits', 2)
272 274
273 # Return 275 # Return
274 return 276 return
275 277
276 # Check light curve result file 278 # Check light curve result file
277 - def _check_light_curve(self, filename, bins,pref): 279 + def _check_light_curve(self, filename, bins, prefactor=5.7e-16):
278 """ 280 """
279 Check light curve file 281 Check light curve file
280 """ 282 """
@@ -304,13 +306,11 @@ class Test(test): @@ -304,13 +306,11 @@ class Test(test):
304 self.test_assert(table.contains(col), 306 self.test_assert(table.contains(col),
305 'FITS file contains "'+col+'" column') 307 'FITS file contains "'+col+'" column')
306 308
307 - # Check that table has been filled  
308 - # Prefactor has right order of magnitude 309 + # Check that the Prefactor has the right order of magnitude
309 for s in range(table.nrows()): 310 for s in range(table.nrows()):
310 - self.test_value(table['Prefactor'][s], pref, 0.2*pref, 311 + self.test_value(table['Prefactor'][s], prefactor, 0.2*prefactor,
311 'Check prefactor value') 312 'Check prefactor value')
312 313
313 -  
314 # Close FITS file 314 # Close FITS file
315 fits.close() 315 fits.close()
316 316
test/test_csmodelmerge.py
@@ -44,7 +44,7 @@ class Test(test): @@ -44,7 +44,7 @@ class Test(test):
44 44
45 # Set members 45 # Set members
46 self._model1 = self._datadir + '/crab.xml' 46 self._model1 = self._datadir + '/crab.xml'
47 - self._model2 = self._datadir + '/model_cube_background.xml' 47 + self._model2 = self._datadir + '/model_cube_background1.xml'
48 self._model3 = self._datadir + '/model_cube_background*.xml' 48 self._model3 = self._datadir + '/model_cube_background*.xml'
49 self._model4 = '@' + self._datadir + '/models.txt' 49 self._model4 = '@' + self._datadir + '/models.txt'
50 50
test/test_csspec.py
@@ -49,6 +49,7 @@ class Test(test): @@ -49,6 +49,7 @@ class Test(test):
49 self._psfcube = self._datadir + '/crab_psfcube.fits' 49 self._psfcube = self._datadir + '/crab_psfcube.fits'
50 self._edispcube = self._datadir + '/crab_edispcube.fits' 50 self._edispcube = self._datadir + '/crab_edispcube.fits'
51 self._bkgcube = self._datadir + '/crab_bkgcube.fits' 51 self._bkgcube = self._datadir + '/crab_bkgcube.fits'
  52 + self._bkgmodel = self._datadir + '/crab_bkgcube.xml'
52 self._onoff_model = self._datadir + '/onoff_model.xml' 53 self._onoff_model = self._datadir + '/onoff_model.xml'
53 54
54 # Return 55 # Return
@@ -146,14 +147,14 @@ class Test(test): @@ -146,14 +147,14 @@ class Test(test):
146 # Check result file 147 # Check result file
147 self._check_result_file('csspec_py1.fits', 5) 148 self._check_result_file('csspec_py1.fits', 5)
148 149
149 - # Set-up binned csspec 150 + # Set-up stacked csspec
150 spec = cscripts.csspec() 151 spec = cscripts.csspec()
151 spec['inobs'] = self._inobs 152 spec['inobs'] = self._inobs
152 spec['expcube'] = self._expcube 153 spec['expcube'] = self._expcube
153 spec['psfcube'] = self._psfcube 154 spec['psfcube'] = self._psfcube
154 spec['edispcube'] = self._edispcube 155 spec['edispcube'] = self._edispcube
155 spec['bkgcube'] = self._bkgcube 156 spec['bkgcube'] = self._bkgcube
156 - spec['inmodel'] = self._model 157 + spec['inmodel'] = self._bkgmodel
157 spec['srcname'] = 'Crab' 158 spec['srcname'] = 'Crab'
158 spec['method'] = 'AUTO' 159 spec['method'] = 'AUTO'
159 spec['ebinalg'] = 'LOG' 160 spec['ebinalg'] = 'LOG'
test/test_cstsdist.py
@@ -145,7 +145,7 @@ class Test(test): @@ -145,7 +145,7 @@ class Test(test):
145 return 145 return
146 146
147 # Check result file 147 # Check result file
148 - def _check_result_file(self, filename, ncols=11): 148 + def _check_result_file(self, filename, ncols=9):
149 """ 149 """
150 Check result file 150 Check result file
151 151
test/test_csworkflow.py
@@ -146,13 +146,11 @@ class Test(test): @@ -146,13 +146,11 @@ class Test(test):
146 self.test_value(models['Crab'][2].value(), 146 self.test_value(models['Crab'][2].value(),
147 5.71055e-16, 1.0e-5, 'Crab prefactor') 147 5.71055e-16, 1.0e-5, 'Crab prefactor')
148 self.test_value(models['Crab'][3].value(), 148 self.test_value(models['Crab'][3].value(),
149 - -2.463392, 1.0e-5, 'Crab index')  
150 - self.test_value(models['Background'][0].value(),  
151 - 3.008828, 1.0e-5, 'Background model sigma')  
152 - self.test_value(models['Background'][1].value(),  
153 - 6.27131e-05, 1.0e-5, 'Background model prefactor')  
154 - self.test_value(models['Background'][2].value(),  
155 - -1.833184, 1.0e-5, 'Background model index') 149 + -2.46174095362681, 1.0e-5, 'Crab index')
  150 + self.test_value(models['CTABackgroundModel'][0].value(),
  151 + 1.01831847752743, 1.0e-5, 'Background model prefactor')
  152 + self.test_value(models['CTABackgroundModel'][1].value(),
  153 + 0.00742512418279459, 1.0e-5, 'Background model index')
156 154
157 # Return 155 # Return
158 return 156 return
test/test_ctbin.py
@@ -87,7 +87,7 @@ class Test(test): @@ -87,7 +87,7 @@ class Test(test):
87 87
88 # Load counts cube and check content. 88 # Load counts cube and check content.
89 evt = gammalib.GCTAEventCube('cntmap_cmd1.fits') 89 evt = gammalib.GCTAEventCube('cntmap_cmd1.fits')
90 - self._check_cube(evt, 5542) 90 + self._check_cube(evt, 18483)
91 91
92 # Setup ctbin command 92 # Setup ctbin command
93 cmd = ctbin+' inobs="events_that_do_not_exist.fits"'+ \ 93 cmd = ctbin+' inobs="events_that_do_not_exist.fits"'+ \
@@ -115,7 +115,7 @@ class Test(test): @@ -115,7 +115,7 @@ class Test(test):
115 115
116 # Load counts cube and check content. 116 # Load counts cube and check content.
117 evt = gammalib.GCTAEventCube('cntmap_cmd3.fits') 117 evt = gammalib.GCTAEventCube('cntmap_cmd3.fits')
118 - self._check_cube(evt, 890) 118 + self._check_cube(evt, 3689)
119 119
120 # Check ctbin --help 120 # Check ctbin --help
121 self._check_help(ctbin) 121 self._check_help(ctbin)
@@ -174,15 +174,15 @@ class Test(test): @@ -174,15 +174,15 @@ class Test(test):
174 binning.run() 174 binning.run()
175 175
176 # Check content of observation container and counts cube 176 # Check content of observation container and counts cube
177 - self._check_observation(binning, 5542)  
178 - self._check_cube(binning.cube(), 5542) 177 + self._check_observation(binning, 18483)
  178 + self._check_cube(binning.cube(), 18483)
179 179
180 # Copy ctbin tool 180 # Copy ctbin tool
181 cpy_bin = binning.copy() 181 cpy_bin = binning.copy()
182 182
183 # Check content of observation container and counts cube 183 # Check content of observation container and counts cube
184 - self._check_observation(cpy_bin, 5542)  
185 - self._check_cube(cpy_bin.cube(), 5542) 184 + self._check_observation(cpy_bin, 18483)
  185 + self._check_cube(cpy_bin.cube(), 18483)
186 186
187 # Run copy of ctbin tool again 187 # Run copy of ctbin tool again
188 cpy_bin['logfile'] = 'ctbin_py2.log' 188 cpy_bin['logfile'] = 'ctbin_py2.log'
@@ -201,7 +201,7 @@ class Test(test): @@ -201,7 +201,7 @@ class Test(test):
201 201
202 # Load counts cube and check content 202 # Load counts cube and check content
203 evt = gammalib.GCTAEventCube('ctbin_py1.fits') 203 evt = gammalib.GCTAEventCube('ctbin_py1.fits')
204 - self._check_cube(evt, 5542) 204 + self._check_cube(evt, 18483)
205 205
206 # Now clear ctbin tool 206 # Now clear ctbin tool
207 binning.clear() 207 binning.clear()
@@ -241,12 +241,12 @@ class Test(test): @@ -241,12 +241,12 @@ class Test(test):
241 241
242 # Check content of observation and cube (need multiplier=3 since 242 # Check content of observation and cube (need multiplier=3 since
243 # three identical observations have been appended) 243 # three identical observations have been appended)
244 - self._check_observation(binning, 5542, multiplier=3)  
245 - self._check_cube(binning.cube(), 5542, multiplier=3) 244 + self._check_observation(binning, 18483, multiplier=3)
  245 + self._check_cube(binning.cube(), 18483, multiplier=3)
246 246
247 # Load counts cube and check content. 247 # Load counts cube and check content.
248 evt = gammalib.GCTAEventCube('ctbin_py3.fits') 248 evt = gammalib.GCTAEventCube('ctbin_py3.fits')
249 - self._check_cube(evt, 5542, multiplier=3) 249 + self._check_cube(evt, 18483, multiplier=3)
250 250
251 # And finally go for a fully Pythonic version with all parameters 251 # And finally go for a fully Pythonic version with all parameters
252 # being specified in a dictionary 252 # being specified in a dictionary
@@ -262,7 +262,7 @@ class Test(test): @@ -262,7 +262,7 @@ class Test(test):
262 262
263 # Load counts cube and check content 263 # Load counts cube and check content
264 evt = gammalib.GCTAEventCube('ctbin_py4.fits') 264 evt = gammalib.GCTAEventCube('ctbin_py4.fits')
265 - self._check_cube(evt, 5542) 265 + self._check_cube(evt, 18483)
266 266
267 # Return 267 # Return
268 return 268 return
@@ -290,11 +290,11 @@ class Test(test): @@ -290,11 +290,11 @@ class Test(test):
290 'Check that the one observation is a CTA observation') 290 'Check that the one observation is a CTA observation')
291 self.test_value(obs.ontime(), 1800.0*multiplier, 1.0e-6, 291 self.test_value(obs.ontime(), 1800.0*multiplier, 1.0e-6,
292 'Check ontime of observation') 292 'Check ontime of observation')
293 - self.test_value(obs.livetime(), 1710.0*multiplier, 1.0e-6, 293 + self.test_value(obs.livetime(), 1764.0*multiplier, 1.0e-6,
294 'Check livetime of observation') 294 'Check livetime of observation')
295 self.test_value(pnt.dir().ra_deg(), 83.63, 1.0e-6, 295 self.test_value(pnt.dir().ra_deg(), 83.63, 1.0e-6,
296 'Check pointing Right Ascension of observation') 296 'Check pointing Right Ascension of observation')
297 - self.test_value(pnt.dir().dec_deg(), 22.01, 1.0e-6, 297 + self.test_value(pnt.dir().dec_deg(), 22.51, 1.0e-6,
298 'Check pointing Declination of observation') 298 'Check pointing Declination of observation')
299 299
300 # Test event cube 300 # Test event cube
test/test_cterror.py
@@ -263,26 +263,30 @@ class Test(test): @@ -263,26 +263,30 @@ class Test(test):
263 263
264 # If there are models in the container then check them 264 # If there are models in the container then check them
265 if nmodels > 0: 265 if nmodels > 0:
266 - self.test_value(models['Crab']['Prefactor'].value(), 1.58907e-16,  
267 - 1.0e-3, 'Check fitted Crab Prefactor')  
268 - self.test_value(models['Crab']['Prefactor'].error(), 0.0529105e-16,  
269 - 1.0e-3, 'Check Crab Prefactor error')  
270 - self.test_value(models['Crab']['Index'].value(), -2.43549,  
271 - 1.0e-3, 'Check fitted Crab Index')  
272 - self.test_value(models['Crab']['Index'].error(), 0.027804,  
273 - 1.0e-3, 'Check Crab Index error')  
274 - self.test_value(models['Background']['Prefactor'].value(), 61.6919e-6,  
275 - 1.0e-3, 'Check fitted background Prefactor')  
276 - self.test_value(models['Background']['Prefactor'].error(), 1.49438e-6,  
277 - 1.0e-3, 'Check background Prefactor error')  
278 - self.test_value(models['Background']['Index'].value(), -2.20535,  
279 - 1.0e-3, 'Check fitted background Index')  
280 - self.test_value(models['Background']['Index'].error(), 0.0113269,  
281 - 1.0e-3, 'Check background Index error')  
282 - self.test_value(models['Background']['Sigma'].value(), 3.04252,  
283 - 1.0e-3, 'Check fitted background Sigma')  
284 - self.test_value(models['Background']['Sigma'].error(), 0.0307008,  
285 - 1.0e-3, 'Check background Sigma error') 266 + self.test_value(models['Crab']['Prefactor'].value(),
  267 + 5.767533e-16, 1.0e-4 * 5.767533e-16,
  268 + 'Check fitted Crab Prefactor')
  269 + self.test_value(models['Crab']['Prefactor'].error(),
  270 + 1.011887e-17, 1.0e-4 * 1.011887e-17,
  271 + 'Check Crab Prefactor error')
  272 + self.test_value(models['Crab']['Index'].value(),
  273 + -2.462279, 1.0e-4 * 2.462279,
  274 + 'Check fitted Crab Index')
  275 + self.test_value(models['Crab']['Index'].error(),
  276 + 0.0148518, 1.0e-4 * 0.0148518,
  277 + 'Check Crab Index error')
  278 + self.test_value(models['CTABackgroundModel']['Prefactor'].value(),
  279 + 1.0197698, 1.0e-4 * 1.0197698,
  280 + 'Check fitted background Prefactor')
  281 + self.test_value(models['CTABackgroundModel']['Prefactor'].error(),
  282 + 0.013578, 1.0e-4 * 0.013578,
  283 + 'Check background Prefactor error')
  284 + self.test_value(models['CTABackgroundModel']['Index'].value(),
  285 + 0.00836407, 1.0e-4 * 0.00836407,
  286 + 'Check fitted background Index')
  287 + self.test_value(models['CTABackgroundModel']['Index'].error(),
  288 + 0.00811674, 1.0e-4 * 0.00811674,
  289 + 'Check background Index error')
286 290
287 # Return 291 # Return
288 return 292 return
test/test_ctlike.py
@@ -253,26 +253,30 @@ class Test(test): @@ -253,26 +253,30 @@ class Test(test):
253 253
254 # If there are models in the container then check them 254 # If there are models in the container then check them
255 if nmodels > 0: 255 if nmodels > 0:
256 - self.test_value(models['Crab']['Prefactor'].value(), 1.58907e-16,  
257 - 1.0e-3, 'Check fitted Crab Prefactor')  
258 - self.test_value(models['Crab']['Prefactor'].error(), 0.0526982e-16,  
259 - 1.0e-3, 'Check Crab Prefactor error')  
260 - self.test_value(models['Crab']['Index'].value(), -2.43549,  
261 - 1.0e-3, 'Check fitted Crab Index')  
262 - self.test_value(models['Crab']['Index'].error(), 0.0248116,  
263 - 1.0e-3, 'Check Crab Index error')  
264 - self.test_value(models['Background']['Prefactor'].value(), 61.6919e-6,  
265 - 1.0e-3, 'Check fitted background Prefactor')  
266 - self.test_value(models['Background']['Prefactor'].error(), 1.49438e-6,  
267 - 1.0e-3, 'Check background Prefactor error')  
268 - self.test_value(models['Background']['Index'].value(), -2.20535,  
269 - 1.0e-3, 'Check fitted background Index')  
270 - self.test_value(models['Background']['Index'].error(), 0.0113269,  
271 - 1.0e-3, 'Check background Index error')  
272 - self.test_value(models['Background']['Sigma'].value(), 3.04252,  
273 - 1.0e-3, 'Check fitted background Sigma')  
274 - self.test_value(models['Background']['Sigma'].error(), 0.0307008,  
275 - 1.0e-3, 'Check background Sigma error') 256 + self.test_value(models['Crab']['Prefactor'].value(),
  257 + 5.767533e-16, 1.0e-4 * 5.767533e-16,
  258 + 'Check fitted Crab Prefactor')
  259 + self.test_value(models['Crab']['Prefactor'].error(),
  260 + 1.018351e-17, 1.0e-4 * 1.018351e-17,
  261 + 'Check Crab Prefactor error')
  262 + self.test_value(models['Crab']['Index'].value(),
  263 + -2.462279, 1.0e-4 * 2.462279,
  264 + 'Check fitted Crab Index')
  265 + self.test_value(models['Crab']['Index'].error(),
  266 + 0.0151608, 1.0e-4 * 0.0151608,
  267 + 'Check Crab Index error')
  268 + self.test_value(models['CTABackgroundModel']['Prefactor'].value(),
  269 + 1.0197698, 1.0e-4 * 1.0197698,
  270 + 'Check fitted background Prefactor')
  271 + self.test_value(models['CTABackgroundModel']['Prefactor'].error(),
  272 + 0.013578, 1.0e-4 * 0.013578,
  273 + 'Check background Prefactor error')
  274 + self.test_value(models['CTABackgroundModel']['Index'].value(),
  275 + 0.00836407, 1.0e-4 * 0.00836407,
  276 + 'Check fitted background Index')
  277 + self.test_value(models['CTABackgroundModel']['Index'].error(),
  278 + 0.00811674, 1.0e-4 * 0.00811674,
  279 + 'Check background Index error')
276 280
277 # Return 281 # Return
278 return 282 return
test/test_ctobssim.py
@@ -90,7 +90,7 @@ class Test(test): @@ -90,7 +90,7 @@ class Test(test):
90 90
91 # Load counts cube and check content. 91 # Load counts cube and check content.
92 evt = gammalib.GCTAEventList('ctobssim_cmd1.fits') 92 evt = gammalib.GCTAEventList('ctobssim_cmd1.fits')
93 - self._test_list(evt, 7105) 93 + self._test_list(evt, 23822)
94 94
95 # Setup ctobssim command 95 # Setup ctobssim command
96 cmd = ctobssim+' inmodel="model_that_does_not_exist.xml"'+ \ 96 cmd = ctobssim+' inmodel="model_that_does_not_exist.xml"'+ \
@@ -156,14 +156,14 @@ class Test(test): @@ -156,14 +156,14 @@ class Test(test):
156 156
157 # Check content of observation 157 # Check content of observation
158 self._test_observation(sim) 158 self._test_observation(sim)
159 - self._test_list(sim.obs()[0].events(), 7105) 159 + self._test_list(sim.obs()[0].events(), 23822)
160 160
161 # Save events 161 # Save events
162 sim.save() 162 sim.save()
163 163
164 # Load counts cube and check content. 164 # Load counts cube and check content.
165 evt = gammalib.GCTAEventList('ctobssim_py1.fits') 165 evt = gammalib.GCTAEventList('ctobssim_py1.fits')
166 - self._test_list(evt, 7105) 166 + self._test_list(evt, 23822)
167 167
168 # Set-up observation container 168 # Set-up observation container
169 pnts = [{'ra': 83.63, 'dec': 21.01}, 169 pnts = [{'ra': 83.63, 'dec': 21.01},
@@ -191,10 +191,10 @@ class Test(test): @@ -191,10 +191,10 @@ class Test(test):
191 191
192 # Retrieve observation and check content 192 # Retrieve observation and check content
193 self._test_observation(sim, nobs=4, pnts=pnts) 193 self._test_observation(sim, nobs=4, pnts=pnts)
194 - self._test_list(sim.obs()[0].events(), 6199)  
195 - self._test_list(sim.obs()[1].events(), 6305)  
196 - self._test_list(sim.obs()[2].events(), 6092)  
197 - self._test_list(sim.obs()[3].events(), 6192) 194 + self._test_list(sim.obs()[0].events(), 22904)
  195 + self._test_list(sim.obs()[1].events(), 23130)
  196 + self._test_list(sim.obs()[2].events(), 22672)
  197 + self._test_list(sim.obs()[3].events(), 22549)
198 198
199 # Save events 199 # Save events
200 sim.save() 200 sim.save()
@@ -203,20 +203,20 @@ class Test(test): @@ -203,20 +203,20 @@ class Test(test):
203 obs = gammalib.GObservations('ctobssim_py2.xml') 203 obs = gammalib.GObservations('ctobssim_py2.xml')
204 204
205 # Retrieve observation and check content 205 # Retrieve observation and check content
206 - self._test_list(obs[0].events(), 6199)  
207 - self._test_list(obs[1].events(), 6305)  
208 - self._test_list(obs[2].events(), 6092)  
209 - self._test_list(obs[3].events(), 6192) 206 + self._test_list(obs[0].events(), 22904)
  207 + self._test_list(obs[1].events(), 23130)
  208 + self._test_list(obs[2].events(), 22672)
  209 + self._test_list(obs[3].events(), 22549)
210 210
211 # Copy ctobssim tool 211 # Copy ctobssim tool
212 cpy_sim = sim.copy() 212 cpy_sim = sim.copy()
213 213
214 # Retrieve observation and check content of copy 214 # Retrieve observation and check content of copy
215 self._test_observation(cpy_sim, nobs=4, pnts=pnts) 215 self._test_observation(cpy_sim, nobs=4, pnts=pnts)
216 - self._test_list(cpy_sim.obs()[0].events(), 6199)  
217 - self._test_list(cpy_sim.obs()[1].events(), 6305)  
218 - self._test_list(cpy_sim.obs()[2].events(), 6092)  
219 - self._test_list(cpy_sim.obs()[3].events(), 6192) 216 + self._test_list(cpy_sim.obs()[0].events(), 22904)
  217 + self._test_list(cpy_sim.obs()[1].events(), 23130)
  218 + self._test_list(cpy_sim.obs()[2].events(), 22672)
  219 + self._test_list(cpy_sim.obs()[3].events(), 22549)
220 220
221 # Execute copy of ctobssim tool again, now with a higher chatter 221 # Execute copy of ctobssim tool again, now with a higher chatter
222 # level than before 222 # level than before
@@ -230,10 +230,10 @@ class Test(test): @@ -230,10 +230,10 @@ class Test(test):
230 # Check result file 230 # Check result file
231 obs = gammalib.GObservations('ctobssim_py3.xml') 231 obs = gammalib.GObservations('ctobssim_py3.xml')
232 self.test_value(obs.size(), 4, 'Check for number of observations') 232 self.test_value(obs.size(), 4, 'Check for number of observations')
233 - self._test_list(obs[0].events(), 6199)  
234 - self._test_list(obs[1].events(), 6305)  
235 - self._test_list(obs[2].events(), 6092)  
236 - self._test_list(obs[3].events(), 6192) 233 + self._test_list(obs[0].events(), 22904)
  234 + self._test_list(obs[1].events(), 23130)
  235 + self._test_list(obs[2].events(), 22672)
  236 + self._test_list(obs[3].events(), 22549)
237 237
238 # Return 238 # Return
239 return 239 return
test/test_ctphase.py
@@ -149,7 +149,7 @@ class Test(test): @@ -149,7 +149,7 @@ class Test(test):
149 phase['inobs'] = self._events 149 phase['inobs'] = self._events
150 phase['inmodel'] = 'NONE' 150 phase['inmodel'] = 'NONE'
151 phase['srcname'] = 'NONE' 151 phase['srcname'] = 'NONE'
152 - phase['mjd'] = 51544.5 152 + phase['mjd'] = 58849.0
153 phase['phase'] = 0.0 153 phase['phase'] = 0.0
154 phase['f0'] = 1.0 154 phase['f0'] = 1.0
155 phase['f1'] = 0.1 155 phase['f1'] = 0.1
@@ -187,7 +187,7 @@ class Test(test): @@ -187,7 +187,7 @@ class Test(test):
187 phase['inobs'] = self._events 187 phase['inobs'] = self._events
188 phase['inmodel'] = 'NONE' 188 phase['inmodel'] = 'NONE'
189 phase['srcname'] = 'NONE' 189 phase['srcname'] = 'NONE'
190 - phase['mjd'] = 51500.0 190 + phase['mjd'] = 58860.0
191 phase['phase'] = 0.0 191 phase['phase'] = 0.0
192 phase['f0'] = 1.0 192 phase['f0'] = 1.0
193 phase['f1'] = 0.1 193 phase['f1'] = 0.1
@@ -252,7 +252,7 @@ class Test(test): @@ -252,7 +252,7 @@ class Test(test):
252 return 252 return
253 253
254 # Check result file 254 # Check result file
255 - def _check_result_file(self, filename, nevents=6141): 255 + def _check_result_file(self, filename, nevents=22220):
256 """ 256 """
257 Check result file 257 Check result file
258 258
test/test_ctprob.py
@@ -202,7 +202,7 @@ class Test(test): @@ -202,7 +202,7 @@ class Test(test):
202 return 202 return
203 203
204 # Check result file 204 # Check result file
205 - def _check_result_file(self, filename, nevents=6141): 205 + def _check_result_file(self, filename, nevents=22220):
206 """ 206 """
207 Check result file 207 Check result file
208 208
@@ -220,7 +220,7 @@ class Test(test): @@ -220,7 +220,7 @@ class Test(test):
220 self._check_events(events, nevents=nevents) 220 self._check_events(events, nevents=nevents)
221 221
222 # Check that probability columns exist 222 # Check that probability columns exist
223 - colname1 = 'PROB_Background' 223 + colname1 = 'PROB_CTABackgroundModel'
224 colname2 = 'PROB_Crab' 224 colname2 = 'PROB_Crab'
225 self._check_column(filename, colname1) 225 self._check_column(filename, colname1)
226 self._check_column(filename, colname2) 226 self._check_column(filename, colname2)
@@ -232,7 +232,7 @@ class Test(test): @@ -232,7 +232,7 @@ class Test(test):
232 return 232 return
233 233
234 # Check observation and event list 234 # Check observation and event list
235 - def _check_obs(self, obs, nobs=1, nevents=6141): 235 + def _check_obs(self, obs, nobs=1, nevents=22220):
236 """ 236 """
237 Check observation and event list 237 Check observation and event list
238 238
@@ -257,7 +257,7 @@ class Test(test): @@ -257,7 +257,7 @@ class Test(test):
257 return 257 return
258 258
259 # Check events 259 # Check events
260 - def _check_events(self, events, nevents=6141): 260 + def _check_events(self, events, nevents=22220):
261 """ 261 """
262 Check event list 262 Check event list
263 263
test/test_ctselect.py
@@ -72,8 +72,8 @@ class Test(test): @@ -72,8 +72,8 @@ class Test(test):
72 # Setup ctselect command 72 # Setup ctselect command
73 cmd = ctselect+' inobs="'+self._events+'"'+ \ 73 cmd = ctselect+' inobs="'+self._events+'"'+ \
74 ' outobs="ctselect_cmd1.fits"'+ \ 74 ' outobs="ctselect_cmd1.fits"'+ \
75 - ' ra=83.63 dec=22.01 rad=3.0'+ \  
76 - ' tmin=500.0 tmax=1000.0'+ \ 75 + ' ra=83.63 dec=22.01 rad=2.0'+ \
  76 + ' tmin=2020-01-01T00:08:20 tmax=2020-01-01T00:16:40'+ \
77 ' emin=0.2 emax=80.0'+ \ 77 ' emin=0.2 emax=80.0'+ \
78 ' logfile="ctselect_cmd1.log" chatter=1' 78 ' logfile="ctselect_cmd1.log" chatter=1'
79 79
@@ -91,8 +91,8 @@ class Test(test): @@ -91,8 +91,8 @@ class Test(test):
91 # Setup ctselect command 91 # Setup ctselect command
92 cmd = ctselect+' inobs="event_file_that_does_not_exist.fits"'+ \ 92 cmd = ctselect+' inobs="event_file_that_does_not_exist.fits"'+ \
93 ' outobs="ctselect_cmd2.fits"'+ \ 93 ' outobs="ctselect_cmd2.fits"'+ \
94 - ' ra=83.63 dec=22.01 rad=3.0'+ \  
95 - ' tmin=500.0 tmax=1000.0'+ \ 94 + ' ra=83.63 dec=22.01 rad=2.0'+ \
  95 + ' tmin=2020-01-01T00:08:20 tmax=2020-01-01T00:16:40'+ \
96 ' emin=0.2 emax=80.0'+ \ 96 ' emin=0.2 emax=80.0'+ \
97 ' logfile="ctselect_cmd2.log" debug=yes chatter=1' 97 ' logfile="ctselect_cmd2.log" debug=yes chatter=1'
98 98
@@ -132,9 +132,9 @@ class Test(test): @@ -132,9 +132,9 @@ class Test(test):
132 select['inobs'] = self._events 132 select['inobs'] = self._events
133 select['ra'] = 83.63 133 select['ra'] = 83.63
134 select['dec'] = 22.01 134 select['dec'] = 22.01
135 - select['rad'] = 3  
136 - select['tmin'] = 500.0  
137 - select['tmax'] = 1000.0 135 + select['rad'] = 2.0
  136 + select['tmin'] = '2020-01-01T00:08:20'
  137 + select['tmax'] = '2020-01-01T00:16:40'
138 select['emin'] = 0.2 138 select['emin'] = 0.2
139 select['emax'] = 80.0 139 select['emax'] = 80.0
140 select['outobs'] = 'ctselect_py1.fits' 140 select['outobs'] = 'ctselect_py1.fits'
@@ -181,7 +181,7 @@ class Test(test): @@ -181,7 +181,7 @@ class Test(test):
181 # to valid event selections, but since the maximum values are still 181 # to valid event selections, but since the maximum values are still
182 # 'NONE', no event selections should occur. 182 # 'NONE', no event selections should occur.
183 cpy_select['usepnt'] = True 183 cpy_select['usepnt'] = True
184 - cpy_select['tmin'] = 500.0 184 + cpy_select['tmin'] = '2020-01-01T00:08:20'
185 cpy_select['emin'] = 0.2 185 cpy_select['emin'] = 0.2
186 cpy_select['usethres'] = 'USER' 186 cpy_select['usethres'] = 'USER'
187 cpy_select['outobs'] = 'ctselect_py3.fits' 187 cpy_select['outobs'] = 'ctselect_py3.fits'
@@ -213,9 +213,9 @@ class Test(test): @@ -213,9 +213,9 @@ class Test(test):
213 select = ctools.ctselect(obs) 213 select = ctools.ctselect(obs)
214 select['ra'] = 83.63 214 select['ra'] = 83.63
215 select['dec'] = 22.01 215 select['dec'] = 22.01
216 - select['rad'] = 3.0  
217 - select['tmin'] = 500.0  
218 - select['tmax'] = 1000.0 216 + select['rad'] = 2.0
  217 + select['tmin'] = '2020-01-01T00:08:20'
  218 + select['tmax'] = '2020-01-01T00:16:40'
219 select['emin'] = 120.0 219 select['emin'] = 120.0
220 select['emax'] = 130.0 220 select['emax'] = 130.0
221 select['expr'] = 'DETX == 0' 221 select['expr'] = 'DETX == 0'
@@ -236,9 +236,9 @@ class Test(test): @@ -236,9 +236,9 @@ class Test(test):
236 select['inobs'] = self._invalid_events 236 select['inobs'] = self._invalid_events
237 select['ra'] = 83.63 237 select['ra'] = 83.63
238 select['dec'] = 22.01 238 select['dec'] = 22.01
239 - select['rad'] = 3  
240 - select['tmin'] = 500.0  
241 - select['tmax'] = 1000.0 239 + select['rad'] = 2.0
  240 + select['tmin'] = '2020-01-01T00:08:20'
  241 + select['tmax'] = '2020-01-01T00:16:40'
242 select['emin'] = 0.2 242 select['emin'] = 0.2
243 select['emax'] = 80.0 243 select['emax'] = 80.0
244 select['outobs'] = 'ctselect_py5.fits' 244 select['outobs'] = 'ctselect_py5.fits'
@@ -260,9 +260,9 @@ class Test(test): @@ -260,9 +260,9 @@ class Test(test):
260 select['inobs'] = self._events+'[EVENTS]' 260 select['inobs'] = self._events+'[EVENTS]'
261 select['ra'] = 83.63 261 select['ra'] = 83.63
262 select['dec'] = 22.01 262 select['dec'] = 22.01
263 - select['rad'] = 3.0  
264 - select['tmin'] = 500.0  
265 - select['tmax'] = 1000.0 263 + select['rad'] = 2.0
  264 + select['tmin'] = '2020-01-01T00:08:20'
  265 + select['tmax'] = '2020-01-01T00:16:40'
266 select['emin'] = 0.2 266 select['emin'] = 0.2
267 select['emax'] = 0.0 # Signals that "emax" should be ignored 267 select['emax'] = 0.0 # Signals that "emax" should be ignored
268 select['outobs'] = 'ctselect_py6.fits' 268 select['outobs'] = 'ctselect_py6.fits'
@@ -274,16 +274,16 @@ class Test(test): @@ -274,16 +274,16 @@ class Test(test):
274 select.execute() 274 select.execute()
275 275
276 # Check result file 276 # Check result file
277 - self._check_result_file('ctselect_py6.fits', nevents=595) 277 + self._check_result_file('ctselect_py6.fits')
278 278
279 # Now ignore the "emin" value. 279 # Now ignore the "emin" value.
280 select = ctools.ctselect() 280 select = ctools.ctselect()
281 select['inobs'] = self._events+'[EVENTS]' 281 select['inobs'] = self._events+'[EVENTS]'
282 select['ra'] = 83.63 282 select['ra'] = 83.63
283 select['dec'] = 22.01 283 select['dec'] = 22.01
284 - select['rad'] = 3.0  
285 - select['tmin'] = 500.0  
286 - select['tmax'] = 1000.0 284 + select['rad'] = 2.0
  285 + select['tmin'] = '2020-01-01T00:08:20'
  286 + select['tmax'] = '2020-01-01T00:16:40'
287 select['emin'] = 0.0 # Signals that "emin" should be ignored 287 select['emin'] = 0.0 # Signals that "emin" should be ignored
288 select['emax'] = 80.0 288 select['emax'] = 80.0
289 select['outobs'] = 'ctselect_py7.fits' 289 select['outobs'] = 'ctselect_py7.fits'
@@ -295,7 +295,7 @@ class Test(test): @@ -295,7 +295,7 @@ class Test(test):
295 select.execute() 295 select.execute()
296 296
297 # Check result file 297 # Check result file
298 - self._check_result_file('ctselect_py7.fits', nevents=1684) 298 + self._check_result_file('ctselect_py7.fits', nevents=4709)
299 299
300 # Now set "emin > emax" 300 # Now set "emin > emax"
301 select['emin'] = 150.0 301 select['emin'] = 150.0
@@ -318,9 +318,9 @@ class Test(test): @@ -318,9 +318,9 @@ class Test(test):
318 select['inobs'] = self._events 318 select['inobs'] = self._events
319 select['ra'] = 83.63 319 select['ra'] = 83.63
320 select['dec'] = 24.01 320 select['dec'] = 24.01
321 - select['rad'] = 5.0  
322 - select['tmin'] = 500.0  
323 - select['tmax'] = 1000.0 321 + select['rad'] = 3.0
  322 + select['tmin'] = '2020-01-01T00:08:20'
  323 + select['tmax'] = '2020-01-01T00:16:40'
324 select['emin'] = 0.2 324 select['emin'] = 0.2
325 select['emax'] = 80.0 325 select['emax'] = 80.0
326 select['outobs'] = 'ctselect_py9.fits' 326 select['outobs'] = 'ctselect_py9.fits'
@@ -332,7 +332,8 @@ class Test(test): @@ -332,7 +332,8 @@ class Test(test):
332 select.execute() 332 select.execute()
333 333
334 # Check result file 334 # Check result file
335 - self._check_result_file('ctselect_py9.fits', nevents=466, dec=24.01) 335 + self._check_result_file('ctselect_py9.fits', nevents=781, dec=24.01,
  336 + rad=1.5)
336 337
337 # Now put the RoI outside the existing RoI. This should leave to 338 # Now put the RoI outside the existing RoI. This should leave to
338 # an empty event list. 339 # an empty event list.
@@ -348,14 +349,14 @@ class Test(test): @@ -348,14 +349,14 @@ class Test(test):
348 349
349 # Check result file 350 # Check result file
350 self._check_result_file('ctselect_py10.fits', nevents=0, dec=-22.01, 351 self._check_result_file('ctselect_py10.fits', nevents=0, dec=-22.01,
351 - rad=5.0) 352 + rad=3.0)
352 353
353 # Now test phase cut 354 # Now test phase cut
354 select = ctools.ctselect() 355 select = ctools.ctselect()
355 select['inobs'] = self._phased_events 356 select['inobs'] = self._phased_events
356 select['ra'] = 83.63 357 select['ra'] = 83.63
357 select['dec'] = 22.01 358 select['dec'] = 22.01
358 - select['rad'] = 5.0 359 + select['rad'] = 2.0
359 select['tmin'] = 'INDEF' 360 select['tmin'] = 'INDEF'
360 select['tmax'] = 'INDEF' 361 select['tmax'] = 'INDEF'
361 select['emin'] = 0.1 362 select['emin'] = 0.1
@@ -370,14 +371,14 @@ class Test(test): @@ -370,14 +371,14 @@ class Test(test):
370 select.execute() 371 select.execute()
371 372
372 # Check result file 373 # Check result file
373 - self._check_result_file('ctselect_py11.fits', nevents=1909, rad=5.0) 374 + self._check_result_file('ctselect_py11.fits', nevents=1909)
374 375
375 - # Now test anoother phase cut 376 + # Now test another phase cut
376 select = ctools.ctselect() 377 select = ctools.ctselect()
377 select['inobs'] = self._phased_events 378 select['inobs'] = self._phased_events
378 select['ra'] = 83.63 379 select['ra'] = 83.63
379 select['dec'] = 22.01 380 select['dec'] = 22.01
380 - select['rad'] = 5.0 381 + select['rad'] = 2.0
381 select['tmin'] = 'INDEF' 382 select['tmin'] = 'INDEF'
382 select['tmax'] = 'INDEF' 383 select['tmax'] = 'INDEF'
383 select['emin'] = 0.1 384 select['emin'] = 0.1
@@ -392,7 +393,7 @@ class Test(test): @@ -392,7 +393,7 @@ class Test(test):
392 select.execute() 393 select.execute()
393 394
394 # Check result file 395 # Check result file
395 - self._check_result_file('ctselect_py12.fits', nevents=1995, rad=5.0) 396 + self._check_result_file('ctselect_py12.fits', nevents=1995)
396 397
397 # Test invalid minimum phase value 398 # Test invalid minimum phase value
398 self.test_try('Test invalid minimum phase value') 399 self.test_try('Test invalid minimum phase value')
@@ -482,7 +483,7 @@ class Test(test): @@ -482,7 +483,7 @@ class Test(test):
482 return 483 return
483 484
484 # Check result file 485 # Check result file
485 - def _check_result_file(self, filename, nevents=591, dec=22.01, rad=3.0): 486 + def _check_result_file(self, filename, nevents=2307, dec=22.01, rad=2.0):
486 """ 487 """
487 Check result file 488 Check result file
488 489
@@ -507,7 +508,7 @@ class Test(test): @@ -507,7 +508,7 @@ class Test(test):
507 return 508 return
508 509
509 # Check observation and event list 510 # Check observation and event list
510 - def _check_obs(self, obs, nobs=1, nevents=591): 511 + def _check_obs(self, obs, nobs=1, nevents=2307):
511 """ 512 """
512 Check observation and event list 513 Check observation and event list
513 514
@@ -532,7 +533,7 @@ class Test(test): @@ -532,7 +533,7 @@ class Test(test):
532 return 533 return
533 534
534 # Check events 535 # Check events
535 - def _check_events(self, events, nevents=591, dec=22.01, rad=3.0): 536 + def _check_events(self, events, nevents=2307, dec=22.01, rad=2.0):
536 """ 537 """
537 Check event list 538 Check event list
538 539
test/test_ctulimit.py
@@ -143,11 +143,11 @@ class Test(test): @@ -143,11 +143,11 @@ class Test(test):
143 ulimit.save() 143 ulimit.save()
144 144
145 # Check results 145 # Check results
146 - self.test_value(ulimit.diff_ulimit(), 8.86803e-18, 1.0e-21, 146 + self.test_value(ulimit.diff_ulimit(), 3.05020546110845e-17, 1.0e-21,
147 'Check differential upper limit') 147 'Check differential upper limit')
148 - self.test_value(ulimit.flux_ulimit(), 6.10509e-12, 1.0e-16, 148 + self.test_value(ulimit.flux_ulimit(), 2.07242046724517e-11, 1.0e-16,
149 'Check upper limit on photon flux') 149 'Check upper limit on photon flux')
150 - self.test_value(ulimit.eflux_ulimit(), 2.75669e-11, 1.0e-16, 150 + self.test_value(ulimit.eflux_ulimit(), 9.20229587739368e-11, 1.0e-16,
151 'Check upper limit on energy flux') 151 'Check upper limit on energy flux')
152 152
153 # Check obs() method 153 # Check obs() method
@@ -161,19 +161,19 @@ class Test(test): @@ -161,19 +161,19 @@ class Test(test):
161 cpy_ulimit = ulimit.copy() 161 cpy_ulimit = ulimit.copy()
162 162
163 # Check results of copy 163 # Check results of copy
164 - self.test_value(cpy_ulimit.diff_ulimit(), 8.86803e-18, 1.0e-21, 164 + self.test_value(cpy_ulimit.diff_ulimit(), 3.05020546110845e-17, 1.0e-21,
165 'Check differential upper limit') 165 'Check differential upper limit')
166 - self.test_value(cpy_ulimit.flux_ulimit(), 6.10509e-12, 1.0e-16, 166 + self.test_value(cpy_ulimit.flux_ulimit(), 2.07242046724517e-11, 1.0e-16,
167 'Check upper limit on photon flux') 167 'Check upper limit on photon flux')
168 - self.test_value(cpy_ulimit.eflux_ulimit(), 2.75669e-11, 1.0e-16, 168 + self.test_value(cpy_ulimit.eflux_ulimit(), 9.20229587739368e-11, 1.0e-16,
169 'Check upper limit on energy flux') 169 'Check upper limit on energy flux')
170 170
171 # Check results 171 # Check results
172 - self.test_value(cpy_ulimit.diff_ulimit(), 8.86803e-18, 1.0e-21, 172 + self.test_value(cpy_ulimit.diff_ulimit(), 3.05020546110845e-17, 1.0e-21,
173 'Check differential upper limit') 173 'Check differential upper limit')
174 - self.test_value(cpy_ulimit.flux_ulimit(), 6.10509e-12, 1.0e-16, 174 + self.test_value(cpy_ulimit.flux_ulimit(), 2.07242046724517e-11, 1.0e-16,
175 'Check upper limit on photon flux') 175 'Check upper limit on photon flux')
176 - self.test_value(cpy_ulimit.eflux_ulimit(), 2.75669e-11, 1.0e-16, 176 + self.test_value(cpy_ulimit.eflux_ulimit(), 9.20229587739368e-11, 1.0e-16,
177 'Check upper limit on energy flux') 177 'Check upper limit on energy flux')
178 178
179 # Now clear copy of ctulimit tool 179 # Now clear copy of ctulimit tool
@@ -208,11 +208,11 @@ class Test(test): @@ -208,11 +208,11 @@ class Test(test):
208 ulimit.execute() 208 ulimit.execute()
209 209
210 # Check results 210 # Check results
211 - self.test_value(ulimit.diff_ulimit(), 8.86803e-18, 1.0e-21, 211 + self.test_value(ulimit.diff_ulimit(), 3.05020546110845e-17, 1.0e-21,
212 'Check differential upper limit') 212 'Check differential upper limit')
213 - self.test_value(ulimit.flux_ulimit(), 6.10509e-12, 1.0e-16, 213 + self.test_value(ulimit.flux_ulimit(), 2.07242046724517e-11, 1.0e-16,
214 'Check upper limit on photon flux') 214 'Check upper limit on photon flux')
215 - self.test_value(ulimit.eflux_ulimit(), 2.75669e-11, 1.0e-16, 215 + self.test_value(ulimit.eflux_ulimit(), 9.20229587739368e-11, 1.0e-16,
216 'Check upper limit on energy flux') 216 'Check upper limit on energy flux')
217 217
218 # Test invalid model name 218 # Test invalid model name
test/test_obsutils.py
@@ -113,14 +113,14 @@ class Test(test): @@ -113,14 +113,14 @@ class Test(test):
113 # Check simulation results 113 # Check simulation results
114 self.test_value(res.size(), 1, 'Check number of observations') 114 self.test_value(res.size(), 1, 'Check number of observations')
115 self.test_value(res.models().size(), 2, 'Check number of models') 115 self.test_value(res.models().size(), 2, 'Check number of models')
116 - self.test_value(res.nobserved(), 40, 'Check number of observed events') 116 + self.test_value(res.nobserved(), 48, 'Check number of observed events')
117 self.test_value(res.npred(), 0.0, 'Check number of predicted events') 117 self.test_value(res.npred(), 0.0, 'Check number of predicted events')
118 self.test_value(res[0].eventtype(), 'EventList', 'Check event type') 118 self.test_value(res[0].eventtype(), 'EventList', 'Check event type')
119 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0, 119 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0,
120 'Check minimum energy') 120 'Check minimum energy')
121 self.test_value(res[0].events().ebounds().emax().TeV(), 10.0, 121 self.test_value(res[0].events().ebounds().emax().TeV(), 10.0,
122 'Check minimum energy') 122 'Check minimum energy')
123 - self.test_value(res[0].events().number(), 40, 123 + self.test_value(res[0].events().number(), 48,
124 'Check number of events in list') 124 'Check number of events in list')
125 125
126 # Check energy dispersion flag 126 # Check energy dispersion flag
@@ -144,7 +144,7 @@ class Test(test): @@ -144,7 +144,7 @@ class Test(test):
144 # Check simulation results 144 # Check simulation results
145 self.test_value(res.size(), 1, 'Check number of observations') 145 self.test_value(res.size(), 1, 'Check number of observations')
146 self.test_value(res.models().size(), 2, 'Check number of models') 146 self.test_value(res.models().size(), 2, 'Check number of models')
147 - self.test_value(res.nobserved(), 40, 'Check number of observed events') 147 + self.test_value(res.nobserved(), 48, 'Check number of observed events')
148 self.test_value(res.npred(), 0.0, 'Check number of predicted events') 148 self.test_value(res.npred(), 0.0, 'Check number of predicted events')
149 self.test_value(res[0].eventtype(), 'CountsCube', 'Check event type') 149 self.test_value(res[0].eventtype(), 'CountsCube', 'Check event type')
150 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0, 150 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0,
@@ -153,7 +153,7 @@ class Test(test): @@ -153,7 +153,7 @@ class Test(test):
153 'Check minimum energy') 153 'Check minimum energy')
154 self.test_value(res[0].events().ebounds().size(), 5, 154 self.test_value(res[0].events().ebounds().size(), 5,
155 'Check number of energy bins') 155 'Check number of energy bins')
156 - self.test_value(res[0].events().number(), 40, 156 + self.test_value(res[0].events().number(), 48,
157 'Check number of events in cube') 157 'Check number of events in cube')
158 158
159 # Check energy dispersion flag 159 # Check energy dispersion flag
@@ -177,7 +177,7 @@ class Test(test): @@ -177,7 +177,7 @@ class Test(test):
177 # Check simulation results 177 # Check simulation results
178 self.test_value(res.size(), 1, 'Check number of observations') 178 self.test_value(res.size(), 1, 'Check number of observations')
179 self.test_value(res.models().size(), 2, 'Check number of models') 179 self.test_value(res.models().size(), 2, 'Check number of models')
180 - self.test_value(res.nobserved(), 86, 'Check number of observed events') 180 + self.test_value(res.nobserved(), 96, 'Check number of observed events')
181 self.test_value(res.npred(), 0.0, 'Check number of predicted events') 181 self.test_value(res.npred(), 0.0, 'Check number of predicted events')
182 self.test_value(res[0].eventtype(), 'CountsCube', 'Check event type') 182 self.test_value(res[0].eventtype(), 'CountsCube', 'Check event type')
183 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0, 183 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0,
@@ -186,7 +186,7 @@ class Test(test): @@ -186,7 +186,7 @@ class Test(test):
186 'Check minimum energy') 186 'Check minimum energy')
187 self.test_value(res[0].events().ebounds().size(), 5, 187 self.test_value(res[0].events().ebounds().size(), 5,
188 'Check number of energy bins') 188 'Check number of energy bins')
189 - self.test_value(res[0].events().number(), 86, 189 + self.test_value(res[0].events().number(), 96,
190 'Check number of events in cube') 190 'Check number of events in cube')
191 191
192 # Check energy dispersion flag 192 # Check energy dispersion flag
@@ -211,7 +211,7 @@ class Test(test): @@ -211,7 +211,7 @@ class Test(test):
211 # Check simulation results 211 # Check simulation results
212 self.test_value(res.size(), 1, 'Check number of observations') 212 self.test_value(res.size(), 1, 'Check number of observations')
213 self.test_value(res.models().size(), 2, 'Check number of models') 213 self.test_value(res.models().size(), 2, 'Check number of models')
214 - self.test_value(res.nobserved(), 82, 'Check number of observed events') 214 + self.test_value(res.nobserved(), 98, 'Check number of observed events')
215 self.test_value(res.npred(), 0.0, 'Check number of predicted events') 215 self.test_value(res.npred(), 0.0, 'Check number of predicted events')
216 self.test_value(res[0].eventtype(), 'CountsCube', 'Check event type') 216 self.test_value(res[0].eventtype(), 'CountsCube', 'Check event type')
217 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0, 217 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0,
@@ -220,7 +220,7 @@ class Test(test): @@ -220,7 +220,7 @@ class Test(test):
220 'Check minimum energy') 220 'Check minimum energy')
221 self.test_value(res[0].events().ebounds().size(), 5, 221 self.test_value(res[0].events().ebounds().size(), 5,
222 'Check number of energy bins') 222 'Check number of energy bins')
223 - self.test_value(res[0].events().number(), 82, 223 + self.test_value(res[0].events().number(), 98,
224 'Check number of events in cube') 224 'Check number of events in cube')
225 225
226 # Check energy dispersion flag 226 # Check energy dispersion flag
@@ -306,7 +306,7 @@ class Test(test): @@ -306,7 +306,7 @@ class Test(test):
306 # Check simulation results 306 # Check simulation results
307 self.test_value(res.size(), 1, 'Check number of observations') 307 self.test_value(res.size(), 1, 'Check number of observations')
308 self.test_value(res.models().size(), 2, 'Check number of models') 308 self.test_value(res.models().size(), 2, 'Check number of models')
309 - self.test_value(res.nobserved(), 40, 'Check number of observed events') 309 + self.test_value(res.nobserved(), 48, 'Check number of observed events')
310 self.test_value(res.npred(), 0.0, 'Check number of predicted events') 310 self.test_value(res.npred(), 0.0, 'Check number of predicted events')
311 self.test_value(res[0].eventtype(), 'EventList', 'Check event type') 311 self.test_value(res[0].eventtype(), 'EventList', 'Check event type')
312 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0, 312 self.test_value(res[0].events().ebounds().emin().TeV(), 1.0,