Commit af771e6093f4cbbb528e99c98b07a47dad47d280

Authored by Jürgen Knödlseder
1 parent 83fd1279

Do no longer use a finer energy binning for the background cube in obsutils.get_stacked_response().

The interpolation of the stacked background cube is problematic when combining various energy thresholds. The background cube should *not* be interpolated but should be identical to the counts cube. Both are defined in the same data space.
Showing 1 changed file with 4 additions and 2 deletions
cscripts/obsutils.py
@@ -633,7 +633,9 @@ def get_stacked_response(obs, xref, yref, binsz=0.05, nxpix=200, nypix=200, @@ -633,7 +633,9 @@ def get_stacked_response(obs, xref, yref, binsz=0.05, nxpix=200, nypix=200,
633 psfcube.logFileOpen() 633 psfcube.logFileOpen()
634 psfcube.run() 634 psfcube.run()
635 635
636 - # Create background cube 636 + # Create background cube. Note that we use the same energy binning as
  637 + # for the counts cube since no interpolation should be actually done
  638 + # for the background cube.
637 bkgcube = ctools.ctbkgcube(obs) 639 bkgcube = ctools.ctbkgcube(obs)
638 bkgcube['incube'] = 'NONE' 640 bkgcube['incube'] = 'NONE'
639 bkgcube['usepnt'] = usepnt 641 bkgcube['usepnt'] = usepnt
@@ -641,7 +643,7 @@ def get_stacked_response(obs, xref, yref, binsz=0.05, nxpix=200, nypix=200, @@ -641,7 +643,7 @@ def get_stacked_response(obs, xref, yref, binsz=0.05, nxpix=200, nypix=200,
641 bkgcube['binsz'] = binsz 643 bkgcube['binsz'] = binsz
642 bkgcube['nxpix'] = nxpix 644 bkgcube['nxpix'] = nxpix
643 bkgcube['nypix'] = nypix 645 bkgcube['nypix'] = nypix
644 - bkgcube['enumbins'] = _enumbins 646 + bkgcube['enumbins'] = enumbins
645 bkgcube['emin'] = emin 647 bkgcube['emin'] = emin
646 bkgcube['emax'] = emax 648 bkgcube['emax'] = emax
647 bkgcube['coordsys'] = coordsys 649 bkgcube['coordsys'] = coordsys