From f674e8e7952ab0ed99054efaf7120f7c85890608 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Mon, 2 Feb 2015 22:47:07 +0100 Subject: [PATCH] Adapt to GammaLib 1.0.0 --- examples/benchmark_cta_analysis.py | 14 +++++++------- examples/pipeline_stacked_mem.py | 29 +++++++++++++++-------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/examples/benchmark_cta_analysis.py b/examples/benchmark_cta_analysis.py index 83b3c9e..9fe9d6f 100755 --- a/examples/benchmark_cta_analysis.py +++ b/examples/benchmark_cta_analysis.py @@ -55,7 +55,7 @@ def unbinned_pipeline(duration): # Simulate events sim = ctools.ctobssim() - sim["infile"].filename(model_name) + sim["inmodel"].filename(model_name) sim["caldb"].string(caldb) sim["irf"].string(irf) sim["ra"].real(ra) @@ -124,7 +124,7 @@ def binned_pipeline(duration): # Simulate events sim = ctools.ctobssim() - sim["infile"].filename(model_name) + sim["inmodel"].filename(model_name) sim["caldb"].string(caldb) sim["irf"].string(irf) sim["ra"].real(ra) @@ -197,7 +197,7 @@ def cube_pipeline(duration): # Simulate events sim = ctools.ctobssim() - sim["infile"].filename(model_name) + sim["inmodel"].filename(model_name) sim["caldb"].string(caldb) sim["irf"].string(irf) sim["ra"].real(ra) @@ -225,8 +225,8 @@ def cube_pipeline(duration): bin.run() # Create exposure cube - expcube = ctools.ctexpcube(bin.obs()) - expcube["cntmap"].filename("NONE") + expcube = ctools.ctexpcube(sim.obs()) + expcube["incube"].filename("NONE") expcube["caldb"].string(caldb) expcube["irf"].string(irf) expcube["ebinalg"].string("LOG") @@ -243,8 +243,8 @@ def cube_pipeline(duration): expcube.run() # Create PSF cube - psfcube = ctools.ctpsfcube(bin.obs()) - psfcube["cntmap"].filename("NONE") + psfcube = ctools.ctpsfcube(sim.obs()) + psfcube["incube"].filename("NONE") psfcube["caldb"].string(caldb) psfcube["irf"].string(irf) psfcube["ebinalg"].string("LOG") diff --git a/examples/pipeline_stacked_mem.py b/examples/pipeline_stacked_mem.py index a93875b..b57e22b 100755 --- a/examples/pipeline_stacked_mem.py +++ b/examples/pipeline_stacked_mem.py @@ -24,6 +24,7 @@ # ========================================================================== import gammalib import ctools +from ctools import obsutils # ================== # @@ -50,19 +51,19 @@ def setup_observations(pattern="four", ra=83.6331, dec=22.0145, offset=1.5, \ irf - Instrument response function (default: cta_dummy_irf) """ # Set list of observations - obs_def_list = ctools.obsutils.set_obs_patterns(pattern, \ - ra=ra, \ - dec=dec, \ - offset=offset) + obs_def_list = obsutils.set_obs_patterns(pattern, \ + ra=ra, \ + dec=dec, \ + offset=offset) # Get observation container - obs = ctools.obsutils.set_obs_list(obs_def_list, \ - duration=duration, \ - emin=emin, \ - emax=emax, \ - rad=rad, \ - caldb=caldb, \ - irf=irf) + obs = obsutils.set_obs_list(obs_def_list, \ + duration=duration, \ + emin=emin, \ + emax=emax, \ + rad=rad, \ + caldb=caldb, \ + irf=irf) # Return observation container return obs @@ -129,7 +130,7 @@ def run_pipeline(obs, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, \ # Create exposure cube expcube = ctools.ctexpcube(sim.obs()) - expcube["cntmap"].filename("NONE") + expcube["incube"].filename("NONE") expcube["ebinalg"].string("LOG") expcube["emin"].real(emin) expcube["emax"].real(emax) @@ -146,7 +147,7 @@ def run_pipeline(obs, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, \ # Create PSF cube psfcube = ctools.ctpsfcube(sim.obs()) - psfcube["cntmap"].filename("NONE") + psfcube["incube"].filename("NONE") psfcube["ebinalg"].string("LOG") psfcube["emin"].real(emin) psfcube["emax"].real(emax) @@ -163,7 +164,7 @@ def run_pipeline(obs, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, \ # Create background cube bkgcube = ctools.ctbkgcube(sim.obs()) - bkgcube["cntmap"].filename("NONE") + bkgcube["incube"].filename("NONE") bkgcube["ebinalg"].string("LOG") bkgcube["emin"].real(emin) bkgcube["emax"].real(emax) -- libgit2 0.21.4