From 30890779d5e7d40ee22c1e04148d5c83d66013af Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 11 Sep 2018 22:40:24 +0200 Subject: [PATCH] Add radial acceptance model to cssrcdetect --- cscripts/cssrcdetect.par | 2 +- cscripts/cssrcdetect.py | 20 +++++++++++++------- doc/source/users/reference_manual/cssrcdetect.rst | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cscripts/cssrcdetect.par b/cscripts/cssrcdetect.par index 513d02d..1aa51b4 100755 --- a/cscripts/cssrcdetect.par +++ b/cscripts/cssrcdetect.par @@ -24,7 +24,7 @@ outds9file, f, a, ds9.reg,,, "Output DS9 region file" # Script parameters #================== srcmodel, s, a, POINT,POINT,, "Source model type" -bkgmodel, s, a, NONE,NONE|IRF|AEFF|CUBE,, "Background model type" +bkgmodel, s, a, NONE,NONE|IRF|AEFF|CUBE|RACC,, "Background model type" threshold, r, a, 5.0,,, "Detection threshold (Gaussian sigma)" maxsrcs, i, h, 20,1,1000, "Maximum number of sources" avgrad, r, h, 1.0,,, "Averaging radius (deg) for significance computation" diff --git a/cscripts/cssrcdetect.py b/cscripts/cssrcdetect.py index 81d1d49..2d78f6f 100755 --- a/cscripts/cssrcdetect.py +++ b/cscripts/cssrcdetect.py @@ -271,24 +271,30 @@ class cssrcdetect(ctools.cscript): Parameters ---------- modeltype : str - Model type ('IRF', 'AEFF' or 'CUBE') + Model type ('IRF', 'AEFF', 'CUBE' or 'RACC') Returns ------- model : `~gammalib.GModelData()` Background model """ - # Set spectral component - spectral = gammalib.GModelSpectralPlaw(1.0, 0.0, - gammalib.GEnergy(1.0, 'TeV')) + # Pivot energy + epivot = gammalib.GEnergy(1.0, 'TeV') # Set background model if modeltype == 'IRF': - model = gammalib.GCTAModelIrfBackground(spectral) + spectral = gammalib.GModelSpectralPlaw(1.0, 0.0, epivot) + model = gammalib.GCTAModelIrfBackground(spectral) elif modeltype == 'AEFF': - model = gammalib.GCTAModelAeffBackground(spectral) + spectral = gammalib.GModelSpectralPlaw(1.0e-13, -2.5, epivot) + model = gammalib.GCTAModelAeffBackground(spectral) elif modeltype == 'CUBE': - model = gammalib.GCTAModelCubeBackground(spectral) + spectral = gammalib.GModelSpectralPlaw(1.0, 0.0, epivot) + model = gammalib.GCTAModelCubeBackground(spectral) + elif modeltype == 'RACC': + radial = gammalib.GCTAModelRadialGauss(3.0) + spectral = gammalib.GModelSpectralPlaw(1.0e-4, -2.5, epivot) + model = gammalib.GCTAModelRadialAcceptance(radial, spectral) else: model = None diff --git a/doc/source/users/reference_manual/cssrcdetect.rst b/doc/source/users/reference_manual/cssrcdetect.rst index fab239c..efe4104 100755 --- a/doc/source/users/reference_manual/cssrcdetect.rst +++ b/doc/source/users/reference_manual/cssrcdetect.rst @@ -36,13 +36,13 @@ General parameters point sources with power law spectral shapes to the model definition XML file. -``bkgmodel [string]`` +``bkgmodel [string]`` Background model type. Using ``NONE`` no background model will be added to the model definition XML file. Using ``IRF`` a background model based on the template information in the Instrument Response Function will be added. Using ``AEFF`` a background model based on the shape of the effective area will be added. Using ``CUBE`` a background model for stacked analysis - will be added. + will be added. Using ``RACC`` a radial acceptance model will be added. ``threshold [real]`` Detection threshold (Gaussian sigma). Only sources above this detection -- libgit2 0.21.4