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