diff --git a/ChangeLog b/ChangeLog index 693ef34..1039e54 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2018-07-03 +2018-07-17 * Version 1.6.0 released ======================== @@ -9,7 +9,8 @@ Handle zero model for SUBDIV method in show_response.py (#2456) Add Exponential spectral model to science verification (#2454) Fix bug when using precomputed model in csresspec (#2448) - Parallelise cslightcrv (#2421) + Parallelise cslightcrv, csphasecrv, csspec, cssens, csphagen, cspull and + cstsdist (#2421) Keep existing library path in installation script on Mac OS X (#2420) csphagen produces Xspec compliant data (#2404) Add show_rmf.py example script diff --git a/NEWS b/NEWS index e999b3a..b58c61c 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.6.0 -3 July 2018 +17 July 2018 Introduction @@ -244,6 +244,9 @@ Use time reference of input observations if time selection is given in MET csphagen - Generate On/Off observations --------------------------------------- +Add hidden "nthreads" parameter and implement parallelisation of computations +(#2421). + The true number of energy bins is now computed using int(bins_per_decade * num_of_decades + 0.5) 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). csphasecrv - Generate phase curve --------------------------------- -None +Add hidden "nthreads" parameter and implement parallelisation of computations +(#2421). cspull - Generate pull distributions ------------------------------------ +Add hidden "nthreads" parameter and implement parallelisation of computations +(#2421). + Add hidden "mjdref" parameter for the specification of the MET reference (#2054). @@ -282,11 +289,15 @@ None cssens - Computes sensitivity curve ----------------------------------- -None +Add hidden "nthreads" parameter and implement parallelisation of computations +(#2421). csspec - Generates Spectral Energy Distribution ----------------------------------------------- +Add hidden "nthreads" parameter and implement parallelisation of computations +(#2421). + csspec now properly computes the Test Statistic for an On/Off analysis using the "wstat" statistic in the case that the input model definition XML file did not contain a background model (#2312). @@ -303,7 +314,8 @@ None cstsdist - Computes Test Statistic distribution ----------------------------------------------- -None +Add hidden "nthreads" parameter and implement parallelisation of computations +(#2421). cstsmapmerge - Merge Test Statistic maps @@ -342,6 +354,11 @@ modutils - Model utilities None +mputils - Multiprocessing utilities +----------------------------------- +Introduce module (#2421). + + obsutils - Observation utilities -------------------------------- Add "mjdref" parameter to set_obs() function (#2054). diff --git a/cscripts/cssens.par b/cscripts/cssens.par index da795f8..2eb2c64 100755 --- a/cscripts/cssens.par +++ b/cscripts/cssens.par @@ -46,10 +46,10 @@ statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic" # Standard parameters #==================== nthreads, i, h, 0,0,1000, "Number of parallel processes (0=use all available CPUs)" -chatter, i, h, 2,0,4, "Chattiness of output" -clobber, b, h, yes,,, "Overwrite existing output files with new output files?" -debug, b, h, no,,, "Activate debugging mode?" -mode, s, h, ql,,, "Mode of automatic parameters" -logfile, f, h, cssens.log,,, "Log filename" +chatter, i, h, 2,0,4, "Chattiness of output" +clobber, b, h, yes,,, "Overwrite existing output files with new output files?" +debug, b, h, no,,, "Activate debugging mode?" +mode, s, h, ql,,, "Mode of automatic parameters" +logfile, f, h, cssens.log,,, "Log filename" diff --git a/cscripts/cstsdist.par b/cscripts/cstsdist.par index 492827d..d38ee3c 100755 --- a/cscripts/cstsdist.par +++ b/cscripts/cstsdist.par @@ -39,8 +39,8 @@ statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic" # Standard parameters #==================== nthreads, i, h, 0,0,1000, "Number of parallel processes (0=use all available CPUs)" -chatter, i, h, 2,0,4, "Chattiness of output" -clobber, b, h, yes,,, "Overwrite existing output files with new output files?" -debug, b, h, no,,, "Activate debugging mode?" -mode, s, h, ql,,, "Mode of automatic parameters" -logfile, f, h, cstsdist.log,,, "Log filename" +chatter, i, h, 2,0,4, "Chattiness of output" +clobber, b, h, yes,,, "Overwrite existing output files with new output files?" +debug, b, h, no,,, "Activate debugging mode?" +mode, s, h, ql,,, "Mode of automatic parameters" +logfile, f, h, cstsdist.log,,, "Log filename" diff --git a/cscripts/cstsdist.py b/cscripts/cstsdist.py index b357eaf..b0b53f4 100755 --- a/cscripts/cstsdist.py +++ b/cscripts/cstsdist.py @@ -89,11 +89,11 @@ class cstsdist(ctools.csobservation): Pickled instance """ # Set pickled dictionary - state = {'base' : ctools.csobservation.__getstate__(self), - 'srcname' : self._srcname, - 'log_clients' : self._log_clients, - 'model' : self._model, - 'nthreads' : self._nthreads} + state = {'base' : ctools.csobservation.__getstate__(self), + 'srcname' : self._srcname, + 'log_clients' : self._log_clients, + 'model' : self._model, + 'nthreads' : self._nthreads} # Return pickled dictionary return state @@ -108,10 +108,10 @@ class cstsdist(ctools.csobservation): Pickled instance """ ctools.csobservation.__setstate__(self, state['base']) - self._srcname = state['srcname'] - self._log_clients = state['log_clients'] - self._model = state['model'] - self._nthreads = state['nthreads'] + self._srcname = state['srcname'] + self._log_clients = state['log_clients'] + self._model = state['model'] + self._nthreads = state['nthreads'] # Return return @@ -199,7 +199,7 @@ class cstsdist(ctools.csobservation): seed = seed, log = self._log_clients, debug = self['debug'].boolean(), - nthreads =1) + nthreads = 1) # Return simulated observation return sim diff --git a/cscripts/obsutils.py b/cscripts/obsutils.py index adff62e..e94f1ac 100755 --- a/cscripts/obsutils.py +++ b/cscripts/obsutils.py @@ -28,7 +28,7 @@ import cscripts # ===================== # def sim(obs, log=False, debug=False, chatter=2, edisp=False, seed=0, emin=None, emax=None, nbins=0, onsrc=None, onrad=0.2, addbounds=False, - binsz=0.05, npix=200, proj='TAN', coord='GAL',nthreads=0): + binsz=0.05, npix=200, proj='TAN', coord='GAL', nthreads=0): """ Simulate events for all observations in the container diff --git a/doc/source/admin/release_history/1.6.rst b/doc/source/admin/release_history/1.6.rst index 2505e62..11b9cec 100644 --- a/doc/source/admin/release_history/1.6.rst +++ b/doc/source/admin/release_history/1.6.rst @@ -12,7 +12,7 @@ In particular, this release provides: * Support for Xspec spectral analysis * Improved computation speed for :ref:`ctskymap` and :ref:`csphagen` -* Parallelisation of :ref:`cslightcrv` +* Parallelisation of various cscripts * Support for Python pickeling @@ -34,8 +34,6 @@ Improvements Transparently update parameter files * [`2490 `_] - Change formula for number of true energy bins in :ref:`csphagen` -* [`2421 `_] - - Parallelise :ref:`cslightcrv` * [`2404 `_] - :ref:`csphagen` produces Xspec compliant data * Add ``show_rmf.py`` example script @@ -57,6 +55,9 @@ Improvements New features ------------ +* [`2421 `_] - + Parallelise :ref:`cslightcrv`, :ref:`csphasecrv`, :ref:`csspec`, :ref:`cssens`, + :ref:`csphagen`, :ref:`cspull` and :ref:`cstsdist` * [`1938 `_] - Support pickeling of ctools and cscripts in Python