Commit 2d0a31cadaf0f7d23e352b8d0eabe03ae10ad102

Authored by Jürgen Knödlseder
1 parent 483edf0e

Correctly use number of counts in event bin in the cntmap method and propagate p…

…rojection and coordinate parameters in sim function.
Showing 1 changed file with 4 additions and 4 deletions
scripts/obsutils.py
... ... @@ -26,7 +26,7 @@ import gammalib
26 26 # Simulate observations #
27 27 # ===================== #
28 28 def sim(obs, log=False, debug=False, edisp=False, seed=0, nbins=0,
29   - binsz=0.05, npix=200):
  29 + binsz=0.05, npix=200, proj="TAN", coord="GAL"):
30 30 """
31 31 Simulate events for all observations in the container.
32 32  
... ... @@ -90,8 +90,8 @@ def sim(obs, log=False, debug=False, edisp=False, seed=0, nbins=0,
90 90 bin["nxpix"].integer(npix)
91 91 bin["nypix"].integer(npix)
92 92 bin["binsz"].real(binsz)
93   - bin["coordsys"].string("GAL")
94   - bin["proj"].string("TAN")
  93 + bin["coordsys"].string(coord)
  94 + bin["proj"].string(proj)
95 95  
96 96 # Optionally open the log file
97 97 if log:
... ... @@ -199,7 +199,7 @@ def cntmap(obs, proj="TAN", coord="GAL", xval=0.0, yval=0.0, \
199 199  
200 200 # Set pixel
201 201 if pixel < maxpixel:
202   - map[pixel] += 1.0
  202 + map[pixel] += event.counts()
203 203  
204 204 # Save sky map. The clobber flag is set to True, so any existing FITS
205 205 # file will be overwritten.
... ...