Commit 091ffad3c66f9498fef1dcf818fc375e8075bcdc

Authored by Jürgen Knödlseder
1 parent 00a109e4

Reduce energy range and binning to speed-up unit tests (#2310)

test/test_cslightcrv.py
... ... @@ -79,7 +79,7 @@ class Test(test):
79 79 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
80 80 ' tbinalg=LIN '+ \
81 81 ' tmin=2020-01-01T00:00:00 tmax=2020-01-01T00:05:00'+ \
82   - ' tbins=3 method=3D enumbins=0 emin=0.1 emax=100.0'+ \
  82 + ' tbins=2 method=3D enumbins=0 emin=1.0 emax=100.0'+ \
83 83 ' outfile="lightcurve_cmd1.fits"'+ \
84 84 ' logfile="cslightcrv_cmd1.log" chatter=1'
85 85  
... ... @@ -88,7 +88,7 @@ class Test(test):
88 88 'Check successful execution from command line')
89 89  
90 90 # Check light curve
91   - self._check_light_curve('lightcurve_cmd1.fits', 3)
  91 + self._check_light_curve('lightcurve_cmd1.fits', 2)
92 92  
93 93 # Setup cslightcrv command
94 94 cmd = cslightcrv+' inobs="events_that_do_not_exist.fits"'+ \
... ... @@ -96,7 +96,7 @@ class Test(test):
96 96 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
97 97 ' tbinalg=LIN '+ \
98 98 ' tmin=2020-01-01T00:00:00 tmax=2020-01-01T00:05:00'+ \
99   - ' tbins=3 method=3D enumbins=0 emin=0.1 emax=100.0'+ \
  99 + ' tbins=2 method=3D enumbins=0 emin=1.0 emax=100.0'+ \
100 100 ' outfile="lightcurve_cmd1.fits"'+ \
101 101 ' logfile="cslightcrv_cmd2.log" debug=yes'
102 102  
... ... @@ -125,10 +125,10 @@ class Test(test):
125 125 lcrv['tbinalg'] = 'LIN'
126 126 lcrv['tmin'] = '2020-01-01T00:00:00'
127 127 lcrv['tmax'] = '2020-01-01T00:05:00'
128   - lcrv['tbins'] = 3
  128 + lcrv['tbins'] = 2
129 129 lcrv['method'] = '3D'
130 130 lcrv['enumbins'] = 0
131   - lcrv['emin'] = 0.1
  131 + lcrv['emin'] = 1.0
132 132 lcrv['emax'] = 100.0
133 133 lcrv['outfile'] = 'cslightcrv_py1.fits'
134 134 lcrv['logfile'] = 'cslightcrv_py1.log'
... ... @@ -141,10 +141,10 @@ class Test(test):
141 141 lcrv.save()
142 142  
143 143 # Check light curve
144   - self._check_light_curve('cslightcrv_py1.fits', 3)
  144 + self._check_light_curve('cslightcrv_py1.fits', 2)
145 145  
146 146 # Now use FILE as time bin algorithm. For this we need first to
147   - # create an ASCII file. We use now 6 time bins. The ASCII file
  147 + # create an ASCII file. We use now 2 time bins. The ASCII file
148 148 # is saved into the file "lightcurve_py2.dat".
149 149 csv = gammalib.GCsv(2,2)
150 150 tmin = 58849.00
... ... @@ -165,7 +165,7 @@ class Test(test):
165 165 lcrv['tbinfile'] = 'cslightcrv_py2.dat'
166 166 lcrv['method'] = '3D'
167 167 lcrv['enumbins'] = 0
168   - lcrv['emin'] = 0.1
  168 + lcrv['emin'] = 1.0
169 169 lcrv['emax'] = 100.0
170 170 lcrv['fix_bkg'] = True
171 171 lcrv['outfile'] = 'cslightcrv_py2.fits'
... ... @@ -195,7 +195,7 @@ class Test(test):
195 195 lcrv['tbinalg'] = 'GTI'
196 196 lcrv['method'] = '3D'
197 197 lcrv['enumbins'] = 0
198   - lcrv['emin'] = 0.1
  198 + lcrv['emin'] = 1.0
199 199 lcrv['emax'] = 100.0
200 200 lcrv['outfile'] = 'cslightcrv_py3.fits'
201 201 lcrv['logfile'] = 'cslightcrv_py3.log'
... ... @@ -219,16 +219,16 @@ class Test(test):
219 219 lcrv['tmax'] = '2020-01-01T00:05:00'
220 220 lcrv['tbins'] = 2
221 221 lcrv['method'] = '3D'
222   - lcrv['emin'] = 0.1
  222 + lcrv['emin'] = 1.0
223 223 lcrv['emax'] = 100.0
224   - lcrv['enumbins'] = 10
  224 + lcrv['enumbins'] = 3
225 225 lcrv['coordsys'] = 'CEL'
226 226 lcrv['proj'] = 'TAN'
227 227 lcrv['xref'] = 83.63
228 228 lcrv['yref'] = 22.01
229   - lcrv['nxpix'] = 20
230   - lcrv['nypix'] = 20
231   - lcrv['binsz'] = 0.02
  229 + lcrv['nxpix'] = 10
  230 + lcrv['nypix'] = 10
  231 + lcrv['binsz'] = 0.04
232 232 lcrv['outfile'] = 'cslightcrv_py4.fits'
233 233 lcrv['logfile'] = 'cslightcrv_py4.log'
234 234 lcrv['chatter'] = 4
... ... @@ -251,16 +251,16 @@ class Test(test):
251 251 lcrv['tmax'] = '2020-01-01T00:05:00'
252 252 lcrv['tbins'] = 2
253 253 lcrv['method'] = 'ONOFF'
254   - lcrv['emin'] = 0.1
  254 + lcrv['emin'] = 1.0
255 255 lcrv['emax'] = 100.0
256   - lcrv['enumbins'] = 10
  256 + lcrv['enumbins'] = 2
257 257 lcrv['coordsys'] = 'CEL'
258 258 lcrv['xref'] = 83.63
259 259 lcrv['yref'] = 22.01
260 260 lcrv['rad'] = 0.2
261   - lcrv['etruemin'] = 0.05
262   - lcrv['etruemax'] = 150.0
263   - lcrv['etruebins'] = 20
  261 + lcrv['etruemin'] = 1.0
  262 + lcrv['etruemax'] = 100.0
  263 + lcrv['etruebins'] = 5
264 264 lcrv['statistic'] = 'WSTAT'
265 265 lcrv['outfile'] = 'cslightcrv_py5.fits'
266 266 lcrv['logfile'] = 'cslightcrv_py5.log'
... ... @@ -274,23 +274,23 @@ class Test(test):
274 274  
275 275 # Set-up cslightcrv without multiprocessing
276 276 lcrv = cscripts.cslightcrv()
277   - lcrv['inobs'] = self._events
278   - lcrv['inmodel'] = self._model
279   - lcrv['srcname'] = 'Crab'
280   - lcrv['caldb'] = self._caldb
281   - lcrv['irf'] = self._irf
282   - lcrv['tbinalg'] = 'LIN'
283   - lcrv['tmin'] = '2020-01-01T00:00:00'
284   - lcrv['tmax'] = '2020-01-01T00:05:00'
285   - lcrv['tbins'] = 3
286   - lcrv['method'] = '3D'
  277 + lcrv['inobs'] = self._events
  278 + lcrv['inmodel'] = self._model
  279 + lcrv['srcname'] = 'Crab'
  280 + lcrv['caldb'] = self._caldb
  281 + lcrv['irf'] = self._irf
  282 + lcrv['tbinalg'] = 'LIN'
  283 + lcrv['tmin'] = '2020-01-01T00:00:00'
  284 + lcrv['tmax'] = '2020-01-01T00:05:00'
  285 + lcrv['tbins'] = 2
  286 + lcrv['method'] = '3D'
287 287 lcrv['enumbins'] = 0
288   - lcrv['emin'] = 0.1
289   - lcrv['emax'] = 100.0
290   - lcrv['outfile'] = 'cslightcrv_py6.fits'
291   - lcrv['logfile'] = 'cslightcrv_py6.log'
292   - lcrv['chatter'] = 2
293   - lcrv['publish'] = True
  288 + lcrv['emin'] = 1.0
  289 + lcrv['emax'] = 100.0
  290 + lcrv['outfile'] = 'cslightcrv_py6.fits'
  291 + lcrv['logfile'] = 'cslightcrv_py6.log'
  292 + lcrv['chatter'] = 2
  293 + lcrv['publish'] = True
294 294 lcrv['nthreads'] = 1
295 295  
296 296 # Run cslightcrv script and save light curve
... ... @@ -299,7 +299,7 @@ class Test(test):
299 299 lcrv.save()
300 300  
301 301 # Check light curve
302   - self._check_light_curve('cslightcrv_py6.fits', 3)
  302 + self._check_light_curve('cslightcrv_py6.fits', 2)
303 303  
304 304 # Return
305 305 return
... ... @@ -322,10 +322,10 @@ class Test(test):
322 322 lcrv['tbinalg'] = 'LIN'
323 323 lcrv['tmin'] = '2020-01-01T00:00:00'
324 324 lcrv['tmax'] = '2020-01-01T00:05:00'
325   - lcrv['tbins'] = 3
  325 + lcrv['tbins'] = 2
326 326 lcrv['method'] = '3D'
327 327 lcrv['enumbins'] = 0
328   - lcrv['emin'] = 0.1
  328 + lcrv['emin'] = 1.0
329 329 lcrv['emax'] = 100.0
330 330 lcrv['outfile'] = 'cslightcrv_py1_pickle.fits'
331 331 lcrv['logfile'] = 'cslightcrv_py1_pickle.log'
... ... @@ -341,7 +341,7 @@ class Test(test):
341 341 obj.save()
342 342  
343 343 # Check light curve
344   - self._check_light_curve('cslightcrv_py1_pickle.fits', 3)
  344 + self._check_light_curve('cslightcrv_py1_pickle.fits', 2)
345 345  
346 346 # Return
347 347 return
... ... @@ -379,7 +379,7 @@ class Test(test):
379 379  
380 380 # Check that the Prefactor has the right order of magnitude
381 381 for s in range(table.nrows()):
382   - self.test_value(table['Prefactor'][s], prefactor, 0.2*prefactor,
  382 + self.test_value(table['Prefactor'][s], prefactor, 0.9*prefactor,
383 383 'Check prefactor value')
384 384  
385 385 # Close FITS file
... ...
test/test_csphasecrv.py
... ... @@ -78,8 +78,8 @@ class Test(test):
78 78 cmd = csphasecrv+' inobs="'+self._phased_events+'"'+ \
79 79 ' inmodel="'+self._model+'" srcname="Crab"'+ \
80 80 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
81   - ' phbinalg="LIN" phbins=5 method="3D"'+ \
82   - ' enumbins=0 emin=0.1 emax=100.0'+ \
  81 + ' phbinalg="LIN" phbins=2 method="3D"'+ \
  82 + ' enumbins=0 emin=1.0 emax=100.0'+ \
83 83 ' outfile="csphasecrv_cmd1.fits"'+ \
84 84 ' logfile="csphasecrv_cmd1.log" chatter=1'
85 85  
... ... @@ -88,14 +88,14 @@ class Test(test):
88 88 'Check successful execution from command line')
89 89  
90 90 # Check phase curve
91   - self._check_phase_curve('csphasecrv_cmd1.fits', 5)
  91 + self._check_phase_curve('csphasecrv_cmd1.fits', 2)
92 92  
93 93 # Setup csphasecrv command
94 94 cmd = csphasecrv+' inobs="events_that_do_not_exist.fits"'+ \
95 95 ' inmodel="'+self._model+'" srcname="Crab"'+ \
96 96 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
97   - ' phbinalg="LIN" phbins=5 method="3D"'+ \
98   - ' enumbins=0 emin=0.1 emax=100.0'+ \
  97 + ' phbinalg="LIN" phbins=2 method="3D"'+ \
  98 + ' enumbins=0 emin=1.0 emax=100.0'+ \
99 99 ' outfile="csphasecrv_cmd2.fits"'+ \
100 100 ' logfile="csphasecrv_cmd2.log" debug=yes chatter=1'
101 101  
... ... @@ -122,10 +122,10 @@ class Test(test):
122 122 pcrv['caldb'] = self._caldb
123 123 pcrv['irf'] = self._irf
124 124 pcrv['phbinalg'] = 'LIN'
125   - pcrv['phbins'] = 5
  125 + pcrv['phbins'] = 2
126 126 pcrv['method'] = '3D'
127 127 pcrv['enumbins'] = 0
128   - pcrv['emin'] = 0.1
  128 + pcrv['emin'] = 1.0
129 129 pcrv['emax'] = 100.0
130 130 pcrv['outfile'] = 'csphasecrv_py1.fits'
131 131 pcrv['logfile'] = 'csphasecrv_py1.log'
... ... @@ -138,7 +138,7 @@ class Test(test):
138 138 pcrv.save()
139 139  
140 140 # Check phase curve
141   - self._check_phase_curve('csphasecrv_py1.fits', 5)
  141 + self._check_phase_curve('csphasecrv_py1.fits', 2)
142 142  
143 143 # Now use FILE as time bin algorithm. For this we need first to
144 144 # create an ASCII file. We use now 2 phase bins. The ASCII file
... ... @@ -162,7 +162,7 @@ class Test(test):
162 162 pcrv['phbinfile'] = 'csphasecrv_py2.dat'
163 163 pcrv['method'] = '3D'
164 164 pcrv['enumbins'] = 0
165   - pcrv['emin'] = 0.1
  165 + pcrv['emin'] = 1.0
166 166 pcrv['emax'] = 100.0
167 167 pcrv['outfile'] = 'csphasecrv_py2.fits'
168 168 pcrv['logfile'] = 'csphasecrv_py2.log'
... ... @@ -190,10 +190,10 @@ class Test(test):
190 190 pcrv['caldb'] = self._caldb
191 191 pcrv['irf'] = self._irf
192 192 pcrv['phbinalg'] = 'LIN'
193   - pcrv['phbins'] = 5
  193 + pcrv['phbins'] = 2
194 194 pcrv['method'] = '3D'
195 195 pcrv['enumbins'] = 0
196   - pcrv['emin'] = 0.1
  196 + pcrv['emin'] = 1.0
197 197 pcrv['emax'] = 100.0
198 198 pcrv['outfile'] = 'csphasecrv_py3.fits'
199 199 pcrv['logfile'] = 'csphasecrv_py3.log'
... ... @@ -204,7 +204,7 @@ class Test(test):
204 204 pcrv.execute()
205 205  
206 206 # Check phase curve
207   - self._check_phase_curve('csphasecrv_py3.fits', 5)
  207 + self._check_phase_curve('csphasecrv_py3.fits', 2)
208 208  
209 209 # Binned csphasecrv
210 210 pcrv = cscripts.csphasecrv()
... ... @@ -216,16 +216,16 @@ class Test(test):
216 216 pcrv['phbinalg'] = 'LIN'
217 217 pcrv['phbins'] = 2
218 218 pcrv['method'] = '3D'
219   - pcrv['emin'] = 0.1
  219 + pcrv['emin'] = 1.0
220 220 pcrv['emax'] = 100.0
221   - pcrv['enumbins'] = 10
  221 + pcrv['enumbins'] = 2
222 222 pcrv['coordsys'] = 'CEL'
223 223 pcrv['proj'] = 'TAN'
224 224 pcrv['xref'] = 83.63
225 225 pcrv['yref'] = 22.01
226   - pcrv['nxpix'] = 20
227   - pcrv['nypix'] = 20
228   - pcrv['binsz'] = 0.02
  226 + pcrv['nxpix'] = 10
  227 + pcrv['nypix'] = 10
  228 + pcrv['binsz'] = 0.04
229 229 pcrv['outfile'] = 'csphasecrv_py4.fits'
230 230 pcrv['logfile'] = 'csphasecrv_py4.log'
231 231 pcrv['chatter'] = 4
... ... @@ -248,15 +248,15 @@ class Test(test):
248 248 pcrv['phbins'] = 2
249 249 pcrv['method'] = 'ONOFF'
250 250 pcrv['statistic'] = 'WSTAT'
251   - pcrv['emin'] = 0.1
  251 + pcrv['emin'] = 1.0
252 252 pcrv['emax'] = 100.0
253   - pcrv['enumbins'] = 10
  253 + pcrv['enumbins'] = 2
254 254 pcrv['coordsys'] = 'CEL'
255 255 pcrv['xref'] = 83.63
256 256 pcrv['yref'] = 22.01
257 257 pcrv['rad'] = 0.2
258   - pcrv['etruemin'] = 0.05
259   - pcrv['etruemax'] = 150.0
  258 + pcrv['etruemin'] = 1.0
  259 + pcrv['etruemax'] = 100.0
260 260 pcrv['etruebins'] = 5
261 261 pcrv['outfile'] = 'csphasecrv_py5.fits'
262 262 pcrv['logfile'] = 'csphasecrv_py5.log'
... ... @@ -277,10 +277,10 @@ class Test(test):
277 277 pcrv['caldb'] = self._caldb
278 278 pcrv['irf'] = self._irf
279 279 pcrv['phbinalg'] = 'LIN'
280   - pcrv['phbins'] = 5
  280 + pcrv['phbins'] = 2
281 281 pcrv['method'] = '3D'
282 282 pcrv['enumbins'] = 0
283   - pcrv['emin'] = 0.1
  283 + pcrv['emin'] = 1.0
284 284 pcrv['emax'] = 100.0
285 285 pcrv['outfile'] = 'csphasecrv_py6.fits'
286 286 pcrv['logfile'] = 'csphasecrv_py6.log'
... ... @@ -294,7 +294,7 @@ class Test(test):
294 294 pcrv.save()
295 295  
296 296 # Check phase curve
297   - self._check_phase_curve('csphasecrv_py6.fits', 5)
  297 + self._check_phase_curve('csphasecrv_py6.fits', 2)
298 298  
299 299 # Return
300 300 return
... ... @@ -315,10 +315,10 @@ class Test(test):
315 315 pcrv['caldb'] = self._caldb
316 316 pcrv['irf'] = self._irf
317 317 pcrv['phbinalg'] = 'LIN'
318   - pcrv['phbins'] = 5
  318 + pcrv['phbins'] = 2
319 319 pcrv['method'] = '3D'
320 320 pcrv['enumbins'] = 0
321   - pcrv['emin'] = 0.1
  321 + pcrv['emin'] = 1.0
322 322 pcrv['emax'] = 100.0
323 323 pcrv['outfile'] = 'csphasecrv_py1_pickle.fits'
324 324 pcrv['logfile'] = 'csphasecrv_py1_pickle.log'
... ... @@ -334,7 +334,7 @@ class Test(test):
334 334 obj.save()
335 335  
336 336 # Check phase curve
337   - self._check_phase_curve('csphasecrv_py1_pickle.fits', 5)
  337 + self._check_phase_curve('csphasecrv_py1_pickle.fits', 2)
338 338  
339 339 # Return
340 340 return
... ...
test/test_cspull.py
... ... @@ -80,7 +80,7 @@ class Test(test):
80 80 ' outfile="cspull_cmd1.dat"'+ \
81 81 ' ntrials=2'+ \
82 82 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
83   - ' ra=83.6331 dec=22.0145 emin=0.1 emax=100.0'+ \
  83 + ' ra=83.6331 dec=22.0145 emin=1.0 emax=100.0'+ \
84 84 ' enumbins=0 tmin=0.0 tmax=100.0 deadc=0.98 rad=5.0'+ \
85 85 ' npix=200 binsz=0.05'+ \
86 86 ' logfile="cspull_cmd1.log" chatter=1'
... ... @@ -97,7 +97,7 @@ class Test(test):
97 97 ' outfile="cspull_cmd1.dat"'+ \
98 98 ' ntrials=2'+ \
99 99 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
100   - ' ra=83.6331 dec=22.0145 emin=0.1 emax=100.0'+ \
  100 + ' ra=83.6331 dec=22.0145 emin=1.0 emax=100.0'+ \
101 101 ' enumbins=0 tmin=0.0 tmax=100.0 deadc=0.98 rad=5.0'+ \
102 102 ' npix=200 binsz=0.05'+ \
103 103 ' logfile="cspull_cmd2.log" debug=yes'
... ... @@ -127,7 +127,7 @@ class Test(test):
127 127 pull['irf'] = self._irf
128 128 pull['ra'] = 83.6331
129 129 pull['dec'] = 22.0145
130   - pull['emin'] = 0.1
  130 + pull['emin'] = 1.0
131 131 pull['emax'] = 100.0
132 132 pull['enumbins'] = 0
133 133 pull['tmin'] = 0.0
... ... @@ -140,7 +140,6 @@ class Test(test):
140 140 # Run cspull script
141 141 pull.logFileOpen() # Make sure we get a log file
142 142 pull.run()
143   - #pull.save()
144 143  
145 144 # Check pull distribution file
146 145 self._check_pull_file('cspull_py1.dat')
... ... @@ -155,14 +154,14 @@ class Test(test):
155 154 pull['irf'] = self._irf
156 155 pull['ra'] = 83.6331
157 156 pull['dec'] = 22.0145
158   - pull['emin'] = 0.1
  157 + pull['emin'] = 1.0
159 158 pull['emax'] = 100.0
160   - pull['enumbins'] = 10
  159 + pull['enumbins'] = 2
161 160 pull['tmin'] = 0.0
162 161 pull['tmax'] = 100.0
163 162 pull['deadc'] = 0.98
164 163 pull['rad'] = 5.0
165   - pull['npix'] = 20
  164 + pull['npix'] = 10
166 165 pull['binsz'] = 0.2
167 166 pull['coordsys'] = 'CEL'
168 167 pull['proj'] = 'TAN'
... ... @@ -245,10 +244,10 @@ class Test(test):
245 244 pull['onsrc'] = 'NONE'
246 245 pull['outfile'] = 'cspull_py6.dat'
247 246 pull['ntrials'] = 1
248   - pull['emin'] = 0.02
  247 + pull['emin'] = 1.0
249 248 pull['emax'] = 100.0
250   - pull['enumbins'] = 10
251   - pull['npix'] = 20
  249 + pull['enumbins'] = 2
  250 + pull['npix'] = 10
252 251 pull['binsz'] = 0.2
253 252 pull['coordsys'] = 'CEL'
254 253 pull['proj'] = 'TAN'
... ... @@ -271,7 +270,7 @@ class Test(test):
271 270 pull['irf'] = self._irf
272 271 pull['ra'] = 83.6331
273 272 pull['dec'] = 22.0145
274   - pull['emin'] = 0.1
  273 + pull['emin'] = 1.0
275 274 pull['emax'] = 100.0
276 275 pull['enumbins'] = 0
277 276 pull['tmin'] = 0.0
... ... @@ -309,7 +308,7 @@ class Test(test):
309 308 pull['irf'] = self._irf
310 309 pull['ra'] = 83.6331
311 310 pull['dec'] = 22.0145
312   - pull['emin'] = 0.1
  311 + pull['emin'] = 1.0
313 312 pull['emax'] = 100.0
314 313 pull['enumbins'] = 0
315 314 pull['tmin'] = 0.0
... ... @@ -326,7 +325,6 @@ class Test(test):
326 325 # Run csphasecrv script and save light curve
327 326 obj.logFileOpen() # Make sure we get a log file
328 327 obj.run()
329   - #obj.save()
330 328  
331 329 # Check pull distribution file
332 330 self._check_pull_file('cspull_py1_pickle.dat')
... ...
test/test_csresspec.py
... ... @@ -77,7 +77,7 @@ class Test(test):
77 77 ' outfile="csresspec_cmd1.fits"' + \
78 78 ' inmodel="' + self._model + '"' + \
79 79 ' caldb="' + self._caldb + '" irf="' + self._irf + '"' + \
80   - ' emin=0.1 emax=100.0 enumbins=20 ebinalg="LOG"' + \
  80 + ' emin=1.0 emax=100.0 enumbins=2 ebinalg="LOG"' + \
81 81 ' mask=no algorithm="SUB"' + \
82 82 ' logfile="csresspec_cmd1.log" chatter=4'
83 83  
... ... @@ -86,14 +86,14 @@ class Test(test):
86 86 'Check successful execution from command line')
87 87  
88 88 # Check result file
89   - self._check_result_file('csresspec_cmd1.fits', 20, 5)
  89 + self._check_result_file('csresspec_cmd1.fits', 2, 5)
90 90  
91 91 # Setup csresspec command
92 92 cmd = csresspec + ' inobs="event_file_that_does_not_exist.fits"' + \
93 93 ' outfile="csresspec_cmd2.fits"' + \
94 94 ' inmodel="' + self._model + '"' + \
95 95 ' caldb="' + self._caldb + '" irf="' + self._irf + '"' + \
96   - ' emin=0.1 emax=100.0 enumbins=20 ebinalg="LOG"' + \
  96 + ' emin=1.0 emax=100.0 enumbins=2 ebinalg="LOG"' + \
97 97 ' mask=no algorithm="SUBDIVSQRT"' + \
98 98 ' logfile="csresspec_cmd2.log" debug=yes chatter=2'
99 99  
... ... @@ -120,9 +120,9 @@ class Test(test):
120 120 resspec['caldb'] = self._caldb
121 121 resspec['irf'] = self._irf
122 122 resspec['ebinalg'] = 'LOG'
123   - resspec['emin'] = 0.1
  123 + resspec['emin'] = 1.0
124 124 resspec['emax'] = 100.0
125   - resspec['enumbins'] = 20
  125 + resspec['enumbins'] = 2
126 126 resspec['mask'] = False
127 127 resspec['algorithm'] = 'SUB'
128 128 resspec['logfile'] = 'csresspec_py1.log'
... ... @@ -134,7 +134,7 @@ class Test(test):
134 134 resspec.save()
135 135  
136 136 # Check result file
137   - self._check_result_file('csresspec_py1.fits', 20, 5)
  137 + self._check_result_file('csresspec_py1.fits', 2, 5)
138 138  
139 139 # Set-up csresspec for event list with computation of individual
140 140 # model components
... ... @@ -145,9 +145,9 @@ class Test(test):
145 145 resspec['caldb'] = self._caldb
146 146 resspec['irf'] = self._irf
147 147 resspec['ebinalg'] = 'LOG'
148   - resspec['emin'] = 0.1
  148 + resspec['emin'] = 1.0
149 149 resspec['emax'] = 100.0
150   - resspec['enumbins'] = 20
  150 + resspec['enumbins'] = 2
151 151 resspec['mask'] = False
152 152 resspec['algorithm'] = 'SUBDIV'
153 153 resspec['components'] = True
... ... @@ -158,7 +158,7 @@ class Test(test):
158 158 resspec.execute()
159 159  
160 160 # Check result file
161   - self._check_result_file('csresspec_py2.fits', 20, 7)
  161 + self._check_result_file('csresspec_py2.fits', 2, 7)
162 162  
163 163 # Set-up csresspec for counts cube
164 164 resspec = cscripts.csresspec()
... ...
test/test_csspec.py
... ... @@ -84,7 +84,7 @@ class Test(test):
84 84 ' inmodel="'+self._model+'"'+ \
85 85 ' srcname="Crab" method="AUTO"'+ \
86 86 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
87   - ' ebinalg="LOG" enumbins=5 emin=0.1 emax=100.0'+ \
  87 + ' ebinalg="LOG" enumbins=2 emin=1.0 emax=100.0'+ \
88 88 ' outfile="csspec_cmd1.fits"'+ \
89 89 ' logfile="csspec_cmd1.log" chatter=1'
90 90  
... ... @@ -93,14 +93,14 @@ class Test(test):
93 93 'Check successful execution from command line')
94 94  
95 95 # Check result file
96   - self._check_result_file('csspec_cmd1.fits', 5)
  96 + self._check_result_file('csspec_cmd1.fits', 2)
97 97  
98 98 # Setup csspec command
99 99 cmd = csspec+' inobs="input_file_that_does_not_exist.fits"'+ \
100 100 ' inmodel="'+self._model+'"'+ \
101 101 ' srcname="Crab" method="AUTO"'+ \
102 102 ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \
103   - ' ebinalg="LOG" enumbins=5 emin=0.1 emax=100.0'+ \
  103 + ' ebinalg="LOG" enumbins=2 emin=1.0 emax=100.0'+ \
104 104 ' outfile="csspec_cmd2.fits"'+ \
105 105 ' logfile="csspec_cmd2.log" debug=yes chatter=1'
106 106  
... ... @@ -128,8 +128,8 @@ class Test(test):
128 128 spec['irf'] = self._irf
129 129 spec['method'] = 'AUTO'
130 130 spec['ebinalg'] = 'LOG'
131   - spec['enumbins'] = 5
132   - spec['emin'] = 0.1
  131 + spec['enumbins'] = 2
  132 + spec['emin'] = 1.0
133 133 spec['emax'] = 100.0
134 134 spec['outfile'] = 'csspec_py1.fits'
135 135 spec['logfile'] = 'csspec_py1.log'
... ... @@ -142,7 +142,7 @@ class Test(test):
142 142 spec.save()
143 143  
144 144 # Check result file
145   - self._check_result_file('csspec_py1.fits', 5)
  145 + self._check_result_file('csspec_py1.fits', 2)
146 146  
147 147 # Set-up stacked csspec
148 148 spec = cscripts.csspec()
... ... @@ -176,8 +176,8 @@ class Test(test):
176 176 spec['srcname'] = 'Crab'
177 177 spec['method'] = 'AUTO'
178 178 spec['ebinalg'] = 'LOG'
179   - spec['enumbins'] = 10
180   - spec['emin'] = 0.1
  179 + spec['enumbins'] = 2
  180 + spec['emin'] = 1.0
181 181 spec['emax'] = 10.0
182 182 spec['outfile'] = 'csspec_py3.fits'
183 183 spec['logfile'] = 'csspec_py3.log'
... ... @@ -188,7 +188,7 @@ class Test(test):
188 188 spec.execute()
189 189  
190 190 # Check result file
191   - self._check_result_file('csspec_py3.fits', 10)
  191 + self._check_result_file('csspec_py3.fits', 2)
192 192  
193 193 # Set-up On/Off csspec with NODES method
194 194 spec = cscripts.csspec()
... ... @@ -197,8 +197,8 @@ class Test(test):
197 197 spec['srcname'] = 'Crab'
198 198 spec['method'] = 'NODES'
199 199 spec['ebinalg'] = 'LOG'
200   - spec['enumbins'] = 10
201   - spec['emin'] = 0.1
  200 + spec['enumbins'] = 2
  201 + spec['emin'] = 1.0
202 202 spec['emax'] = 10.0
203 203 spec['outfile'] = 'csspec_py4.fits'
204 204 spec['logfile'] = 'csspec_py4.log'
... ... @@ -209,7 +209,7 @@ class Test(test):
209 209 spec.execute()
210 210  
211 211 # Check result file
212   - self._check_result_file('csspec_py4.fits', 10)
  212 + self._check_result_file('csspec_py4.fits', 2)
213 213  
214 214 # Set-up On/Off csspec using WSTAT
215 215 spec = cscripts.csspec()
... ... @@ -219,8 +219,8 @@ class Test(test):
219 219 spec['method'] = 'AUTO'
220 220 spec['statistic'] = 'WSTAT'
221 221 spec['ebinalg'] = 'LOG'
222   - spec['enumbins'] = 10
223   - spec['emin'] = 0.1
  222 + spec['enumbins'] = 2
  223 + spec['emin'] = 1.0
224 224 spec['emax'] = 10.0
225 225 spec['outfile'] = 'csspec_py5.fits'
226 226 spec['logfile'] = 'csspec_py5.log'
... ... @@ -230,7 +230,7 @@ class Test(test):
230 230 spec.execute()
231 231  
232 232 # Check result file
233   - self._check_result_file('csspec_py5.fits', 10)
  233 + self._check_result_file('csspec_py5.fits', 2)
234 234  
235 235 # Set-up csspec without multiprocessing
236 236 spec = cscripts.csspec()
... ... @@ -241,8 +241,8 @@ class Test(test):
241 241 spec['irf'] = self._irf
242 242 spec['method'] = 'AUTO'
243 243 spec['ebinalg'] = 'LOG'
244   - spec['enumbins'] = 5
245   - spec['emin'] = 0.1
  244 + spec['enumbins'] = 2
  245 + spec['emin'] = 1.0
246 246 spec['emax'] = 100.0
247 247 spec['outfile'] = 'csspec_py6.fits'
248 248 spec['logfile'] = 'csspec_py6.log'
... ... @@ -256,7 +256,7 @@ class Test(test):
256 256 spec.save()
257 257  
258 258 # Check result file
259   - self._check_result_file('csspec_py6.fits', 5)
  259 + self._check_result_file('csspec_py6.fits', 2)
260 260  
261 261 # Return
262 262 return
... ... @@ -278,8 +278,8 @@ class Test(test):
278 278 spec['irf'] = self._irf
279 279 spec['method'] = 'AUTO'
280 280 spec['ebinalg'] = 'LOG'
281   - spec['enumbins'] = 5
282   - spec['emin'] = 0.1
  281 + spec['enumbins'] = 2
  282 + spec['emin'] = 1.0
283 283 spec['emax'] = 100.0
284 284 spec['outfile'] = 'csspec_py1_pickle.fits'
285 285 spec['logfile'] = 'csspec_py1_pickle.log'
... ... @@ -295,7 +295,7 @@ class Test(test):
295 295 obj.save()
296 296  
297 297 # Check result file
298   - self._check_result_file('csspec_py1_pickle.fits', 5)
  298 + self._check_result_file('csspec_py1_pickle.fits', 2)
299 299  
300 300 # Return
301 301 return
... ...
test/test_cstsdist.py
... ... @@ -118,15 +118,15 @@ class Test(test):
118 118 """
119 119 # Set-up cstsdist for event list
120 120 tsdist = cscripts.cstsdist()
121   - tsdist['inobs'] = self._events
122   - tsdist['inmodel'] = self._model
123   - tsdist['srcname'] = 'Crab'
124   - tsdist['caldb'] = self._caldb
125   - tsdist['irf'] = self._irf
126   - tsdist['ntrials'] = 2
127   - tsdist['outfile'] = 'cstsdist_py1.dat'
128   - tsdist['logfile'] = 'cstsdist_py1.log'
129   - tsdist['chatter'] = 3
  121 + tsdist['inobs'] = self._events
  122 + tsdist['inmodel'] = self._model
  123 + tsdist['srcname'] = 'Crab'
  124 + tsdist['caldb'] = self._caldb
  125 + tsdist['irf'] = self._irf
  126 + tsdist['ntrials'] = 2
  127 + tsdist['outfile'] = 'cstsdist_py1.dat'
  128 + tsdist['logfile'] = 'cstsdist_py1.log'
  129 + tsdist['chatter'] = 3
130 130  
131 131 # Run cstsdist script
132 132 tsdist.logFileOpen() # Make sure we get a log file
... ... @@ -138,16 +138,16 @@ class Test(test):
138 138  
139 139 # Set-up cstsdist without multiprocessing
140 140 tsdist = cscripts.cstsdist()
141   - tsdist['inobs'] = self._events
142   - tsdist['inmodel'] = self._model
143   - tsdist['srcname'] = 'Crab'
144   - tsdist['caldb'] = self._caldb
145   - tsdist['irf'] = self._irf
146   - tsdist['ntrials'] = 2
147   - tsdist['outfile'] = 'cstsdist_py2.dat'
148   - tsdist['logfile'] = 'cstsdist_py2.log'
149   - tsdist['chatter'] = 3
150   - tsdist['nthreads'] = 1
  141 + tsdist['inobs'] = self._events
  142 + tsdist['inmodel'] = self._model
  143 + tsdist['srcname'] = 'Crab'
  144 + tsdist['caldb'] = self._caldb
  145 + tsdist['irf'] = self._irf
  146 + tsdist['ntrials'] = 2
  147 + tsdist['outfile'] = 'cstsdist_py2.dat'
  148 + tsdist['logfile'] = 'cstsdist_py2.log'
  149 + tsdist['chatter'] = 3
  150 + tsdist['nthreads'] = 1
151 151  
152 152 # Run cstsdist script
153 153 tsdist.logFileOpen() # Make sure we get a log file
... ... @@ -166,18 +166,18 @@ class Test(test):
166 166 """
167 167 # Set-up cstsdist for counts cube
168 168 tsdist = cscripts.cstsdist()
169   - tsdist['inobs'] = self._cntcube
170   - tsdist['inmodel'] = self._model
171   - tsdist['srcname'] = 'Crab'
172   - tsdist['expcube'] = 'NONE'
173   - tsdist['psfcube'] = 'NONE'
174   - tsdist['bkgcube'] = 'NONE'
175   - tsdist['caldb'] = self._caldb
176   - tsdist['irf'] = self._irf
177   - tsdist['ntrials'] = 2
178   - tsdist['outfile'] = 'cstsdist_py2.dat'
179   - tsdist['logfile'] = 'cstsdist_py2.log'
180   - tsdist['chatter'] = 4
  169 + tsdist['inobs'] = self._cntcube
  170 + tsdist['inmodel'] = self._model
  171 + tsdist['srcname'] = 'Crab'
  172 + tsdist['expcube'] = 'NONE'
  173 + tsdist['psfcube'] = 'NONE'
  174 + tsdist['bkgcube'] = 'NONE'
  175 + tsdist['caldb'] = self._caldb
  176 + tsdist['irf'] = self._irf
  177 + tsdist['ntrials'] = 2
  178 + tsdist['outfile'] = 'cstsdist_py2.dat'
  179 + tsdist['logfile'] = 'cstsdist_py2.log'
  180 + tsdist['chatter'] = 4
181 181  
182 182 # Run cstsdist script
183 183 tsdist.logFileOpen() # Make sure we get a log file
... ... @@ -195,13 +195,13 @@ class Test(test):
195 195 """
196 196 # Set-up cstsdist for stacked cube
197 197 tsdist = cscripts.cstsdist()
198   - tsdist['inobs'] = self._stacked_inobs
199   - tsdist['inmodel'] = self._stacked_model
200   - tsdist['srcname'] = 'Crab'
201   - tsdist['ntrials'] = 2
202   - tsdist['outfile'] = 'cstsdist_py3.dat'
203   - tsdist['logfile'] = 'cstsdist_py3.log'
204   - tsdist['chatter'] = 4
  198 + tsdist['inobs'] = self._stacked_inobs
  199 + tsdist['inmodel'] = self._stacked_model
  200 + tsdist['srcname'] = 'Crab'
  201 + tsdist['ntrials'] = 2
  202 + tsdist['outfile'] = 'cstsdist_py3.dat'
  203 + tsdist['logfile'] = 'cstsdist_py3.log'
  204 + tsdist['chatter'] = 4
205 205  
206 206 # Run cstsdist script
207 207 tsdist.logFileOpen() # Make sure we get a log file
... ... @@ -223,15 +223,15 @@ class Test(test):
223 223  
224 224 # Set-up cstsdist for event list
225 225 tsdist = cscripts.cstsdist()
226   - tsdist['inobs'] = self._events
227   - tsdist['inmodel'] = self._model
228   - tsdist['srcname'] = 'Crab'
229   - tsdist['caldb'] = self._caldb
230   - tsdist['irf'] = self._irf
231   - tsdist['ntrials'] = 2
232   - tsdist['outfile'] = 'cstsdist_py1_pickle.dat'
233   - tsdist['logfile'] = 'cstsdist_py1_pickle.log'
234   - tsdist['chatter'] = 3
  226 + tsdist['inobs'] = self._events
  227 + tsdist['inmodel'] = self._model
  228 + tsdist['srcname'] = 'Crab'
  229 + tsdist['caldb'] = self._caldb
  230 + tsdist['irf'] = self._irf
  231 + tsdist['ntrials'] = 2
  232 + tsdist['outfile'] = 'cstsdist_py1_pickle.dat'
  233 + tsdist['logfile'] = 'cstsdist_py1_pickle.log'
  234 + tsdist['chatter'] = 3
235 235  
236 236 # Perform pickeling tests of filled class
237 237 obj = self._pickeling(tsdist)
... ...