Commit 16dfc641f850475ba1807cd2c4dab7cb5450fcfb

Authored by Jürgen Knödlseder
1 parent 9ead1e8d

Enable using csphagen for HESS, VERITAS and MAGIC observations (#2307)

ChangeLog
1 -2018-01-25 1 +2018-02-08
  2 +
  3 + * Bug fix version 1.5.1 released
  4 + ================================
  5 +
  6 + Enable using csphagen for HESS, VERITAS and MAGIC observations (#2307)
  7 +
2 8
3 * Version 1.5.0 released 9 * Version 1.5.0 released
4 ======================== 10 ========================
1 -25 January 2018 1 +8 February 2018
2 2
3 3
4 Introduction 4 Introduction
@@ -9,10 +9,7 @@ ctools release with respect to the precedent release. @@ -9,10 +9,7 @@ ctools release with respect to the precedent release.
9 9
10 Configuration 10 Configuration
11 ------------- 11 -------------
12 -In case of an error, test output is now written into log file (#2264).  
13 -  
14 -The cscripts::execute() method no longer creates log files, making the  
15 -cscripts behaviour compliant with that of ctools (#2182). 12 +None
16 13
17 14
18 Python interface 15 Python interface
@@ -27,8 +24,7 @@ None @@ -27,8 +24,7 @@ None
27 24
28 Base classes 25 Base classes
29 ------------ 26 ------------
30 -Add ctools::time_reference constant and remove ctools::time_reference() method  
31 -(#2295). 27 +None
32 28
33 29
34 ctbin - CTA event binning 30 ctbin - CTA event binning
@@ -43,9 +39,7 @@ None @@ -43,9 +39,7 @@ None
43 39
44 ctbutterfly - Generate butterfly diagrams 40 ctbutterfly - Generate butterfly diagrams
45 ----------------------------------------- 41 -----------------------------------------
46 -Add "statistic" parameter to allow setting of optimizer statistic (#2237).  
47 -  
48 -Add butterfly() method to return the butterfly diagram as CSV object (#1512). 42 +None
49 43
50 44
51 ctcubemask - CTA cube filtering 45 ctcubemask - CTA cube filtering
@@ -60,7 +54,7 @@ None @@ -60,7 +54,7 @@ None
60 54
61 cterror - Likelihood profile error computation 55 cterror - Likelihood profile error computation
62 ---------------------------------------------- 56 ----------------------------------------------
63 -Add "statistic" parameter to allow setting of optimizer statistic (#2237). 57 +None
64 58
65 59
66 ctexpcube - CTA exposure cube generation 60 ctexpcube - CTA exposure cube generation
@@ -70,7 +64,7 @@ None @@ -70,7 +64,7 @@ None
70 64
71 ctlike - Maximum likelihood fitting 65 ctlike - Maximum likelihood fitting
72 ----------------------------------- 66 -----------------------------------
73 -Rename "stats" parameter to "statistic" (#2237). 67 +None
74 68
75 69
76 ctmapcube - CTA map cube generation 70 ctmapcube - CTA map cube generation
@@ -80,22 +74,12 @@ None @@ -80,22 +74,12 @@ None
80 74
81 ctmodel - CTA counts cube modelling 75 ctmodel - CTA counts cube modelling
82 ----------------------------------- 76 -----------------------------------
83 -Use t-type parameters for "tmin" and "tmax" to all specifying times in various  
84 -formats (#1864).  
85 -  
86 -The tool now also checks which models actually overlap with the RoI of a given  
87 -observation and then only use these models to compute the model cube. The  
88 -parallelization of the tool has also been optimised so that diffuse models are  
89 -not loaded over and over again (#2189). 77 +None
90 78
91 79
92 ctobssim - CTA observation simulation 80 ctobssim - CTA observation simulation
93 ------------------------------------- 81 -------------------------------------
94 -Use t-type parameters for "tmin" and "tmax" to all specifying times in various  
95 -formats (#1864).  
96 -  
97 -Set the OBS_ID keyword to the number that is used for creating the FITS file  
98 -(#1836). 82 +None
99 83
100 84
101 ctphase - Event phase computation 85 ctphase - Event phase computation
@@ -110,51 +94,32 @@ None @@ -110,51 +94,32 @@ None
110 94
111 ctpsfcube - CTA point spread function cube generation 95 ctpsfcube - CTA point spread function cube generation
112 ----------------------------------------------------- 96 -----------------------------------------------------
113 -The chatter level is now correctly forwarded to the PSF cube fill method (#2262). 97 +None
114 98
115 99
116 ctselect - CTA event selection 100 ctselect - CTA event selection
117 ------------------------------ 101 ------------------------------
118 -Any .gz suffix is now correctly stripped from the event filenames when creating  
119 -the output filenames (#2287).  
120 -  
121 -ctselect now informs about non-overlapping time interval; before the time interval  
122 -was set to [0,0] which was disturbing and eventually incorrect (#2272).  
123 -  
124 -Use t-type parameters for "tmin" and "tmax" to all specifying times in various  
125 -formats (#1864). 102 +None
126 103
127 104
128 ctskymap - CTA sky mapping 105 ctskymap - CTA sky mapping
129 -------------------------- 106 --------------------------
130 -Header keywords informing about the dates and times covered by the observations  
131 -used to generate the skymap, as well as the event energy range, are now appended  
132 -as header keywords to the FITS file (#2194).  
133 -  
134 -Add the RING background method, which is a classical analysis methods for IACT  
135 -data analysis, for background subtraction (#2207). 107 +None
136 108
137 109
138 cttsmap - Generation of Test Statistic map 110 cttsmap - Generation of Test Statistic map
139 ------------------------------------------ 111 ------------------------------------------
140 -Add "statistic" parameter to allow setting of optimizer statistic (#2237). 112 +None
141 113
142 114
143 ctulimit - Compute upper limit 115 ctulimit - Compute upper limit
144 ------------------------------ 116 ------------------------------
145 -The tool now also computes correct upper flux limits for diffuse map cubes  
146 -for which the spectral component is a normalization of the spectral information  
147 -available in the map cube (#2298).  
148 -  
149 -Add "statistic" parameter to allow setting of optimizer statistic (#2237). 117 +None
150 118
151 119
152 support - Support classes 120 support - Support classes
153 ------------------------- 121 -------------------------
154 -Change DATE_OBS, DATE_END, TIME_OBS and TIME_END FITS keywords into DATA-OBS,  
155 -DATE-END, TIME-OBS and TIME-END.  
156 -  
157 -Add ctobservation.obs() method to set an observation container. 122 +None
158 123
159 124
160 cscaldb - Inspect calibration database 125 cscaldb - Inspect calibration database
@@ -189,16 +154,7 @@ None @@ -189,16 +154,7 @@ None
189 154
190 cslightcrv - Generate light curve 155 cslightcrv - Generate light curve
191 --------------------------------- 156 ---------------------------------
192 -The script now also supports the handling of On/Off observations. For that  
193 -purpose parameters were added that are needed for the execution of the  
194 -csphagen script (#2273).  
195 -  
196 -The script now derives from the csobservation base class. A "statistic"  
197 -parameter was added to allow setting the optimizer statistic for the light  
198 -curve generation (#2237).  
199 -  
200 -Use t-type parameters for "tmin" and "tmax" to all specifying times in various  
201 -formats (#1864). 157 +None
202 158
203 159
204 csmodelinfo - Return model information 160 csmodelinfo - Return model information
@@ -218,8 +174,7 @@ None @@ -218,8 +174,7 @@ None
218 174
219 csmodelsois - Puts selected sources in diffuse model cube 175 csmodelsois - Puts selected sources in diffuse model cube
220 --------------------------------------------------------- 176 ---------------------------------------------------------
221 -Add script that replaces selected models in a model container by a diffuse  
222 -map cube (#2180). 177 +None
223 178
224 179
225 csobs2caldb - Generate calibration database entry for an IACT observation 180 csobs2caldb - Generate calibration database entry for an IACT observation
@@ -239,42 +194,22 @@ None @@ -239,42 +194,22 @@ None
239 194
240 csobsselect - Select observations 195 csobsselect - Select observations
241 --------------------------------- 196 ---------------------------------
242 -Add tmin and tmax parameters to allow selection of observation by time (#2297). 197 +None
243 198
244 199
245 csphagen - Generate On/Off observations 200 csphagen - Generate On/Off observations
246 --------------------------------------- 201 ---------------------------------------
247 -The CUSTOM background method was added to allow specifying On and Off regions  
248 -from a region file or FITS WCS map. For multiple observations, a custom Off  
249 -region per observation can be specified in the observation definition XML file  
250 -using the OffRegions parameter (#2284).  
251 -  
252 -The script was added to allow the generation of PHA, ARF and RMF datasets for classical On/Off IACT analysis (#2208). 202 +Enable using the script also for HESS, VERITAS and MAGIC observations (#2307).
253 203
254 204
255 csphasecrv - Generate phase curve 205 csphasecrv - Generate phase curve
256 --------------------------------- 206 ---------------------------------
257 -The script now also supports the handling of On/Off observations. For that  
258 -purpose parameters were added that are needed for the execution of the  
259 -csphagen script (#2273).  
260 -  
261 -The script now derives from the csobservation base class. A "statistic"  
262 -parameter was added to allow setting the optimizer statistic for the light  
263 -curve generation (#2237). 207 +None
264 208
265 209
266 cspull - Generate pull distributions 210 cspull - Generate pull distributions
267 ------------------------------------ 211 ------------------------------------
268 -The script now handles On/Off observation. The parameters "onsrc" and "onrad"  
269 -were added to allow specifying the On region test source and On region radius  
270 -(#2260).  
271 -  
272 -The script now derives from the csobservation base class. A "statistic"  
273 -parameter was added to allow setting the optimizer statistic for the pull  
274 -distribution generation (#2237).  
275 -  
276 -Use t-type parameters for "tmin" and "tmax" to all specifying times in various  
277 -formats (#1864). 212 +None
278 213
279 214
280 csresmap - Generate residual map 215 csresmap - Generate residual map
@@ -284,7 +219,7 @@ None @@ -284,7 +219,7 @@ None
284 219
285 csresspec - Generate residual spectrum 220 csresspec - Generate residual spectrum
286 -------------------------------------- 221 --------------------------------------
287 -Add script to generate a residual spectrum (#2289) 222 +None
288 223
289 224
290 csroot2caldb - Generates calibration database from ROOT file 225 csroot2caldb - Generates calibration database from ROOT file
@@ -294,25 +229,12 @@ None @@ -294,25 +229,12 @@ None
294 229
295 cssens - Computes sensitivity curve 230 cssens - Computes sensitivity curve
296 ----------------------------------- 231 -----------------------------------
297 -The script now derived from the csobservation base class. A "statistic"  
298 -parameter was added to allow setting the optimizer statistic for the sensitivity  
299 -computation (#2237). 232 +None
300 233
301 234
302 csspec - Generates Spectral Energy Distribution 235 csspec - Generates Spectral Energy Distribution
303 ----------------------------------------------- 236 -----------------------------------------------
304 -The script now derives from the csobservation base class. A "statistic"  
305 -parameter was added to allow setting the optimizer statistic for the spectrum  
306 -generation (#2237).  
307 -  
308 -The script now can also handle On/Off spectra for SED generation (#2231).  
309 -  
310 -The script now can also handle non-CTA data. For that purpose a "method"  
311 -parameter has been introduced that allows to selected between slicing of the data  
312 -(method="SLICE"), which is only supported for CTA observations, and replacing of  
313 -the spectral model by a node function (method="NODES"). If method="AUTO" the tool  
314 -will use "SLICE" for observations containing only CTA data and "NODES" for observations  
315 -containing other data (#1927). 237 +None
316 238
317 239
318 cssrcdetect - Detects sources in sky map 240 cssrcdetect - Detects sources in sky map
@@ -322,18 +244,7 @@ None @@ -322,18 +244,7 @@ None
322 244
323 cstsdist - Computes Test Statistic distribution 245 cstsdist - Computes Test Statistic distribution
324 ----------------------------------------------- 246 -----------------------------------------------
325 -The script now derives from the csobservation base class. A "statistic"  
326 -parameter was added to allow setting the optimizer statistic for the Test  
327 -Statistic distribution generation (#2237).  
328 -  
329 -The parameter interface was considerably revised, in particular the following  
330 -parameters were removed: "ra", "dec", "rad", "coordsys", "proj", "emin",  
331 -"emax", "enumbins", "tmin", "tmax", "npix" and "binsz". The "inobs" parameter  
332 -is now always queried. The script now reads in an observation or an observation  
333 -container and derives the TS distribution for a source based on that observation  
334 -container. So far the script supports unbinned, binned and stacked observations.  
335 -If an observation definition XML file is specified the script assumes that all  
336 -observations are event lists (#1567). 247 +None
337 248
338 249
339 cstsmapmerge - Merge Test Statistic maps 250 cstsmapmerge - Merge Test Statistic maps
@@ -343,14 +254,12 @@ None @@ -343,14 +254,12 @@ None
343 254
344 cstsmapsplit - Prepare split Test Statistic computation 255 cstsmapsplit - Prepare split Test Statistic computation
345 ------------------------------------------------------- 256 -------------------------------------------------------
346 -A "statistic" parameter was added to allow setting the optimizer statistic for  
347 -the TS map generation (#2237). 257 +None
348 258
349 259
350 csviscube - Generate visibility cube 260 csviscube - Generate visibility cube
351 ------------------------------------ 261 ------------------------------------
352 -Use t-type parameters for "tmin" and "tmax" to all specifying times in various  
353 -formats (#1864). 262 +None
354 263
355 264
356 csworkflow - Execute workflow 265 csworkflow - Execute workflow
cscripts/csphagen.py
@@ -123,7 +123,8 @@ class csphagen(ctools.csobservation): @@ -123,7 +123,8 @@ class csphagen(ctools.csobservation):
123 # Off region region the parameter 'bkgregfile' for all CTA observations 123 # Off region region the parameter 'bkgregfile' for all CTA observations
124 # without Off region 124 # without Off region
125 for obs in self.obs(): 125 for obs in self.obs():
126 - if obs.instrument() == 'CTA': 126 + #if obs.instrument() == 'CTA':
  127 + if obs.classname() == 'GCTAObservation':
127 if obs.off_regions().is_empty(): 128 if obs.off_regions().is_empty():
128 filename = self['bkgregfile'].filename() 129 filename = self['bkgregfile'].filename()
129 regions = gammalib.GSkyRegions(filename) 130 regions = gammalib.GSkyRegions(filename)
@@ -263,8 +264,8 @@ class csphagen(ctools.csobservation): @@ -263,8 +264,8 @@ class csphagen(ctools.csobservation):
263 """ 264 """
264 Set models in observation container 265 Set models in observation container
265 266
266 - The method replaces all "CTA" background models by "CTAOnOff"  
267 - background models. 267 + The method replaces all "CTA", "HESS", "VERITAS", and "MAGIC"
  268 + background models by "CTAOnOff" background models.
268 269
269 Parameters 270 Parameters
270 ---------- 271 ----------
@@ -279,11 +280,15 @@ class csphagen(ctools.csobservation): @@ -279,11 +280,15 @@ class csphagen(ctools.csobservation):
279 # Initialise model container 280 # Initialise model container
280 models = gammalib.GModels() 281 models = gammalib.GModels()
281 282
282 - # Loop over all models and replace CTA background model by CTAOnOff  
283 - # background model 283 + # Loop over all models and replace CTA/HESS/VERITAS/MAGIC background
  284 + # models by CTAOnOff background model
284 for model in self.obs().models(): 285 for model in self.obs().models():
285 - if 'GCTA' in model.classname() and 'CTA' in model.instruments():  
286 - model.instruments('CTAOnOff') 286 + if 'GCTA' in model.classname():
  287 + if 'CTA' in model.instruments() or \
  288 + 'HESS' in model.instruments() or \
  289 + 'VERITAS' in model.instruments() or \
  290 + 'MAGIC' in model.instruments():
  291 + model.instruments('CTAOnOff')
287 models.append(model) 292 models.append(model)
288 293
289 # Append model to observation container 294 # Append model to observation container
@@ -399,7 +404,8 @@ class csphagen(ctools.csobservation): @@ -399,7 +404,8 @@ class csphagen(ctools.csobservation):
399 for obs in self.obs(): 404 for obs in self.obs():
400 405
401 # Skip non CTA observations 406 # Skip non CTA observations
402 - if obs.instrument() != 'CTA': 407 + #if obs.instrument() != 'CTA':
  408 + if obs.classname() != 'GCTAObservation':
403 self._log_string(gammalib.NORMAL, 'Skip %s observation "%s"' % \ 409 self._log_string(gammalib.NORMAL, 'Skip %s observation "%s"' % \
404 (obs.instrument(), obs.id())) 410 (obs.instrument(), obs.id()))
405 continue 411 continue
doc/source/admin/release_history/1.5.1.rst 0 → 100644
  1 +.. _1.5.1:
  2 +
  3 +ctools 1.5.1 release
  4 +====================
  5 +
  6 +Overview
  7 +--------
  8 +
  9 +ctools 1.5.1 is a bug fix release for ctools release 1.5.
  10 +
  11 +The following bugs were fixed:
  12 +
  13 +* ...
  14 +
  15 +The following improvements were made:
  16 +
  17 +* [`2307 <https://cta-redmine.irap.omp.eu/issues/2307>`_] -
  18 + Enable using :ref:`csphagen` for HESS, VERITAS and MAGIC observations
doc/source/admin/release_history/index.rst
@@ -6,6 +6,7 @@ Release History @@ -6,6 +6,7 @@ Release History
6 .. toctree:: 6 .. toctree::
7 :maxdepth: 1 7 :maxdepth: 1
8 8
  9 + ctools 1.5.1 <1.5.1>
9 ctools 1.5 <1.5> 10 ctools 1.5 <1.5>
10 ctools 1.4.3 <1.4.3> 11 ctools 1.4.3 <1.4.3>
11 ctools 1.4.2 <1.4.2> 12 ctools 1.4.2 <1.4.2>