Commit 2940143c2b0152da1f827313daffa4d4a09ecb3f
1 parent
4e77fe05
Adapt to new GModelSpectralPlaw interface.
Showing
2 changed files
with
3 additions
and
9 deletions
scripts/cssens.py
| @@ -297,10 +297,7 @@ class cssens(GApplication): | @@ -297,10 +297,7 @@ class cssens(GApplication): | ||
| 297 | if len(self.m_bkg) > 0: | 297 | if len(self.m_bkg) > 0: |
| 298 | spectrum = GModelSpectralFunc(self.m_bkg) | 298 | spectrum = GModelSpectralFunc(self.m_bkg) |
| 299 | else: | 299 | else: |
| 300 | - spectrum = GModelSpectralPlaw(61.8, -1.85) | ||
| 301 | - spectrum["Prefactor"].scale(1.0e-6) | ||
| 302 | - spectrum["PivotEnergy"].value(1.0) | ||
| 303 | - spectrum["PivotEnergy"].scale(1.0e6) | 300 | + spectrum = GModelSpectralPlaw(61.8e-6, -1.85, GEnergy(1.0, "TeV")) |
| 304 | if fitidx: | 301 | if fitidx: |
| 305 | spectrum["Index"].free() | 302 | spectrum["Index"].free() |
| 306 | else: | 303 | else: |
| @@ -336,10 +333,7 @@ class cssens(GApplication): | @@ -336,10 +333,7 @@ class cssens(GApplication): | ||
| 336 | location.lb_deg(l, b) | 333 | location.lb_deg(l, b) |
| 337 | 334 | ||
| 338 | # Set source spectrum | 335 | # Set source spectrum |
| 339 | - spectrum = GModelSpectralPlaw(flux, index) | ||
| 340 | - spectrum["Prefactor"].scale(5.7e-16) | ||
| 341 | - spectrum["PivotEnergy"].value(0.3) | ||
| 342 | - spectrum["PivotEnergy"].scale(1.0e6) | 336 | + spectrum = GModelSpectralPlaw(flux*5.7e-16, index, GEnergy(0.3, "TeV") |
| 343 | if fitidx: | 337 | if fitidx: |
| 344 | spectrum["Index"].free() | 338 | spectrum["Index"].free() |
| 345 | else: | 339 | else: |
scripts/cstsdist.py
| @@ -313,7 +313,7 @@ class cstsdist(GApplication): | @@ -313,7 +313,7 @@ class cstsdist(GApplication): | ||
| 313 | location.lb_deg(l, b) | 313 | location.lb_deg(l, b) |
| 314 | 314 | ||
| 315 | # Set source spectrum | 315 | # Set source spectrum |
| 316 | - spectrum = GModelSpectralPlaw(flux*5.7e-16, index, 3.0e5) | 316 | + spectrum = GModelSpectralPlaw(flux*5.7e-16, index, GEnergy(0.3, "TeV")) |
| 317 | if fitidx: | 317 | if fitidx: |
| 318 | spectrum["Index"].free() | 318 | spectrum["Index"].free() |
| 319 | else: | 319 | else: |