Commit f674e8e7952ab0ed99054efaf7120f7c85890608

Authored by Jürgen Knödlseder
1 parent 725afee3

Adapt to GammaLib 1.0.0

examples/benchmark_cta_analysis.py
... ... @@ -55,7 +55,7 @@ def unbinned_pipeline(duration):
55 55  
56 56 # Simulate events
57 57 sim = ctools.ctobssim()
58   - sim["infile"].filename(model_name)
  58 + sim["inmodel"].filename(model_name)
59 59 sim["caldb"].string(caldb)
60 60 sim["irf"].string(irf)
61 61 sim["ra"].real(ra)
... ... @@ -124,7 +124,7 @@ def binned_pipeline(duration):
124 124  
125 125 # Simulate events
126 126 sim = ctools.ctobssim()
127   - sim["infile"].filename(model_name)
  127 + sim["inmodel"].filename(model_name)
128 128 sim["caldb"].string(caldb)
129 129 sim["irf"].string(irf)
130 130 sim["ra"].real(ra)
... ... @@ -197,7 +197,7 @@ def cube_pipeline(duration):
197 197  
198 198 # Simulate events
199 199 sim = ctools.ctobssim()
200   - sim["infile"].filename(model_name)
  200 + sim["inmodel"].filename(model_name)
201 201 sim["caldb"].string(caldb)
202 202 sim["irf"].string(irf)
203 203 sim["ra"].real(ra)
... ... @@ -225,8 +225,8 @@ def cube_pipeline(duration):
225 225 bin.run()
226 226  
227 227 # Create exposure cube
228   - expcube = ctools.ctexpcube(bin.obs())
229   - expcube["cntmap"].filename("NONE")
  228 + expcube = ctools.ctexpcube(sim.obs())
  229 + expcube["incube"].filename("NONE")
230 230 expcube["caldb"].string(caldb)
231 231 expcube["irf"].string(irf)
232 232 expcube["ebinalg"].string("LOG")
... ... @@ -243,8 +243,8 @@ def cube_pipeline(duration):
243 243 expcube.run()
244 244  
245 245 # Create PSF cube
246   - psfcube = ctools.ctpsfcube(bin.obs())
247   - psfcube["cntmap"].filename("NONE")
  246 + psfcube = ctools.ctpsfcube(sim.obs())
  247 + psfcube["incube"].filename("NONE")
248 248 psfcube["caldb"].string(caldb)
249 249 psfcube["irf"].string(irf)
250 250 psfcube["ebinalg"].string("LOG")
... ...
examples/pipeline_stacked_mem.py
... ... @@ -24,6 +24,7 @@
24 24 # ==========================================================================
25 25 import gammalib
26 26 import ctools
  27 +from ctools import obsutils
27 28  
28 29  
29 30 # ================== #
... ... @@ -50,19 +51,19 @@ def setup_observations(pattern="four", ra=83.6331, dec=22.0145, offset=1.5, \
50 51 irf - Instrument response function (default: cta_dummy_irf)
51 52 """
52 53 # Set list of observations
53   - obs_def_list = ctools.obsutils.set_obs_patterns(pattern, \
54   - ra=ra, \
55   - dec=dec, \
56   - offset=offset)
  54 + obs_def_list = obsutils.set_obs_patterns(pattern, \
  55 + ra=ra, \
  56 + dec=dec, \
  57 + offset=offset)
57 58  
58 59 # Get observation container
59   - obs = ctools.obsutils.set_obs_list(obs_def_list, \
60   - duration=duration, \
61   - emin=emin, \
62   - emax=emax, \
63   - rad=rad, \
64   - caldb=caldb, \
65   - irf=irf)
  60 + obs = obsutils.set_obs_list(obs_def_list, \
  61 + duration=duration, \
  62 + emin=emin, \
  63 + emax=emax, \
  64 + rad=rad, \
  65 + caldb=caldb, \
  66 + irf=irf)
66 67  
67 68 # Return observation container
68 69 return obs
... ... @@ -129,7 +130,7 @@ def run_pipeline(obs, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, \
129 130  
130 131 # Create exposure cube
131 132 expcube = ctools.ctexpcube(sim.obs())
132   - expcube["cntmap"].filename("NONE")
  133 + expcube["incube"].filename("NONE")
133 134 expcube["ebinalg"].string("LOG")
134 135 expcube["emin"].real(emin)
135 136 expcube["emax"].real(emax)
... ... @@ -146,7 +147,7 @@ def run_pipeline(obs, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, \
146 147  
147 148 # Create PSF cube
148 149 psfcube = ctools.ctpsfcube(sim.obs())
149   - psfcube["cntmap"].filename("NONE")
  150 + psfcube["incube"].filename("NONE")
150 151 psfcube["ebinalg"].string("LOG")
151 152 psfcube["emin"].real(emin)
152 153 psfcube["emax"].real(emax)
... ... @@ -163,7 +164,7 @@ def run_pipeline(obs, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, \
163 164  
164 165 # Create background cube
165 166 bkgcube = ctools.ctbkgcube(sim.obs())
166   - bkgcube["cntmap"].filename("NONE")
  167 + bkgcube["incube"].filename("NONE")
167 168 bkgcube["ebinalg"].string("LOG")
168 169 bkgcube["emin"].real(emin)
169 170 bkgcube["emax"].real(emax)
... ...