From 2d0a31cadaf0f7d23e352b8d0eabe03ae10ad102 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 8 Jul 2014 18:08:29 +0200 Subject: [PATCH] Correctly use number of counts in event bin in the cntmap method and propagate projection and coordinate parameters in sim function. --- scripts/obsutils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/obsutils.py b/scripts/obsutils.py index 6a8ccbd..64c3945 100755 --- a/scripts/obsutils.py +++ b/scripts/obsutils.py @@ -26,7 +26,7 @@ import gammalib # Simulate observations # # ===================== # def sim(obs, log=False, debug=False, edisp=False, seed=0, nbins=0, - binsz=0.05, npix=200): + binsz=0.05, npix=200, proj="TAN", coord="GAL"): """ Simulate events for all observations in the container. @@ -90,8 +90,8 @@ def sim(obs, log=False, debug=False, edisp=False, seed=0, nbins=0, bin["nxpix"].integer(npix) bin["nypix"].integer(npix) bin["binsz"].real(binsz) - bin["coordsys"].string("GAL") - bin["proj"].string("TAN") + bin["coordsys"].string(coord) + bin["proj"].string(proj) # Optionally open the log file if log: @@ -199,7 +199,7 @@ def cntmap(obs, proj="TAN", coord="GAL", xval=0.0, yval=0.0, \ # Set pixel if pixel < maxpixel: - map[pixel] += 1.0 + map[pixel] += event.counts() # Save sky map. The clobber flag is set to True, so any existing FITS # file will be overwritten. -- libgit2 0.21.4