Bug #2171

csresmap fails when a residual map is computed for a counts cube and a model containing a diffuse map or cube

Added by Knödlseder Jürgen over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:07/27/2017
Priority:ImmediateDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.4.0
Duration:

Description

When computing a residual map using csresmap for a counts cube and a model containing a diffuse map or cube the script exists with the following error:

Traceback (most recent call last):
  File "/usr/local/gamma/bin/csresmap", line 367, in <module>
    app.execute()
  File "/usr/local/gamma/bin/csresmap", line 287, in execute
    self.run()
  File "/usr/local/gamma/bin/csresmap", line 214, in run
    model.run()
  File "/usr/local/gamma/lib/python2.7/site-packages/ctools/tools.py", line 1532, in run
    return _tools.ctmodel_run(self)
IndexError: *** ERROR in GSkyMap::operator(int&, int&): Sky map pixel index -1 is outside the valid range [0,89999].

The error arises due to the new model computation in ctmodel. The diffuse map or cube model computation for a stacked analysis makes use of the GCTAResponseCube class which cashes the diffuse model using the GCTAEventBin::ipix() and GCTAEventBin::ieng() method. Since the values of these indices is not set by ctmodel, but left at -1, an error occurs.

The problem should be solved by correctly setting the indices in ctmodel. This requires adding index setter methods to GCTAEventBin.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 7 years ago

  • % Done changed from 0 to 80

Adding GCTAEventBin::ipix() and GCTAEventBin::ieng() setter methods and setting the pixel and energy index in ctmodel solved the problem.

#2 Updated by Knödlseder Jürgen over 7 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

Merged into devel branches of GammaLib and ctools.

#3 Updated by Knödlseder Jürgen over 7 years ago

#4 Updated by Knödlseder Jürgen over 7 years ago

  • Related to deleted (Feature #2142: GGti::exclude(tstart,tstop))

Also available in: Atom PDF