Commit 62f55b32191422cc60f0eba359cb9546dce3165e

Authored by Jürgen Knödlseder
1 parent 1974e9c2

Integrate code

ChangeLog
1 -2018-07-03 1 +2018-07-17
2 2
3 * Version 1.6.0 released 3 * Version 1.6.0 released
4 ======================== 4 ========================
@@ -9,7 +9,8 @@ @@ -9,7 +9,8 @@
9 Handle zero model for SUBDIV method in show_response.py (#2456) 9 Handle zero model for SUBDIV method in show_response.py (#2456)
10 Add Exponential spectral model to science verification (#2454) 10 Add Exponential spectral model to science verification (#2454)
11 Fix bug when using precomputed model in csresspec (#2448) 11 Fix bug when using precomputed model in csresspec (#2448)
12 - Parallelise cslightcrv (#2421) 12 + Parallelise cslightcrv, csphasecrv, csspec, cssens, csphagen, cspull and
  13 + cstsdist (#2421)
13 Keep existing library path in installation script on Mac OS X (#2420) 14 Keep existing library path in installation script on Mac OS X (#2420)
14 csphagen produces Xspec compliant data (#2404) 15 csphagen produces Xspec compliant data (#2404)
15 Add show_rmf.py example script 16 Add show_rmf.py example script
1 New Features and Important Changes in ctools 1.6.0 1 New Features and Important Changes in ctools 1.6.0
2 2
3 -3 July 2018 3 +17 July 2018
4 4
5 5
6 Introduction 6 Introduction
@@ -244,6 +244,9 @@ Use time reference of input observations if time selection is given in MET @@ -244,6 +244,9 @@ Use time reference of input observations if time selection is given in MET
244 244
245 csphagen - Generate On/Off observations 245 csphagen - Generate On/Off observations
246 --------------------------------------- 246 ---------------------------------------
  247 +Add hidden "nthreads" parameter and implement parallelisation of computations
  248 +(#2421).
  249 +
247 The true number of energy bins is now computed using 250 The true number of energy bins is now computed using
248 int(bins_per_decade * num_of_decades + 0.5) 251 int(bins_per_decade * num_of_decades + 0.5)
249 making sure in addition that the result is at least 1. This provides better 252 making sure in addition that the result is at least 1. This provides better
@@ -255,11 +258,15 @@ tutorial was added to the user documentation (#2404). @@ -255,11 +258,15 @@ tutorial was added to the user documentation (#2404).
255 258
256 csphasecrv - Generate phase curve 259 csphasecrv - Generate phase curve
257 --------------------------------- 260 ---------------------------------
258 -None 261 +Add hidden "nthreads" parameter and implement parallelisation of computations
  262 +(#2421).
259 263
260 264
261 cspull - Generate pull distributions 265 cspull - Generate pull distributions
262 ------------------------------------ 266 ------------------------------------
  267 +Add hidden "nthreads" parameter and implement parallelisation of computations
  268 +(#2421).
  269 +
263 Add hidden "mjdref" parameter for the specification of the MET reference 270 Add hidden "mjdref" parameter for the specification of the MET reference
264 (#2054). 271 (#2054).
265 272
@@ -282,11 +289,15 @@ None @@ -282,11 +289,15 @@ None
282 289
283 cssens - Computes sensitivity curve 290 cssens - Computes sensitivity curve
284 ----------------------------------- 291 -----------------------------------
285 -None 292 +Add hidden "nthreads" parameter and implement parallelisation of computations
  293 +(#2421).
286 294
287 295
288 csspec - Generates Spectral Energy Distribution 296 csspec - Generates Spectral Energy Distribution
289 ----------------------------------------------- 297 -----------------------------------------------
  298 +Add hidden "nthreads" parameter and implement parallelisation of computations
  299 +(#2421).
  300 +
290 csspec now properly computes the Test Statistic for an On/Off analysis using 301 csspec now properly computes the Test Statistic for an On/Off analysis using
291 the "wstat" statistic in the case that the input model definition XML file 302 the "wstat" statistic in the case that the input model definition XML file
292 did not contain a background model (#2312). 303 did not contain a background model (#2312).
@@ -303,7 +314,8 @@ None @@ -303,7 +314,8 @@ None
303 314
304 cstsdist - Computes Test Statistic distribution 315 cstsdist - Computes Test Statistic distribution
305 ----------------------------------------------- 316 -----------------------------------------------
306 -None 317 +Add hidden "nthreads" parameter and implement parallelisation of computations
  318 +(#2421).
307 319
308 320
309 cstsmapmerge - Merge Test Statistic maps 321 cstsmapmerge - Merge Test Statistic maps
@@ -342,6 +354,11 @@ modutils - Model utilities @@ -342,6 +354,11 @@ modutils - Model utilities
342 None 354 None
343 355
344 356
  357 +mputils - Multiprocessing utilities
  358 +-----------------------------------
  359 +Introduce module (#2421).
  360 +
  361 +
345 obsutils - Observation utilities 362 obsutils - Observation utilities
346 -------------------------------- 363 --------------------------------
347 Add "mjdref" parameter to set_obs() function (#2054). 364 Add "mjdref" parameter to set_obs() function (#2054).
cscripts/cssens.par
@@ -46,10 +46,10 @@ statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic" @@ -46,10 +46,10 @@ statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic"
46 # Standard parameters 46 # Standard parameters
47 #==================== 47 #====================
48 nthreads, i, h, 0,0,1000, "Number of parallel processes (0=use all available CPUs)" 48 nthreads, i, h, 0,0,1000, "Number of parallel processes (0=use all available CPUs)"
49 -chatter, i, h, 2,0,4, "Chattiness of output"  
50 -clobber, b, h, yes,,, "Overwrite existing output files with new output files?"  
51 -debug, b, h, no,,, "Activate debugging mode?"  
52 -mode, s, h, ql,,, "Mode of automatic parameters"  
53 -logfile, f, h, cssens.log,,, "Log filename" 49 +chatter, i, h, 2,0,4, "Chattiness of output"
  50 +clobber, b, h, yes,,, "Overwrite existing output files with new output files?"
  51 +debug, b, h, no,,, "Activate debugging mode?"
  52 +mode, s, h, ql,,, "Mode of automatic parameters"
  53 +logfile, f, h, cssens.log,,, "Log filename"
54 54
55 55
cscripts/cstsdist.par
@@ -39,8 +39,8 @@ statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic" @@ -39,8 +39,8 @@ statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic"
39 # Standard parameters 39 # Standard parameters
40 #==================== 40 #====================
41 nthreads, i, h, 0,0,1000, "Number of parallel processes (0=use all available CPUs)" 41 nthreads, i, h, 0,0,1000, "Number of parallel processes (0=use all available CPUs)"
42 -chatter, i, h, 2,0,4, "Chattiness of output"  
43 -clobber, b, h, yes,,, "Overwrite existing output files with new output files?"  
44 -debug, b, h, no,,, "Activate debugging mode?"  
45 -mode, s, h, ql,,, "Mode of automatic parameters"  
46 -logfile, f, h, cstsdist.log,,, "Log filename" 42 +chatter, i, h, 2,0,4, "Chattiness of output"
  43 +clobber, b, h, yes,,, "Overwrite existing output files with new output files?"
  44 +debug, b, h, no,,, "Activate debugging mode?"
  45 +mode, s, h, ql,,, "Mode of automatic parameters"
  46 +logfile, f, h, cstsdist.log,,, "Log filename"
cscripts/cstsdist.py
@@ -89,11 +89,11 @@ class cstsdist(ctools.csobservation): @@ -89,11 +89,11 @@ class cstsdist(ctools.csobservation):
89 Pickled instance 89 Pickled instance
90 """ 90 """
91 # Set pickled dictionary 91 # Set pickled dictionary
92 - state = {'base' : ctools.csobservation.__getstate__(self),  
93 - 'srcname' : self._srcname,  
94 - 'log_clients' : self._log_clients,  
95 - 'model' : self._model,  
96 - 'nthreads' : self._nthreads} 92 + state = {'base' : ctools.csobservation.__getstate__(self),
  93 + 'srcname' : self._srcname,
  94 + 'log_clients' : self._log_clients,
  95 + 'model' : self._model,
  96 + 'nthreads' : self._nthreads}
97 97
98 # Return pickled dictionary 98 # Return pickled dictionary
99 return state 99 return state
@@ -108,10 +108,10 @@ class cstsdist(ctools.csobservation): @@ -108,10 +108,10 @@ class cstsdist(ctools.csobservation):
108 Pickled instance 108 Pickled instance
109 """ 109 """
110 ctools.csobservation.__setstate__(self, state['base']) 110 ctools.csobservation.__setstate__(self, state['base'])
111 - self._srcname = state['srcname']  
112 - self._log_clients = state['log_clients']  
113 - self._model = state['model']  
114 - self._nthreads = state['nthreads'] 111 + self._srcname = state['srcname']
  112 + self._log_clients = state['log_clients']
  113 + self._model = state['model']
  114 + self._nthreads = state['nthreads']
115 115
116 # Return 116 # Return
117 return 117 return
@@ -199,7 +199,7 @@ class cstsdist(ctools.csobservation): @@ -199,7 +199,7 @@ class cstsdist(ctools.csobservation):
199 seed = seed, 199 seed = seed,
200 log = self._log_clients, 200 log = self._log_clients,
201 debug = self['debug'].boolean(), 201 debug = self['debug'].boolean(),
202 - nthreads =1) 202 + nthreads = 1)
203 203
204 # Return simulated observation 204 # Return simulated observation
205 return sim 205 return sim
cscripts/obsutils.py
@@ -28,7 +28,7 @@ import cscripts @@ -28,7 +28,7 @@ import cscripts
28 # ===================== # 28 # ===================== #
29 def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0, 29 def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0,
30 emin=None, emax=None, nbins=0, onsrc=None, onrad=0.2, addbounds=False, 30 emin=None, emax=None, nbins=0, onsrc=None, onrad=0.2, addbounds=False,
31 - binsz=0.05, npix=200, proj='TAN', coord='GAL',nthreads=0): 31 + binsz=0.05, npix=200, proj='TAN', coord='GAL', nthreads=0):
32 """ 32 """
33 Simulate events for all observations in the container 33 Simulate events for all observations in the container
34 34
doc/source/admin/release_history/1.6.rst
@@ -12,7 +12,7 @@ In particular, this release provides: @@ -12,7 +12,7 @@ In particular, this release provides:
12 12
13 * Support for Xspec spectral analysis 13 * Support for Xspec spectral analysis
14 * Improved computation speed for :ref:`ctskymap` and :ref:`csphagen` 14 * Improved computation speed for :ref:`ctskymap` and :ref:`csphagen`
15 -* Parallelisation of :ref:`cslightcrv` 15 +* Parallelisation of various cscripts
16 * Support for Python pickeling 16 * Support for Python pickeling
17 17
18 18
@@ -34,8 +34,6 @@ Improvements @@ -34,8 +34,6 @@ Improvements
34 Transparently update parameter files 34 Transparently update parameter files
35 * [`2490 <https://cta-redmine.irap.omp.eu/issues/2490>`_] - 35 * [`2490 <https://cta-redmine.irap.omp.eu/issues/2490>`_] -
36 Change formula for number of true energy bins in :ref:`csphagen` 36 Change formula for number of true energy bins in :ref:`csphagen`
37 -* [`2421 <https://cta-redmine.irap.omp.eu/issues/2421>`_] -  
38 - Parallelise :ref:`cslightcrv`  
39 * [`2404 <https://cta-redmine.irap.omp.eu/issues/2404>`_] - 37 * [`2404 <https://cta-redmine.irap.omp.eu/issues/2404>`_] -
40 :ref:`csphagen` produces Xspec compliant data 38 :ref:`csphagen` produces Xspec compliant data
41 * Add ``show_rmf.py`` example script 39 * Add ``show_rmf.py`` example script
@@ -57,6 +55,9 @@ Improvements @@ -57,6 +55,9 @@ Improvements
57 New features 55 New features
58 ------------ 56 ------------
59 57
  58 +* [`2421 <https://cta-redmine.irap.omp.eu/issues/2421>`_] -
  59 + Parallelise :ref:`cslightcrv`, :ref:`csphasecrv`, :ref:`csspec`, :ref:`cssens`,
  60 + :ref:`csphagen`, :ref:`cspull` and :ref:`cstsdist`
60 * [`1938 <https://cta-redmine.irap.omp.eu/issues/1938>`_] - 61 * [`1938 <https://cta-redmine.irap.omp.eu/issues/1938>`_] -
61 Support pickeling of ctools and cscripts in Python 62 Support pickeling of ctools and cscripts in Python
62 63