From 8fda31bf5b75d3134d65d656dd7284d99ac8734b Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sat, 23 May 2015 23:33:33 +0200 Subject: [PATCH] Use new response functions in example scripts --- examples/check_models.py | 4 ++-- examples/pipeline_binned_disk.py | 5 +++-- examples/pipeline_binned_mem.py | 2 +- examples/pipeline_stacked_disk.py | 5 +++-- examples/pipeline_stacked_mem.py | 4 ++-- examples/pipeline_unbinned_disk.py | 4 ++-- examples/pipeline_unbinned_mem.py | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/check_models.py b/examples/check_models.py index b4beaf2..bcc78be 100755 --- a/examples/check_models.py +++ b/examples/check_models.py @@ -41,8 +41,8 @@ def pipeline(model_name): FITS files on disk. All data is only hold in memory. """ # Set script parameters - caldb = "dummy" - irf = "cta_dummy_irf" + caldb = "prod2" + irf = "South_50h" ra = 83.63 dec = 22.01 rad_sim = 10.0 diff --git a/examples/pipeline_binned_disk.py b/examples/pipeline_binned_disk.py index 5aba32e..35847f6 100755 --- a/examples/pipeline_binned_disk.py +++ b/examples/pipeline_binned_disk.py @@ -36,7 +36,7 @@ from ctools import obsutils def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \ emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \ deadc=0.95, \ - caldb="dummy", irf="cta_dummy_irf"): + caldb="prod2", irf="South_50h"): """ Returns an observation container. @@ -96,7 +96,7 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ enumbins=20, nxpix=200, nypix=200, binsz=0.02, \ coordsys="CEL", proj="CAR", \ model="${CTOOLS}/share/models/crab.xml", \ - caldb="dummy", irf="cta_dummy_irf", \ + caldb="prod2", irf="South_50h", \ debug=False): """ Simulation and binned analysis pipeline. @@ -165,6 +165,7 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ like["outmodel"].filename("fit_results.xml") like["expcube"].filename("NONE") like["psfcube"].filename("NONE") + like["bkgcube"].filename("NONE") like["caldb"].string(caldb) like["irf"].string(irf) like["debug"].boolean(True) # Switch this always on for results in console diff --git a/examples/pipeline_binned_mem.py b/examples/pipeline_binned_mem.py index 5c586ab..563ecb6 100755 --- a/examples/pipeline_binned_mem.py +++ b/examples/pipeline_binned_mem.py @@ -36,7 +36,7 @@ from ctools import obsutils def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \ emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \ deadc=0.95, \ - caldb="dummy", irf="cta_dummy_irf"): + caldb="prod2", irf="South_50h"): """ Returns an observation container. diff --git a/examples/pipeline_stacked_disk.py b/examples/pipeline_stacked_disk.py index 5a5adaa..32d2e20 100755 --- a/examples/pipeline_stacked_disk.py +++ b/examples/pipeline_stacked_disk.py @@ -36,7 +36,7 @@ from ctools import obsutils def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \ emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \ deadc=0.95, \ - caldb="dummy", irf="cta_dummy_irf"): + caldb="prod2", irf="South_50h"): """ Returns an observation container. @@ -96,7 +96,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ enumbins=20, nxpix=200, nypix=200, binsz=0.02, \ coordsys="CEL", proj="CAR", \ model="${CTOOLS}/share/models/crab.xml", \ - caldb="dummy", irf="cta_dummy_irf", \ + caldb="prod2", irf="South_50h", \ debug=False): """ Simulation and stacked analysis pipeline. @@ -210,6 +210,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ like["outmodel"].filename("fit_results.xml") like["expcube"].filename("expcube.fits") like["psfcube"].filename("psfcube.fits") + like["bkgcube"].filename("bkgcube.fits") like["caldb"].string(caldb) like["irf"].string(irf) like["debug"].boolean(True) # Switch this always on for results in console diff --git a/examples/pipeline_stacked_mem.py b/examples/pipeline_stacked_mem.py index 1215969..1a694f5 100755 --- a/examples/pipeline_stacked_mem.py +++ b/examples/pipeline_stacked_mem.py @@ -36,7 +36,7 @@ from ctools import obsutils def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \ emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \ deadc=0.95, \ - caldb="dummy", irf="cta_dummy_irf"): + caldb="prod2", irf="South_50h"): """ Returns an observation container. @@ -188,7 +188,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ # Set Exposure and Psf cube for first CTA observation # (ctbin will create an observation with a single container) - bin.obs()[0].response(expcube.expcube(), psfcube.psfcube()) + bin.obs()[0].response(expcube.expcube(), psfcube.psfcube(), bkgcube.bkgcube()) # Perform maximum likelihood fitting like = ctools.ctlike(bin.obs()) diff --git a/examples/pipeline_unbinned_disk.py b/examples/pipeline_unbinned_disk.py index 2375216..65fefe6 100755 --- a/examples/pipeline_unbinned_disk.py +++ b/examples/pipeline_unbinned_disk.py @@ -36,7 +36,7 @@ from ctools import obsutils def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \ emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \ deadc=0.95, \ - caldb="dummy", irf="cta_dummy_irf"): + caldb="prod2", irf="South_50h"): """ Returns an observation container. @@ -96,7 +96,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, rad=3.0, \ emin=0.1, emax=100.0, \ tmin=0.0, tmax=0.0, \ model="${CTOOLS}/share/models/crab.xml", \ - caldb="dummy", irf="cta_dummy_irf", \ + caldb="prod2", irf="South_50h", \ debug=False): """ Simulation and unbinned analysis pipeline. diff --git a/examples/pipeline_unbinned_mem.py b/examples/pipeline_unbinned_mem.py index 875d318..db16193 100755 --- a/examples/pipeline_unbinned_mem.py +++ b/examples/pipeline_unbinned_mem.py @@ -36,7 +36,7 @@ from ctools import obsutils def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \ emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \ deadc=0.95, \ - caldb="dummy", irf="cta_dummy_irf"): + caldb="prod2", irf="South_50h"): """ Returns an observation container. -- libgit2 0.21.4