Commit 75d3a3e67931348011de2df93f5a0fd0e06804d6

Authored by Jürgen Knödlseder
1 parent 433c9b7b

Correct ctbin unit test

Showing 1 changed file with 22 additions and 14 deletions
test/test_ctbin.py
... ... @@ -132,11 +132,11 @@ class Test(test):
132 132 'Check successful execution from command line with stack=no')
133 133  
134 134 # Load counts cubes and check content.
135   - evt = gammalib.GCTAEventCube('cntmap_cmd4_00001.fits')
  135 + evt = gammalib.GCTAEventCube('cntmap_cmd4_cta_00001.fits')
136 136 self._check_cube(evt, 245)
137 137  
138 138 # Load counts cubes and check content.
139   - evt = gammalib.GCTAEventCube('cntmap_cmd4_00002.fits')
  139 + evt = gammalib.GCTAEventCube('cntmap_cmd4_cta_00002.fits')
140 140 self._check_cube(evt, 245)
141 141  
142 142 # Check observation definition XML output file
... ... @@ -283,8 +283,8 @@ class Test(test):
283 283 evt = gammalib.GCTAEventCube('ctbin_py3.fits')
284 284 self._check_cube(evt, 245, multiplier=3)
285 285  
286   - # And finally go for a fully Pythonic version with all parameters
287   - # being specified in a dictionary
  286 + # Now go for a fully Pythonic version with all parameters being
  287 + # specified in a dictionary
288 288 pars = {'inobs': self._events, 'ebinalg': 'LIN', 'emin': 1.0,
289 289 'emax': 100.0, 'enumbins': 10, 'nxpix': 40, 'nypix': 40,
290 290 'binsz': 0.1, 'coordsys': 'CEL', 'proj': 'CAR',
... ... @@ -300,15 +300,23 @@ class Test(test):
300 300 self._check_cube(evt, 245)
301 301  
302 302 # Test unstacked version
303   - pars = {'inobs': self._datadir+'/obs_unbinned_two.xml', 'ebinalg': 'LIN', 'emin': 1.0,
304   - 'emax': 100.0, 'enumbins': 10, 'nxpix': 40, 'nypix': 40,
305   - 'binsz': 0.1, 'coordsys': 'CEL', 'proj': 'CAR',
306   - 'xref': 83.63, 'yref': 22.01, 'outobs': 'ctbin_py5.xml',
307   - 'logfile': 'ctbin_py5.log', 'chatter': 2,
308   - 'prefix': 'cntcube_py5_', 'stack' : False}
309 303 binning = ctools.ctbin()
310   - binning.pardict(pars)
311   -
  304 + binning['inobs'] = self._inobs_two
  305 + binning['stack'] = False
  306 + binning['ebinalg'] = 'LOG'
  307 + binning['emin'] = 1.0
  308 + binning['emax'] = 100.0
  309 + binning['enumbins'] = 10
  310 + binning['nxpix'] = 40
  311 + binning['nypix'] = 40
  312 + binning['binsz'] = 0.1
  313 + binning['coordsys'] = 'CEL'
  314 + binning['proj'] = 'CAR'
  315 + binning['xref'] = 83.63
  316 + binning['yref'] = 22.01
  317 + binning['outobs'] = 'ctbin_py5.fits'
  318 + binning['logfile'] = 'ctbin_py5.log'
  319 + binning['chatter'] = 2
312 320 binning.logFileOpen()
313 321 binning.run()
314 322  
... ... @@ -330,9 +338,9 @@ class Test(test):
330 338 self._check_cube(evt, 245)
331 339  
332 340 # Load counts cubes and check content
333   - evt = gammalib.GCTAEventCube('cntcube_py5_00001.fits')
  341 + evt = gammalib.GCTAEventCube('cntcube_py5_cta_00001.fits')
334 342 self._check_cube(evt, 245)
335   - evt = gammalib.GCTAEventCube('cntcube_py5_00002.fits')
  343 + evt = gammalib.GCTAEventCube('cntcube_py5_cta_00002.fits')
336 344 self._check_cube(evt, 245)
337 345  
338 346 # Return
... ...