Commit 38522c2730e340f73bd5021e440c45bad2b4ebbe

Authored by Luigi Tibaldo
1 parent 6a340d88

add unbinned test

Showing 1 changed file with 30 additions and 2 deletions
test/test_csscs.py
... ... @@ -291,8 +291,6 @@ class Test(test):
291 291 # Check result
292 292 self._check_result_file('csscs_py5.fits')
293 293  
294   - # TODO: test unbinned analysis
295   -
296 294 # Set up for test in On/Off mode with background model
297 295 script = cscripts.csscs()
298 296 script['logfile'] = 'csscs_py6.log'
... ... @@ -390,6 +388,36 @@ class Test(test):
390 388 # Check result
391 389 self._check_result_file('csscs_py8.fits')
392 390  
  391 + # Set up for test in unbinned mode
  392 + script = cscripts.csscs()
  393 + script['logfile'] = 'csscs_py9.log'
  394 + script['inobs'] = self._evs_offaxis
  395 + script['caldb'] = self._caldb
  396 + script['irf'] = self._irf
  397 + script['inmodel'] = self._model
  398 + script['srcnames'] = 'Crab'
  399 + script['emin'] = 1.
  400 + script['emax'] = 100.
  401 + script['nxpix'] = 2
  402 + script['nypix'] = 2
  403 + script['binsz'] = 0.1
  404 + script['coordsys'] = 'CEL'
  405 + script['proj'] = 'CAR'
  406 + script['xref'] = 83.63
  407 + script['yref'] = 22.01
  408 + script['rad'] = 0.2
  409 + script['method'] = 'UNBINNED'
  410 + script['enumbins'] = 2
  411 + script['outfile'] = 'csscs_py9.fits'
  412 + script['chatter'] = 2
  413 +
  414 + # Run csscs script and save results
  415 + script.logFileOpen()
  416 + script.execute()
  417 +
  418 + # Check result
  419 + self._check_result_file('csscs_py9.fits')
  420 +
393 421 # Return
394 422 return
395 423  
... ...