Commit 30890779d5e7d40ee22c1e04148d5c83d66013af

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

Add radial acceptance model to cssrcdetect

cscripts/cssrcdetect.par
@@ -24,7 +24,7 @@ outds9file, f, a, ds9.reg,,, "Output DS9 region file" @@ -24,7 +24,7 @@ outds9file, f, a, ds9.reg,,, "Output DS9 region file"
24 # Script parameters 24 # Script parameters
25 #================== 25 #==================
26 srcmodel, s, a, POINT,POINT,, "Source model type" 26 srcmodel, s, a, POINT,POINT,, "Source model type"
27 -bkgmodel, s, a, NONE,NONE|IRF|AEFF|CUBE,, "Background model type" 27 +bkgmodel, s, a, NONE,NONE|IRF|AEFF|CUBE|RACC,, "Background model type"
28 threshold, r, a, 5.0,,, "Detection threshold (Gaussian sigma)" 28 threshold, r, a, 5.0,,, "Detection threshold (Gaussian sigma)"
29 maxsrcs, i, h, 20,1,1000, "Maximum number of sources" 29 maxsrcs, i, h, 20,1,1000, "Maximum number of sources"
30 avgrad, r, h, 1.0,,, "Averaging radius (deg) for significance computation" 30 avgrad, r, h, 1.0,,, "Averaging radius (deg) for significance computation"
cscripts/cssrcdetect.py
@@ -271,24 +271,30 @@ class cssrcdetect(ctools.cscript): @@ -271,24 +271,30 @@ class cssrcdetect(ctools.cscript):
271 Parameters 271 Parameters
272 ---------- 272 ----------
273 modeltype : str 273 modeltype : str
274 - Model type ('IRF', 'AEFF' or 'CUBE') 274 + Model type ('IRF', 'AEFF', 'CUBE' or 'RACC')
275 275
276 Returns 276 Returns
277 ------- 277 -------
278 model : `~gammalib.GModelData()` 278 model : `~gammalib.GModelData()`
279 Background model 279 Background model
280 """ 280 """
281 - # Set spectral component  
282 - spectral = gammalib.GModelSpectralPlaw(1.0, 0.0,  
283 - gammalib.GEnergy(1.0, 'TeV')) 281 + # Pivot energy
  282 + epivot = gammalib.GEnergy(1.0, 'TeV')
284 283
285 # Set background model 284 # Set background model
286 if modeltype == 'IRF': 285 if modeltype == 'IRF':
287 - model = gammalib.GCTAModelIrfBackground(spectral) 286 + spectral = gammalib.GModelSpectralPlaw(1.0, 0.0, epivot)
  287 + model = gammalib.GCTAModelIrfBackground(spectral)
288 elif modeltype == 'AEFF': 288 elif modeltype == 'AEFF':
289 - model = gammalib.GCTAModelAeffBackground(spectral) 289 + spectral = gammalib.GModelSpectralPlaw(1.0e-13, -2.5, epivot)
  290 + model = gammalib.GCTAModelAeffBackground(spectral)
290 elif modeltype == 'CUBE': 291 elif modeltype == 'CUBE':
291 - model = gammalib.GCTAModelCubeBackground(spectral) 292 + spectral = gammalib.GModelSpectralPlaw(1.0, 0.0, epivot)
  293 + model = gammalib.GCTAModelCubeBackground(spectral)
  294 + elif modeltype == 'RACC':
  295 + radial = gammalib.GCTAModelRadialGauss(3.0)
  296 + spectral = gammalib.GModelSpectralPlaw(1.0e-4, -2.5, epivot)
  297 + model = gammalib.GCTAModelRadialAcceptance(radial, spectral)
292 else: 298 else:
293 model = None 299 model = None
294 300
doc/source/users/reference_manual/cssrcdetect.rst
@@ -36,13 +36,13 @@ General parameters @@ -36,13 +36,13 @@ General parameters
36 point sources with power law spectral shapes to the model definition 36 point sources with power law spectral shapes to the model definition
37 XML file. 37 XML file.
38 38
39 -``bkgmodel <NONE|IRF|AEFF|CUBE> [string]`` 39 +``bkgmodel <NONE|IRF|AEFF|CUBE|RACC> [string]``
40 Background model type. Using ``NONE`` no background model will be added 40 Background model type. Using ``NONE`` no background model will be added
41 to the model definition XML file. Using ``IRF`` a background model based 41 to the model definition XML file. Using ``IRF`` a background model based
42 on the template information in the Instrument Response Function will be 42 on the template information in the Instrument Response Function will be
43 added. Using ``AEFF`` a background model based on the shape of the effective 43 added. Using ``AEFF`` a background model based on the shape of the effective
44 area will be added. Using ``CUBE`` a background model for stacked analysis 44 area will be added. Using ``CUBE`` a background model for stacked analysis
45 - will be added. 45 + will be added. Using ``RACC`` a radial acceptance model will be added.
46 46
47 ``threshold [real]`` 47 ``threshold [real]``
48 Detection threshold (Gaussian sigma). Only sources above this detection 48 Detection threshold (Gaussian sigma). Only sources above this detection