Commit bf02fb089c43d33808baef99d2b88c7470557a7e

Authored by Jürgen Knödlseder
1 parent 4e9d5a1a

Use counts cube in background cube generation in obsutils.sim() function (#2706)

Showing 1 changed file with 5 additions and 0 deletions
cscripts/obsutils.py
@@ -181,6 +181,10 @@ def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0, @@ -181,6 +181,10 @@ def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0,
181 # cubes and append them to the observation 181 # cubes and append them to the observation
182 if len(obssim.obs()) > 1: 182 if len(obssim.obs()) > 1:
183 183
  184 + # Get counts cube. The counts cube is needed to obtained a
  185 + # proper background cube.
  186 + cntcube = binning.cube()
  187 +
184 # Get stacked response (use pointing for map centre) 188 # Get stacked response (use pointing for map centre)
185 response = get_stacked_response(obssim.obs(), None, None, 189 response = get_stacked_response(obssim.obs(), None, None,
186 binsz=binsz, nxpix=npix, nypix=npix, 190 binsz=binsz, nxpix=npix, nypix=npix,
@@ -188,6 +192,7 @@ def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0, @@ -188,6 +192,7 @@ def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0,
188 edisp=edisp, 192 edisp=edisp,
189 coordsys=coord, proj=proj, 193 coordsys=coord, proj=proj,
190 addbounds=addbounds, 194 addbounds=addbounds,
  195 + cntcube=cntcube,
191 log=log, debug=debug, 196 log=log, debug=debug,
192 chatter=chatter) 197 chatter=chatter)
193 198