diff --git a/test/test_cslightcrv.py b/test/test_cslightcrv.py index 8723e32..5ecfa37 100755 --- a/test/test_cslightcrv.py +++ b/test/test_cslightcrv.py @@ -79,7 +79,7 @@ class Test(test): ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ ' tbinalg=LIN '+ \ ' tmin=2020-01-01T00:00:00 tmax=2020-01-01T00:05:00'+ \ - ' tbins=3 method=3D enumbins=0 emin=0.1 emax=100.0'+ \ + ' tbins=2 method=3D enumbins=0 emin=1.0 emax=100.0'+ \ ' outfile="lightcurve_cmd1.fits"'+ \ ' logfile="cslightcrv_cmd1.log" chatter=1' @@ -88,7 +88,7 @@ class Test(test): 'Check successful execution from command line') # Check light curve - self._check_light_curve('lightcurve_cmd1.fits', 3) + self._check_light_curve('lightcurve_cmd1.fits', 2) # Setup cslightcrv command cmd = cslightcrv+' inobs="events_that_do_not_exist.fits"'+ \ @@ -96,7 +96,7 @@ class Test(test): ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ ' tbinalg=LIN '+ \ ' tmin=2020-01-01T00:00:00 tmax=2020-01-01T00:05:00'+ \ - ' tbins=3 method=3D enumbins=0 emin=0.1 emax=100.0'+ \ + ' tbins=2 method=3D enumbins=0 emin=1.0 emax=100.0'+ \ ' outfile="lightcurve_cmd1.fits"'+ \ ' logfile="cslightcrv_cmd2.log" debug=yes' @@ -125,10 +125,10 @@ class Test(test): lcrv['tbinalg'] = 'LIN' lcrv['tmin'] = '2020-01-01T00:00:00' lcrv['tmax'] = '2020-01-01T00:05:00' - lcrv['tbins'] = 3 + lcrv['tbins'] = 2 lcrv['method'] = '3D' lcrv['enumbins'] = 0 - lcrv['emin'] = 0.1 + lcrv['emin'] = 1.0 lcrv['emax'] = 100.0 lcrv['outfile'] = 'cslightcrv_py1.fits' lcrv['logfile'] = 'cslightcrv_py1.log' @@ -141,10 +141,10 @@ class Test(test): lcrv.save() # Check light curve - self._check_light_curve('cslightcrv_py1.fits', 3) + self._check_light_curve('cslightcrv_py1.fits', 2) # Now use FILE as time bin algorithm. For this we need first to - # create an ASCII file. We use now 6 time bins. The ASCII file + # create an ASCII file. We use now 2 time bins. The ASCII file # is saved into the file "lightcurve_py2.dat". csv = gammalib.GCsv(2,2) tmin = 58849.00 @@ -165,7 +165,7 @@ class Test(test): lcrv['tbinfile'] = 'cslightcrv_py2.dat' lcrv['method'] = '3D' lcrv['enumbins'] = 0 - lcrv['emin'] = 0.1 + lcrv['emin'] = 1.0 lcrv['emax'] = 100.0 lcrv['fix_bkg'] = True lcrv['outfile'] = 'cslightcrv_py2.fits' @@ -195,7 +195,7 @@ class Test(test): lcrv['tbinalg'] = 'GTI' lcrv['method'] = '3D' lcrv['enumbins'] = 0 - lcrv['emin'] = 0.1 + lcrv['emin'] = 1.0 lcrv['emax'] = 100.0 lcrv['outfile'] = 'cslightcrv_py3.fits' lcrv['logfile'] = 'cslightcrv_py3.log' @@ -219,16 +219,16 @@ class Test(test): lcrv['tmax'] = '2020-01-01T00:05:00' lcrv['tbins'] = 2 lcrv['method'] = '3D' - lcrv['emin'] = 0.1 + lcrv['emin'] = 1.0 lcrv['emax'] = 100.0 - lcrv['enumbins'] = 10 + lcrv['enumbins'] = 3 lcrv['coordsys'] = 'CEL' lcrv['proj'] = 'TAN' lcrv['xref'] = 83.63 lcrv['yref'] = 22.01 - lcrv['nxpix'] = 20 - lcrv['nypix'] = 20 - lcrv['binsz'] = 0.02 + lcrv['nxpix'] = 10 + lcrv['nypix'] = 10 + lcrv['binsz'] = 0.04 lcrv['outfile'] = 'cslightcrv_py4.fits' lcrv['logfile'] = 'cslightcrv_py4.log' lcrv['chatter'] = 4 @@ -251,16 +251,16 @@ class Test(test): lcrv['tmax'] = '2020-01-01T00:05:00' lcrv['tbins'] = 2 lcrv['method'] = 'ONOFF' - lcrv['emin'] = 0.1 + lcrv['emin'] = 1.0 lcrv['emax'] = 100.0 - lcrv['enumbins'] = 10 + lcrv['enumbins'] = 2 lcrv['coordsys'] = 'CEL' lcrv['xref'] = 83.63 lcrv['yref'] = 22.01 lcrv['rad'] = 0.2 - lcrv['etruemin'] = 0.05 - lcrv['etruemax'] = 150.0 - lcrv['etruebins'] = 20 + lcrv['etruemin'] = 1.0 + lcrv['etruemax'] = 100.0 + lcrv['etruebins'] = 5 lcrv['statistic'] = 'WSTAT' lcrv['outfile'] = 'cslightcrv_py5.fits' lcrv['logfile'] = 'cslightcrv_py5.log' @@ -274,23 +274,23 @@ class Test(test): # Set-up cslightcrv without multiprocessing lcrv = cscripts.cslightcrv() - lcrv['inobs'] = self._events - lcrv['inmodel'] = self._model - lcrv['srcname'] = 'Crab' - lcrv['caldb'] = self._caldb - lcrv['irf'] = self._irf - lcrv['tbinalg'] = 'LIN' - lcrv['tmin'] = '2020-01-01T00:00:00' - lcrv['tmax'] = '2020-01-01T00:05:00' - lcrv['tbins'] = 3 - lcrv['method'] = '3D' + lcrv['inobs'] = self._events + lcrv['inmodel'] = self._model + lcrv['srcname'] = 'Crab' + lcrv['caldb'] = self._caldb + lcrv['irf'] = self._irf + lcrv['tbinalg'] = 'LIN' + lcrv['tmin'] = '2020-01-01T00:00:00' + lcrv['tmax'] = '2020-01-01T00:05:00' + lcrv['tbins'] = 2 + lcrv['method'] = '3D' lcrv['enumbins'] = 0 - lcrv['emin'] = 0.1 - lcrv['emax'] = 100.0 - lcrv['outfile'] = 'cslightcrv_py6.fits' - lcrv['logfile'] = 'cslightcrv_py6.log' - lcrv['chatter'] = 2 - lcrv['publish'] = True + lcrv['emin'] = 1.0 + lcrv['emax'] = 100.0 + lcrv['outfile'] = 'cslightcrv_py6.fits' + lcrv['logfile'] = 'cslightcrv_py6.log' + lcrv['chatter'] = 2 + lcrv['publish'] = True lcrv['nthreads'] = 1 # Run cslightcrv script and save light curve @@ -299,7 +299,7 @@ class Test(test): lcrv.save() # Check light curve - self._check_light_curve('cslightcrv_py6.fits', 3) + self._check_light_curve('cslightcrv_py6.fits', 2) # Return return @@ -322,10 +322,10 @@ class Test(test): lcrv['tbinalg'] = 'LIN' lcrv['tmin'] = '2020-01-01T00:00:00' lcrv['tmax'] = '2020-01-01T00:05:00' - lcrv['tbins'] = 3 + lcrv['tbins'] = 2 lcrv['method'] = '3D' lcrv['enumbins'] = 0 - lcrv['emin'] = 0.1 + lcrv['emin'] = 1.0 lcrv['emax'] = 100.0 lcrv['outfile'] = 'cslightcrv_py1_pickle.fits' lcrv['logfile'] = 'cslightcrv_py1_pickle.log' @@ -341,7 +341,7 @@ class Test(test): obj.save() # Check light curve - self._check_light_curve('cslightcrv_py1_pickle.fits', 3) + self._check_light_curve('cslightcrv_py1_pickle.fits', 2) # Return return @@ -379,7 +379,7 @@ class Test(test): # Check that the Prefactor has the right order of magnitude for s in range(table.nrows()): - self.test_value(table['Prefactor'][s], prefactor, 0.2*prefactor, + self.test_value(table['Prefactor'][s], prefactor, 0.9*prefactor, 'Check prefactor value') # Close FITS file diff --git a/test/test_csphasecrv.py b/test/test_csphasecrv.py index d437ec5..e3f4371 100755 --- a/test/test_csphasecrv.py +++ b/test/test_csphasecrv.py @@ -78,8 +78,8 @@ class Test(test): cmd = csphasecrv+' inobs="'+self._phased_events+'"'+ \ ' inmodel="'+self._model+'" srcname="Crab"'+ \ ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ - ' phbinalg="LIN" phbins=5 method="3D"'+ \ - ' enumbins=0 emin=0.1 emax=100.0'+ \ + ' phbinalg="LIN" phbins=2 method="3D"'+ \ + ' enumbins=0 emin=1.0 emax=100.0'+ \ ' outfile="csphasecrv_cmd1.fits"'+ \ ' logfile="csphasecrv_cmd1.log" chatter=1' @@ -88,14 +88,14 @@ class Test(test): 'Check successful execution from command line') # Check phase curve - self._check_phase_curve('csphasecrv_cmd1.fits', 5) + self._check_phase_curve('csphasecrv_cmd1.fits', 2) # Setup csphasecrv command cmd = csphasecrv+' inobs="events_that_do_not_exist.fits"'+ \ ' inmodel="'+self._model+'" srcname="Crab"'+ \ ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ - ' phbinalg="LIN" phbins=5 method="3D"'+ \ - ' enumbins=0 emin=0.1 emax=100.0'+ \ + ' phbinalg="LIN" phbins=2 method="3D"'+ \ + ' enumbins=0 emin=1.0 emax=100.0'+ \ ' outfile="csphasecrv_cmd2.fits"'+ \ ' logfile="csphasecrv_cmd2.log" debug=yes chatter=1' @@ -122,10 +122,10 @@ class Test(test): pcrv['caldb'] = self._caldb pcrv['irf'] = self._irf pcrv['phbinalg'] = 'LIN' - pcrv['phbins'] = 5 + pcrv['phbins'] = 2 pcrv['method'] = '3D' pcrv['enumbins'] = 0 - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 pcrv['outfile'] = 'csphasecrv_py1.fits' pcrv['logfile'] = 'csphasecrv_py1.log' @@ -138,7 +138,7 @@ class Test(test): pcrv.save() # Check phase curve - self._check_phase_curve('csphasecrv_py1.fits', 5) + self._check_phase_curve('csphasecrv_py1.fits', 2) # Now use FILE as time bin algorithm. For this we need first to # create an ASCII file. We use now 2 phase bins. The ASCII file @@ -162,7 +162,7 @@ class Test(test): pcrv['phbinfile'] = 'csphasecrv_py2.dat' pcrv['method'] = '3D' pcrv['enumbins'] = 0 - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 pcrv['outfile'] = 'csphasecrv_py2.fits' pcrv['logfile'] = 'csphasecrv_py2.log' @@ -190,10 +190,10 @@ class Test(test): pcrv['caldb'] = self._caldb pcrv['irf'] = self._irf pcrv['phbinalg'] = 'LIN' - pcrv['phbins'] = 5 + pcrv['phbins'] = 2 pcrv['method'] = '3D' pcrv['enumbins'] = 0 - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 pcrv['outfile'] = 'csphasecrv_py3.fits' pcrv['logfile'] = 'csphasecrv_py3.log' @@ -204,7 +204,7 @@ class Test(test): pcrv.execute() # Check phase curve - self._check_phase_curve('csphasecrv_py3.fits', 5) + self._check_phase_curve('csphasecrv_py3.fits', 2) # Binned csphasecrv pcrv = cscripts.csphasecrv() @@ -216,16 +216,16 @@ class Test(test): pcrv['phbinalg'] = 'LIN' pcrv['phbins'] = 2 pcrv['method'] = '3D' - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 - pcrv['enumbins'] = 10 + pcrv['enumbins'] = 2 pcrv['coordsys'] = 'CEL' pcrv['proj'] = 'TAN' pcrv['xref'] = 83.63 pcrv['yref'] = 22.01 - pcrv['nxpix'] = 20 - pcrv['nypix'] = 20 - pcrv['binsz'] = 0.02 + pcrv['nxpix'] = 10 + pcrv['nypix'] = 10 + pcrv['binsz'] = 0.04 pcrv['outfile'] = 'csphasecrv_py4.fits' pcrv['logfile'] = 'csphasecrv_py4.log' pcrv['chatter'] = 4 @@ -248,15 +248,15 @@ class Test(test): pcrv['phbins'] = 2 pcrv['method'] = 'ONOFF' pcrv['statistic'] = 'WSTAT' - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 - pcrv['enumbins'] = 10 + pcrv['enumbins'] = 2 pcrv['coordsys'] = 'CEL' pcrv['xref'] = 83.63 pcrv['yref'] = 22.01 pcrv['rad'] = 0.2 - pcrv['etruemin'] = 0.05 - pcrv['etruemax'] = 150.0 + pcrv['etruemin'] = 1.0 + pcrv['etruemax'] = 100.0 pcrv['etruebins'] = 5 pcrv['outfile'] = 'csphasecrv_py5.fits' pcrv['logfile'] = 'csphasecrv_py5.log' @@ -277,10 +277,10 @@ class Test(test): pcrv['caldb'] = self._caldb pcrv['irf'] = self._irf pcrv['phbinalg'] = 'LIN' - pcrv['phbins'] = 5 + pcrv['phbins'] = 2 pcrv['method'] = '3D' pcrv['enumbins'] = 0 - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 pcrv['outfile'] = 'csphasecrv_py6.fits' pcrv['logfile'] = 'csphasecrv_py6.log' @@ -294,7 +294,7 @@ class Test(test): pcrv.save() # Check phase curve - self._check_phase_curve('csphasecrv_py6.fits', 5) + self._check_phase_curve('csphasecrv_py6.fits', 2) # Return return @@ -315,10 +315,10 @@ class Test(test): pcrv['caldb'] = self._caldb pcrv['irf'] = self._irf pcrv['phbinalg'] = 'LIN' - pcrv['phbins'] = 5 + pcrv['phbins'] = 2 pcrv['method'] = '3D' pcrv['enumbins'] = 0 - pcrv['emin'] = 0.1 + pcrv['emin'] = 1.0 pcrv['emax'] = 100.0 pcrv['outfile'] = 'csphasecrv_py1_pickle.fits' pcrv['logfile'] = 'csphasecrv_py1_pickle.log' @@ -334,7 +334,7 @@ class Test(test): obj.save() # Check phase curve - self._check_phase_curve('csphasecrv_py1_pickle.fits', 5) + self._check_phase_curve('csphasecrv_py1_pickle.fits', 2) # Return return diff --git a/test/test_cspull.py b/test/test_cspull.py index e2c8f7a..cc5e2c1 100755 --- a/test/test_cspull.py +++ b/test/test_cspull.py @@ -80,7 +80,7 @@ class Test(test): ' outfile="cspull_cmd1.dat"'+ \ ' ntrials=2'+ \ ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ - ' ra=83.6331 dec=22.0145 emin=0.1 emax=100.0'+ \ + ' ra=83.6331 dec=22.0145 emin=1.0 emax=100.0'+ \ ' enumbins=0 tmin=0.0 tmax=100.0 deadc=0.98 rad=5.0'+ \ ' npix=200 binsz=0.05'+ \ ' logfile="cspull_cmd1.log" chatter=1' @@ -97,7 +97,7 @@ class Test(test): ' outfile="cspull_cmd1.dat"'+ \ ' ntrials=2'+ \ ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ - ' ra=83.6331 dec=22.0145 emin=0.1 emax=100.0'+ \ + ' ra=83.6331 dec=22.0145 emin=1.0 emax=100.0'+ \ ' enumbins=0 tmin=0.0 tmax=100.0 deadc=0.98 rad=5.0'+ \ ' npix=200 binsz=0.05'+ \ ' logfile="cspull_cmd2.log" debug=yes' @@ -127,7 +127,7 @@ class Test(test): pull['irf'] = self._irf pull['ra'] = 83.6331 pull['dec'] = 22.0145 - pull['emin'] = 0.1 + pull['emin'] = 1.0 pull['emax'] = 100.0 pull['enumbins'] = 0 pull['tmin'] = 0.0 @@ -140,7 +140,6 @@ class Test(test): # Run cspull script pull.logFileOpen() # Make sure we get a log file pull.run() - #pull.save() # Check pull distribution file self._check_pull_file('cspull_py1.dat') @@ -155,14 +154,14 @@ class Test(test): pull['irf'] = self._irf pull['ra'] = 83.6331 pull['dec'] = 22.0145 - pull['emin'] = 0.1 + pull['emin'] = 1.0 pull['emax'] = 100.0 - pull['enumbins'] = 10 + pull['enumbins'] = 2 pull['tmin'] = 0.0 pull['tmax'] = 100.0 pull['deadc'] = 0.98 pull['rad'] = 5.0 - pull['npix'] = 20 + pull['npix'] = 10 pull['binsz'] = 0.2 pull['coordsys'] = 'CEL' pull['proj'] = 'TAN' @@ -245,10 +244,10 @@ class Test(test): pull['onsrc'] = 'NONE' pull['outfile'] = 'cspull_py6.dat' pull['ntrials'] = 1 - pull['emin'] = 0.02 + pull['emin'] = 1.0 pull['emax'] = 100.0 - pull['enumbins'] = 10 - pull['npix'] = 20 + pull['enumbins'] = 2 + pull['npix'] = 10 pull['binsz'] = 0.2 pull['coordsys'] = 'CEL' pull['proj'] = 'TAN' @@ -271,7 +270,7 @@ class Test(test): pull['irf'] = self._irf pull['ra'] = 83.6331 pull['dec'] = 22.0145 - pull['emin'] = 0.1 + pull['emin'] = 1.0 pull['emax'] = 100.0 pull['enumbins'] = 0 pull['tmin'] = 0.0 @@ -309,7 +308,7 @@ class Test(test): pull['irf'] = self._irf pull['ra'] = 83.6331 pull['dec'] = 22.0145 - pull['emin'] = 0.1 + pull['emin'] = 1.0 pull['emax'] = 100.0 pull['enumbins'] = 0 pull['tmin'] = 0.0 @@ -326,7 +325,6 @@ class Test(test): # Run csphasecrv script and save light curve obj.logFileOpen() # Make sure we get a log file obj.run() - #obj.save() # Check pull distribution file self._check_pull_file('cspull_py1_pickle.dat') diff --git a/test/test_csresspec.py b/test/test_csresspec.py index a48d334..00d690e 100755 --- a/test/test_csresspec.py +++ b/test/test_csresspec.py @@ -77,7 +77,7 @@ class Test(test): ' outfile="csresspec_cmd1.fits"' + \ ' inmodel="' + self._model + '"' + \ ' caldb="' + self._caldb + '" irf="' + self._irf + '"' + \ - ' emin=0.1 emax=100.0 enumbins=20 ebinalg="LOG"' + \ + ' emin=1.0 emax=100.0 enumbins=2 ebinalg="LOG"' + \ ' mask=no algorithm="SUB"' + \ ' logfile="csresspec_cmd1.log" chatter=4' @@ -86,14 +86,14 @@ class Test(test): 'Check successful execution from command line') # Check result file - self._check_result_file('csresspec_cmd1.fits', 20, 5) + self._check_result_file('csresspec_cmd1.fits', 2, 5) # Setup csresspec command cmd = csresspec + ' inobs="event_file_that_does_not_exist.fits"' + \ ' outfile="csresspec_cmd2.fits"' + \ ' inmodel="' + self._model + '"' + \ ' caldb="' + self._caldb + '" irf="' + self._irf + '"' + \ - ' emin=0.1 emax=100.0 enumbins=20 ebinalg="LOG"' + \ + ' emin=1.0 emax=100.0 enumbins=2 ebinalg="LOG"' + \ ' mask=no algorithm="SUBDIVSQRT"' + \ ' logfile="csresspec_cmd2.log" debug=yes chatter=2' @@ -120,9 +120,9 @@ class Test(test): resspec['caldb'] = self._caldb resspec['irf'] = self._irf resspec['ebinalg'] = 'LOG' - resspec['emin'] = 0.1 + resspec['emin'] = 1.0 resspec['emax'] = 100.0 - resspec['enumbins'] = 20 + resspec['enumbins'] = 2 resspec['mask'] = False resspec['algorithm'] = 'SUB' resspec['logfile'] = 'csresspec_py1.log' @@ -134,7 +134,7 @@ class Test(test): resspec.save() # Check result file - self._check_result_file('csresspec_py1.fits', 20, 5) + self._check_result_file('csresspec_py1.fits', 2, 5) # Set-up csresspec for event list with computation of individual # model components @@ -145,9 +145,9 @@ class Test(test): resspec['caldb'] = self._caldb resspec['irf'] = self._irf resspec['ebinalg'] = 'LOG' - resspec['emin'] = 0.1 + resspec['emin'] = 1.0 resspec['emax'] = 100.0 - resspec['enumbins'] = 20 + resspec['enumbins'] = 2 resspec['mask'] = False resspec['algorithm'] = 'SUBDIV' resspec['components'] = True @@ -158,7 +158,7 @@ class Test(test): resspec.execute() # Check result file - self._check_result_file('csresspec_py2.fits', 20, 7) + self._check_result_file('csresspec_py2.fits', 2, 7) # Set-up csresspec for counts cube resspec = cscripts.csresspec() diff --git a/test/test_csspec.py b/test/test_csspec.py index 7b46b86..1126f52 100755 --- a/test/test_csspec.py +++ b/test/test_csspec.py @@ -84,7 +84,7 @@ class Test(test): ' inmodel="'+self._model+'"'+ \ ' srcname="Crab" method="AUTO"'+ \ ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ - ' ebinalg="LOG" enumbins=5 emin=0.1 emax=100.0'+ \ + ' ebinalg="LOG" enumbins=2 emin=1.0 emax=100.0'+ \ ' outfile="csspec_cmd1.fits"'+ \ ' logfile="csspec_cmd1.log" chatter=1' @@ -93,14 +93,14 @@ class Test(test): 'Check successful execution from command line') # Check result file - self._check_result_file('csspec_cmd1.fits', 5) + self._check_result_file('csspec_cmd1.fits', 2) # Setup csspec command cmd = csspec+' inobs="input_file_that_does_not_exist.fits"'+ \ ' inmodel="'+self._model+'"'+ \ ' srcname="Crab" method="AUTO"'+ \ ' caldb="'+self._caldb+'" irf="'+self._irf+'"'+ \ - ' ebinalg="LOG" enumbins=5 emin=0.1 emax=100.0'+ \ + ' ebinalg="LOG" enumbins=2 emin=1.0 emax=100.0'+ \ ' outfile="csspec_cmd2.fits"'+ \ ' logfile="csspec_cmd2.log" debug=yes chatter=1' @@ -128,8 +128,8 @@ class Test(test): spec['irf'] = self._irf spec['method'] = 'AUTO' spec['ebinalg'] = 'LOG' - spec['enumbins'] = 5 - spec['emin'] = 0.1 + spec['enumbins'] = 2 + spec['emin'] = 1.0 spec['emax'] = 100.0 spec['outfile'] = 'csspec_py1.fits' spec['logfile'] = 'csspec_py1.log' @@ -142,7 +142,7 @@ class Test(test): spec.save() # Check result file - self._check_result_file('csspec_py1.fits', 5) + self._check_result_file('csspec_py1.fits', 2) # Set-up stacked csspec spec = cscripts.csspec() @@ -176,8 +176,8 @@ class Test(test): spec['srcname'] = 'Crab' spec['method'] = 'AUTO' spec['ebinalg'] = 'LOG' - spec['enumbins'] = 10 - spec['emin'] = 0.1 + spec['enumbins'] = 2 + spec['emin'] = 1.0 spec['emax'] = 10.0 spec['outfile'] = 'csspec_py3.fits' spec['logfile'] = 'csspec_py3.log' @@ -188,7 +188,7 @@ class Test(test): spec.execute() # Check result file - self._check_result_file('csspec_py3.fits', 10) + self._check_result_file('csspec_py3.fits', 2) # Set-up On/Off csspec with NODES method spec = cscripts.csspec() @@ -197,8 +197,8 @@ class Test(test): spec['srcname'] = 'Crab' spec['method'] = 'NODES' spec['ebinalg'] = 'LOG' - spec['enumbins'] = 10 - spec['emin'] = 0.1 + spec['enumbins'] = 2 + spec['emin'] = 1.0 spec['emax'] = 10.0 spec['outfile'] = 'csspec_py4.fits' spec['logfile'] = 'csspec_py4.log' @@ -209,7 +209,7 @@ class Test(test): spec.execute() # Check result file - self._check_result_file('csspec_py4.fits', 10) + self._check_result_file('csspec_py4.fits', 2) # Set-up On/Off csspec using WSTAT spec = cscripts.csspec() @@ -219,8 +219,8 @@ class Test(test): spec['method'] = 'AUTO' spec['statistic'] = 'WSTAT' spec['ebinalg'] = 'LOG' - spec['enumbins'] = 10 - spec['emin'] = 0.1 + spec['enumbins'] = 2 + spec['emin'] = 1.0 spec['emax'] = 10.0 spec['outfile'] = 'csspec_py5.fits' spec['logfile'] = 'csspec_py5.log' @@ -230,7 +230,7 @@ class Test(test): spec.execute() # Check result file - self._check_result_file('csspec_py5.fits', 10) + self._check_result_file('csspec_py5.fits', 2) # Set-up csspec without multiprocessing spec = cscripts.csspec() @@ -241,8 +241,8 @@ class Test(test): spec['irf'] = self._irf spec['method'] = 'AUTO' spec['ebinalg'] = 'LOG' - spec['enumbins'] = 5 - spec['emin'] = 0.1 + spec['enumbins'] = 2 + spec['emin'] = 1.0 spec['emax'] = 100.0 spec['outfile'] = 'csspec_py6.fits' spec['logfile'] = 'csspec_py6.log' @@ -256,7 +256,7 @@ class Test(test): spec.save() # Check result file - self._check_result_file('csspec_py6.fits', 5) + self._check_result_file('csspec_py6.fits', 2) # Return return @@ -278,8 +278,8 @@ class Test(test): spec['irf'] = self._irf spec['method'] = 'AUTO' spec['ebinalg'] = 'LOG' - spec['enumbins'] = 5 - spec['emin'] = 0.1 + spec['enumbins'] = 2 + spec['emin'] = 1.0 spec['emax'] = 100.0 spec['outfile'] = 'csspec_py1_pickle.fits' spec['logfile'] = 'csspec_py1_pickle.log' @@ -295,7 +295,7 @@ class Test(test): obj.save() # Check result file - self._check_result_file('csspec_py1_pickle.fits', 5) + self._check_result_file('csspec_py1_pickle.fits', 2) # Return return diff --git a/test/test_cstsdist.py b/test/test_cstsdist.py index 0324f41..d52e5a1 100755 --- a/test/test_cstsdist.py +++ b/test/test_cstsdist.py @@ -118,15 +118,15 @@ class Test(test): """ # Set-up cstsdist for event list tsdist = cscripts.cstsdist() - tsdist['inobs'] = self._events - tsdist['inmodel'] = self._model - tsdist['srcname'] = 'Crab' - tsdist['caldb'] = self._caldb - tsdist['irf'] = self._irf - tsdist['ntrials'] = 2 - tsdist['outfile'] = 'cstsdist_py1.dat' - tsdist['logfile'] = 'cstsdist_py1.log' - tsdist['chatter'] = 3 + tsdist['inobs'] = self._events + tsdist['inmodel'] = self._model + tsdist['srcname'] = 'Crab' + tsdist['caldb'] = self._caldb + tsdist['irf'] = self._irf + tsdist['ntrials'] = 2 + tsdist['outfile'] = 'cstsdist_py1.dat' + tsdist['logfile'] = 'cstsdist_py1.log' + tsdist['chatter'] = 3 # Run cstsdist script tsdist.logFileOpen() # Make sure we get a log file @@ -138,16 +138,16 @@ class Test(test): # Set-up cstsdist without multiprocessing tsdist = cscripts.cstsdist() - tsdist['inobs'] = self._events - tsdist['inmodel'] = self._model - tsdist['srcname'] = 'Crab' - tsdist['caldb'] = self._caldb - tsdist['irf'] = self._irf - tsdist['ntrials'] = 2 - tsdist['outfile'] = 'cstsdist_py2.dat' - tsdist['logfile'] = 'cstsdist_py2.log' - tsdist['chatter'] = 3 - tsdist['nthreads'] = 1 + tsdist['inobs'] = self._events + tsdist['inmodel'] = self._model + tsdist['srcname'] = 'Crab' + tsdist['caldb'] = self._caldb + tsdist['irf'] = self._irf + tsdist['ntrials'] = 2 + tsdist['outfile'] = 'cstsdist_py2.dat' + tsdist['logfile'] = 'cstsdist_py2.log' + tsdist['chatter'] = 3 + tsdist['nthreads'] = 1 # Run cstsdist script tsdist.logFileOpen() # Make sure we get a log file @@ -166,18 +166,18 @@ class Test(test): """ # Set-up cstsdist for counts cube tsdist = cscripts.cstsdist() - tsdist['inobs'] = self._cntcube - tsdist['inmodel'] = self._model - tsdist['srcname'] = 'Crab' - tsdist['expcube'] = 'NONE' - tsdist['psfcube'] = 'NONE' - tsdist['bkgcube'] = 'NONE' - tsdist['caldb'] = self._caldb - tsdist['irf'] = self._irf - tsdist['ntrials'] = 2 - tsdist['outfile'] = 'cstsdist_py2.dat' - tsdist['logfile'] = 'cstsdist_py2.log' - tsdist['chatter'] = 4 + tsdist['inobs'] = self._cntcube + tsdist['inmodel'] = self._model + tsdist['srcname'] = 'Crab' + tsdist['expcube'] = 'NONE' + tsdist['psfcube'] = 'NONE' + tsdist['bkgcube'] = 'NONE' + tsdist['caldb'] = self._caldb + tsdist['irf'] = self._irf + tsdist['ntrials'] = 2 + tsdist['outfile'] = 'cstsdist_py2.dat' + tsdist['logfile'] = 'cstsdist_py2.log' + tsdist['chatter'] = 4 # Run cstsdist script tsdist.logFileOpen() # Make sure we get a log file @@ -195,13 +195,13 @@ class Test(test): """ # Set-up cstsdist for stacked cube tsdist = cscripts.cstsdist() - tsdist['inobs'] = self._stacked_inobs - tsdist['inmodel'] = self._stacked_model - tsdist['srcname'] = 'Crab' - tsdist['ntrials'] = 2 - tsdist['outfile'] = 'cstsdist_py3.dat' - tsdist['logfile'] = 'cstsdist_py3.log' - tsdist['chatter'] = 4 + tsdist['inobs'] = self._stacked_inobs + tsdist['inmodel'] = self._stacked_model + tsdist['srcname'] = 'Crab' + tsdist['ntrials'] = 2 + tsdist['outfile'] = 'cstsdist_py3.dat' + tsdist['logfile'] = 'cstsdist_py3.log' + tsdist['chatter'] = 4 # Run cstsdist script tsdist.logFileOpen() # Make sure we get a log file @@ -223,15 +223,15 @@ class Test(test): # Set-up cstsdist for event list tsdist = cscripts.cstsdist() - tsdist['inobs'] = self._events - tsdist['inmodel'] = self._model - tsdist['srcname'] = 'Crab' - tsdist['caldb'] = self._caldb - tsdist['irf'] = self._irf - tsdist['ntrials'] = 2 - tsdist['outfile'] = 'cstsdist_py1_pickle.dat' - tsdist['logfile'] = 'cstsdist_py1_pickle.log' - tsdist['chatter'] = 3 + tsdist['inobs'] = self._events + tsdist['inmodel'] = self._model + tsdist['srcname'] = 'Crab' + tsdist['caldb'] = self._caldb + tsdist['irf'] = self._irf + tsdist['ntrials'] = 2 + tsdist['outfile'] = 'cstsdist_py1_pickle.dat' + tsdist['logfile'] = 'cstsdist_py1_pickle.log' + tsdist['chatter'] = 3 # Perform pickeling tests of filled class obj = self._pickeling(tsdist)