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