Commit 1b2cd383989e6320976c14ac551b1fc4bed7cf4e

Authored by Jürgen Knödlseder
1 parent 06349ac9

Adapt to latest GammaLib code.

Showing 1 changed file with 3 additions and 2 deletions
test/example_survey.py
@@ -192,7 +192,7 @@ def add_background_model(obs): @@ -192,7 +192,7 @@ def add_background_model(obs):
192 192
193 # Define background model 193 # Define background model
194 bgd_radial = GCTAModelRadialGauss(3.0) 194 bgd_radial = GCTAModelRadialGauss(3.0)
195 - bgd_spectrum = GModelSpectralPlaw(61.8e-6, -1.85, 1.0e6) 195 + bgd_spectrum = GModelSpectralPlaw(61.8e-6, -1.85, GEnergy(1.0, "TeV"))
196 bgd_model = GCTAModelRadialAcceptance(bgd_radial, bgd_spectrum) 196 bgd_model = GCTAModelRadialAcceptance(bgd_radial, bgd_spectrum)
197 bgd_model.name("Background") 197 bgd_model.name("Background")
198 bgd_model.instruments("CTA") 198 bgd_model.instruments("CTA")
@@ -216,7 +216,7 @@ def crab_spec(): @@ -216,7 +216,7 @@ def crab_spec():
216 (Albert et al. 2008, ApJ, 674, 1037) 216 (Albert et al. 2008, ApJ, 674, 1037)
217 """ 217 """
218 # Set parameters 218 # Set parameters
219 - spectrum = GModelSpectralPlaw(5.7e-16, -2.48, 3.0e5) 219 + spectrum = GModelSpectralPlaw(5.7e-16, -2.48, GEnergy(0.3, "TeV"))
220 220
221 # Return spectrum 221 # Return spectrum
222 return spectrum 222 return spectrum
@@ -278,6 +278,7 @@ def survey_gplane(lrange=10, lstep=2): @@ -278,6 +278,7 @@ def survey_gplane(lrange=10, lstep=2):
278 pntdir.lb_deg(l, 0.0) 278 pntdir.lb_deg(l, 0.0)
279 #run = set_one_obs(pntdir) 279 #run = set_one_obs(pntdir)
280 run = obsutils.set(pntdir) 280 run = obsutils.set(pntdir)
  281 + run.id(str(l))
281 obs.append(run) 282 obs.append(run)
282 283
283 # Define single point source with Crab flux at galactic centre 284 # Define single point source with Crab flux at galactic centre