Commit 5e98cffc47ad39e4f866018c4fa4bdefb5cc9650
1 parent
8c456189
Adapt MWL Python test script to new filename interface definition.
Showing
1 changed file
with
4 additions
and
6 deletions
inst/mwl/test/test_python.py
| @@ -2,8 +2,6 @@ | @@ -2,8 +2,6 @@ | ||
| 2 | 2 | ||
| 3 | import gammalib | 3 | import gammalib |
| 4 | import math | 4 | import math |
| 5 | -#from gammalib import * | ||
| 6 | -#from math import * | ||
| 7 | import os | 5 | import os |
| 8 | 6 | ||
| 9 | 7 | ||
| @@ -29,7 +27,7 @@ def extract_data(filename): | @@ -29,7 +27,7 @@ def extract_data(filename): | ||
| 29 | 27 | ||
| 30 | # Load spectrum | 28 | # Load spectrum |
| 31 | spectrum = gammalib.GMWLSpectrum() | 29 | spectrum = gammalib.GMWLSpectrum() |
| 32 | - spectrum.load(filename, extno) | 30 | + spectrum.load(filename+"["+str(extno)+"]") |
| 33 | 31 | ||
| 34 | # Add spectral points | 32 | # Add spectral points |
| 35 | x = [] | 33 | x = [] |
| @@ -66,9 +64,9 @@ def fit_spectrum(filename, xmlname): | @@ -66,9 +64,9 @@ def fit_spectrum(filename, xmlname): | ||
| 66 | """ | 64 | """ |
| 67 | # Load observations | 65 | # Load observations |
| 68 | obs = gammalib.GObservations() | 66 | obs = gammalib.GObservations() |
| 69 | - comptel = gammalib.GMWLObservation(filename, "COMPTEL") | ||
| 70 | - lat = gammalib.GMWLObservation(filename, "LAT") | ||
| 71 | - hess = gammalib.GMWLObservation(filename, "HESS") | 67 | + comptel = gammalib.GMWLObservation(filename+"[COMPTEL]") |
| 68 | + lat = gammalib.GMWLObservation(filename+"[LAT]") | ||
| 69 | + hess = gammalib.GMWLObservation(filename+"[HESS]") | ||
| 72 | obs.append(comptel) | 70 | obs.append(comptel) |
| 73 | obs.append(lat) | 71 | obs.append(lat) |
| 74 | obs.append(hess) | 72 | obs.append(hess) |