Bug #2448

csrespec fails when a precomputed model cube is passed as modcube argument

Added by Di Venere Leonardo about 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:04/12/2018
Priority:NormalDue date:
Assigned To:Di Venere Leonardo% Done:

100%

Category:-
Target version:1.6.0
Duration:

Description

csrespec fails when a precomputed model cube is passed as modcube argument.
Here is an example:

>>> csresspec
Input event list, counts cube, or observation definition XML file [ctbin.fits] 
Input exposure cube file [ctexpcube.fits] 
Input PSF cube file [ctpsfcube.fits] 
Input background cube file [ctbkgcube.fits] 
Input model cube file (generated with ctmodel) [ctmodel.fits] 
Mask data to calculate residuals in ROI? [no] 
Residuals computation algorithm (SUB|SUBDIV|SUBDIVSQRT|SIGNIFICANCE) [SIGNIFICANCE] 
Output residual spectrum file [] test_csresspec.fits
Input model definition XML file [input_model.xml] 
Traceback (most recent call last):
  File "/lustrehome/exp_soft/cta/ctools/instdir-1.5.0/gamma/bin/csresspec", line 739, in <module>
    app.execute()
  File "/lustrehome/exp_soft/cta/ctools/instdir-1.5.0/gamma/lib/python2.7/site-packages/ctools/tools.py", line 1072, in _execute
    self.run()
  File "/lustrehome/exp_soft/cta/ctools/instdir-1.5.0/gamma/bin/csresspec", line 570, in run
    modcube = gammalib.GCTAEventCube(self['inmodel'].filename())
  File "/lustrehome/exp_soft/cta/ctools/instdir-1.5.0/gamma/lib/python2.7/site-packages/gammalib/cta.py", line 496, in __init__
    this = _cta.new_GCTAEventCube(*args)
RuntimeError: *** ERROR in GFits::open(GFilename&, bool&): Unable to open FITS file "TeV_J1224_results_fit_NEW_EDISP/TeV_J1224_binned_TeV_J1224_binned_TeV_J1224_PL_GALbkg_bkgmodel_edisp_fit.xml" (status=104)

Recurrence

No recurrence.

History

#1 Updated by Di Venere Leonardo about 6 years ago

  • % Done changed from 0 to 80

The reason of the error is a wrong argument queried at line 570 in the script csresspec.py :
The original line is:

    modcube = gammalib.GCTAEventCube(self['inmodel'].filename())

The correct line should be:

    modcube = gammalib.GCTAEventCube(self['modcube'].filename())

I checked that with this new line the error disappears.

I can create a new branch and push the bug fix, if necessary.

#2 Updated by Di Venere Leonardo about 6 years ago

  • Status changed from New to Feedback

#3 Updated by Di Venere Leonardo about 6 years ago

  • Status changed from Feedback to Pull request
  • % Done changed from 80 to 100

I pushed the bug fix to a new branch:
ctools repo: :ldivenere/ctools.git
ctools branch: 2448-csresspec-bugfix

#4 Updated by Knödlseder Jürgen almost 6 years ago

  • Status changed from Pull request to Closed
  • Assigned To set to Di Venere Leonardo
  • Target version set to 1.6.0

Code merged into devel

Also available in: Atom PDF