Commit 8fda31bf5b75d3134d65d656dd7284d99ac8734b

Authored by Jürgen Knödlseder
1 parent a5f21c87

Use new response functions in example scripts

examples/check_models.py
... ... @@ -41,8 +41,8 @@ def pipeline(model_name):
41 41 FITS files on disk. All data is only hold in memory.
42 42 """
43 43 # Set script parameters
44   - caldb = "dummy"
45   - irf = "cta_dummy_irf"
  44 + caldb = "prod2"
  45 + irf = "South_50h"
46 46 ra = 83.63
47 47 dec = 22.01
48 48 rad_sim = 10.0
... ...
examples/pipeline_binned_disk.py
... ... @@ -36,7 +36,7 @@ from ctools import obsutils
36 36 def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \
37 37 emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \
38 38 deadc=0.95, \
39   - caldb="dummy", irf="cta_dummy_irf"):
  39 + caldb="prod2", irf="South_50h"):
40 40 """
41 41 Returns an observation container.
42 42  
... ... @@ -96,7 +96,7 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \
96 96 enumbins=20, nxpix=200, nypix=200, binsz=0.02, \
97 97 coordsys="CEL", proj="CAR", \
98 98 model="${CTOOLS}/share/models/crab.xml", \
99   - caldb="dummy", irf="cta_dummy_irf", \
  99 + caldb="prod2", irf="South_50h", \
100 100 debug=False):
101 101 """
102 102 Simulation and binned analysis pipeline.
... ... @@ -165,6 +165,7 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \
165 165 like["outmodel"].filename("fit_results.xml")
166 166 like["expcube"].filename("NONE")
167 167 like["psfcube"].filename("NONE")
  168 + like["bkgcube"].filename("NONE")
168 169 like["caldb"].string(caldb)
169 170 like["irf"].string(irf)
170 171 like["debug"].boolean(True) # Switch this always on for results in console
... ...
examples/pipeline_binned_mem.py
... ... @@ -36,7 +36,7 @@ from ctools import obsutils
36 36 def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \
37 37 emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \
38 38 deadc=0.95, \
39   - caldb="dummy", irf="cta_dummy_irf"):
  39 + caldb="prod2", irf="South_50h"):
40 40 """
41 41 Returns an observation container.
42 42  
... ...
examples/pipeline_stacked_disk.py
... ... @@ -36,7 +36,7 @@ from ctools import obsutils
36 36 def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \
37 37 emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \
38 38 deadc=0.95, \
39   - caldb="dummy", irf="cta_dummy_irf"):
  39 + caldb="prod2", irf="South_50h"):
40 40 """
41 41 Returns an observation container.
42 42  
... ... @@ -96,7 +96,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \
96 96 enumbins=20, nxpix=200, nypix=200, binsz=0.02, \
97 97 coordsys="CEL", proj="CAR", \
98 98 model="${CTOOLS}/share/models/crab.xml", \
99   - caldb="dummy", irf="cta_dummy_irf", \
  99 + caldb="prod2", irf="South_50h", \
100 100 debug=False):
101 101 """
102 102 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, \
210 210 like["outmodel"].filename("fit_results.xml")
211 211 like["expcube"].filename("expcube.fits")
212 212 like["psfcube"].filename("psfcube.fits")
  213 + like["bkgcube"].filename("bkgcube.fits")
213 214 like["caldb"].string(caldb)
214 215 like["irf"].string(irf)
215 216 like["debug"].boolean(True) # Switch this always on for results in console
... ...
examples/pipeline_stacked_mem.py
... ... @@ -36,7 +36,7 @@ from ctools import obsutils
36 36 def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \
37 37 emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \
38 38 deadc=0.95, \
39   - caldb="dummy", irf="cta_dummy_irf"):
  39 + caldb="prod2", irf="South_50h"):
40 40 """
41 41 Returns an observation container.
42 42  
... ... @@ -188,7 +188,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \
188 188  
189 189 # Set Exposure and Psf cube for first CTA observation
190 190 # (ctbin will create an observation with a single container)
191   - bin.obs()[0].response(expcube.expcube(), psfcube.psfcube())
  191 + bin.obs()[0].response(expcube.expcube(), psfcube.psfcube(), bkgcube.bkgcube())
192 192  
193 193 # Perform maximum likelihood fitting
194 194 like = ctools.ctlike(bin.obs())
... ...
examples/pipeline_unbinned_disk.py
... ... @@ -36,7 +36,7 @@ from ctools import obsutils
36 36 def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \
37 37 emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \
38 38 deadc=0.95, \
39   - caldb="dummy", irf="cta_dummy_irf"):
  39 + caldb="prod2", irf="South_50h"):
40 40 """
41 41 Returns an observation container.
42 42  
... ... @@ -96,7 +96,7 @@ def run_pipeline(obs, ra=83.63, dec=22.01, rad=3.0, \
96 96 emin=0.1, emax=100.0, \
97 97 tmin=0.0, tmax=0.0, \
98 98 model="${CTOOLS}/share/models/crab.xml", \
99   - caldb="dummy", irf="cta_dummy_irf", \
  99 + caldb="prod2", irf="South_50h", \
100 100 debug=False):
101 101 """
102 102 Simulation and unbinned analysis pipeline.
... ...
examples/pipeline_unbinned_mem.py
... ... @@ -36,7 +36,7 @@ from ctools import obsutils
36 36 def setup_observations(pattern="four", ra=83.63, dec=22.01, offset=1.5, \
37 37 emin=0.1, emax=100.0, rad=5.0, duration=1800.0, \
38 38 deadc=0.95, \
39   - caldb="dummy", irf="cta_dummy_irf"):
  39 + caldb="prod2", irf="South_50h"):
40 40 """
41 41 Returns an observation container.
42 42  
... ...