Commit 7400a5e74fd428522f5214d88c1196871cb275df

Authored by ldivenere
1 parent c9445eb4

added test for phase selection in ctselect and updated ctselect doc

doc/source/users/reference_manual/ctselect.rst
... ... @@ -85,13 +85,12 @@ General parameters
85 85 If INDEF, NONE, UNDEF or UNDEFINED is passed as value, no energy
86 86 selection will be performed.
87 87  
88   -``(phasemin = 0.0) [real]``
89   - Lower phase limit of events.
90   - If INDEF, NONE, UNDEF or UNDEFINED is passed as value, no phase
91   - selection will be performed.
92   -
93   -``(phasemax = 1.0) [real]``
94   - Upper phase limit of events.
  88 +``(phase = NONE) [string]``
  89 + String to apply a phase selection. The string must contain the boundaries
  90 + of the phase interval to be selected separated be a colon. More than one
  91 + interval can be specified at the same time. In this case intervals must be
  92 + separated by a comma. Examples of valid strings are: phase = "0.3:0.6" or
  93 + phase = "0.3:0.6,0.8:0.9".
95 94 If INDEF, NONE, UNDEF or UNDEFINED is passed as value, no phase
96 95 selection will be performed.
97 96  
... ...
test/test_ctselect.py
... ... @@ -357,6 +357,28 @@ class Test(test):
357 357 # Check result file
358 358 self._check_result_file('ctselect_py10.fits', nevents=0, dec=-22.01, rad=5.0)
359 359  
  360 + # Now test phase cut
  361 + select = ctools.ctselect()
  362 + select['inobs'] = os.path.dirname(self._events)+"/phased_"+os.path.basename(self._events)
  363 + select['ra'] = 83.63
  364 + select['dec'] = 22.01
  365 + select['rad'] = 5.
  366 + select['tmin'] = "INDEF"
  367 + select['tmax'] = "INDEF"
  368 + select['emin'] = 0.1
  369 + select['emax'] = 100.0
  370 + select['phase'] = "0.1:0.4,0.6:0.8"
  371 + select['outobs'] = 'ctselect_py11.fits'
  372 + select['logfile'] = 'ctselect_py11.log'
  373 + select['chatter'] = 2
  374 +
  375 + # Run ctselect tool
  376 + select.logFileOpen() # Make sure we get a log file
  377 + select.execute()
  378 +
  379 + # Check result file
  380 + self._check_result_file('ctselect_py11.fits', nevents=3159, dec=22.01, rad=5.)
  381 +
360 382 # Return
361 383 return
362 384  
... ...