From d72c13e649476d06e9d9916a5c17da71a80c28c1 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 22 Feb 2022 15:45:01 +0100 Subject: [PATCH] Rename virtual abstract ctool::run() method to ctool::process() and add non-abstract ctool::run() method (#3592) --- ChangeLog | 4 +++- NEWS | 7 +++++-- README.md | 2 +- cscripts/csadd2caldb.py | 10 +++------- cscripts/csbkgmodel.py | 10 +++------- cscripts/cscaldb.py | 10 +++------- cscripts/csebins.py | 10 +++------- cscripts/csfindobs.py | 10 +++------- cscripts/csfootprint.py | 8 ++------ cscripts/csiactcopy.py | 10 +++------- cscripts/csiactdata.py | 10 +++------- cscripts/csiactobs.py | 10 +++------- cscripts/cslightcrv.py | 10 +++------- cscripts/csmodelinfo.py | 10 +++------- cscripts/csmodelmerge.py | 10 +++------- cscripts/csmodelselect.py | 10 +++------- cscripts/csmodelsois.py | 8 ++------ cscripts/csobs2caldb.py | 10 +++------- cscripts/csobsdef.py | 10 +++------- cscripts/csobsinfo.py | 10 +++------- cscripts/csobsselect.py | 10 +++------- cscripts/csphagen.py | 10 +++------- cscripts/csphasecrv.py | 10 +++------- cscripts/cspull.py | 10 +++------- cscripts/csresmap.py | 10 +++------- cscripts/csresspec.py | 10 +++------- cscripts/csroot2caldb.py | 10 +++------- cscripts/csscs.py | 10 +++------- cscripts/cssens.py | 10 +++------- cscripts/csspec.py | 10 +++------- cscripts/cssrcdetect.py | 10 +++------- cscripts/cstsdist.py | 10 +++------- cscripts/cstsmapmerge.py | 10 +++------- cscripts/cstsmapsplit.py | 10 +++------- cscripts/csviscube.py | 8 ++------ cscripts/csworkflow.py | 10 +++------- doc/source/admin/release_history/2.0.rst | 6 ++++-- modules/comscripts/comlixfit.py | 8 ++------ modules/comscripts/comlixmap.py | 8 ++------ modules/comscripts/comobsadd.py | 8 ++------ modules/comscripts/comobsback.py | 10 +++------- modules/comscripts/comobsbin.py | 8 ++------ modules/comscripts/comobsmodel.py | 8 ++------ modules/comscripts/comobsres.py | 10 +++------- modules/comscripts/comobsselect.py | 10 +++------- modules/comscripts/comobssim.py | 10 +++------- modules/comscripts/compulbin.py | 8 ++------ modules/comscripts/comsrcdetect.py | 10 +++------- pyext/ctbin.i | 4 ++-- pyext/ctbkgcube.i | 4 ++-- pyext/ctbutterfly.i | 4 ++-- pyext/ctcubemask.i | 4 ++-- pyext/ctedispcube.i | 4 ++-- pyext/cterror.i | 4 ++-- pyext/ctexpcube.i | 4 ++-- pyext/ctfindvar.i | 4 ++-- pyext/ctlike.i | 2 +- pyext/ctlikelihood.i | 23 ++++++++++++++++++----- pyext/ctmapcube.i | 4 ++-- pyext/ctmodel.i | 4 ++-- pyext/ctobservation.i | 23 ++++++++++++++++++----- pyext/ctobssim.i | 4 ++-- pyext/ctool.i | 25 ++++++++++++++++++++----- pyext/ctphase.i | 4 ++-- pyext/ctprob.i | 4 ++-- pyext/ctpsfcube.i | 4 ++-- pyext/ctselect.i | 4 ++-- pyext/ctskymap.i | 4 ++-- pyext/cttsmap.i | 6 +++--- pyext/ctulimit.i | 6 +++--- src/ctbin/ctbin.cpp | 11 +++-------- src/ctbin/ctbin.hpp | 4 ++-- src/ctbkgcube/ctbkgcube.cpp | 13 ++++--------- src/ctbkgcube/ctbkgcube.hpp | 4 ++-- src/ctbutterfly/ctbutterfly.cpp | 9 ++------- src/ctbutterfly/ctbutterfly.hpp | 4 ++-- src/ctcubemask/ctcubemask.cpp | 12 +++--------- src/ctcubemask/ctcubemask.hpp | 4 ++-- src/ctedispcube/ctedispcube.cpp | 9 ++------- src/ctedispcube/ctedispcube.hpp | 4 ++-- src/cterror/cterror.cpp | 9 ++------- src/cterror/cterror.hpp | 4 ++-- src/ctexpcube/ctexpcube.cpp | 9 ++------- src/ctexpcube/ctexpcube.hpp | 4 ++-- src/ctfindvar/ctfindvar.cpp | 11 +++-------- src/ctfindvar/ctfindvar.hpp | 4 ++-- src/ctlike/ctlike.cpp | 9 ++------- src/ctlike/ctlike.hpp | 2 +- src/ctmapcube/ctmapcube.cpp | 9 ++------- src/ctmapcube/ctmapcube.hpp | 4 ++-- src/ctmodel/ctmodel.cpp | 9 ++------- src/ctmodel/ctmodel.hpp | 4 ++-- src/ctobssim/ctobssim.cpp | 11 +++-------- src/ctobssim/ctobssim.hpp | 4 ++-- src/ctphase/ctphase.cpp | 11 +++-------- src/ctphase/ctphase.hpp | 4 ++-- src/ctprob/ctprob.cpp | 11 +++-------- src/ctprob/ctprob.hpp | 4 ++-- src/ctpsfcube/ctpsfcube.cpp | 9 ++------- src/ctpsfcube/ctpsfcube.hpp | 4 ++-- src/ctselect/ctselect.cpp | 17 ++++++----------- src/ctselect/ctselect.hpp | 4 ++-- src/ctskymap/ctskymap.cpp | 11 +++-------- src/ctskymap/ctskymap.hpp | 4 ++-- src/cttsmap/cttsmap.cpp | 9 ++------- src/cttsmap/cttsmap.hpp | 4 ++-- src/ctulimit/ctulimit.cpp | 9 ++------- src/ctulimit/ctulimit.hpp | 4 ++-- src/support/ctlikelihood.hpp | 4 ++-- src/support/ctobservation.hpp | 4 ++-- src/support/ctool.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++------ src/support/ctool.hpp | 5 +++-- src/template/cscript_base.py | 8 ++------ src/template/cscript_like.py | 8 ++------ src/template/cscript_obs.py | 8 ++------ src/template/ctool_base.cpp | 9 ++------- src/template/ctool_base.hpp | 2 +- src/template/ctool_base.i | 2 +- src/template/ctool_like.cpp | 9 ++------- src/template/ctool_like.hpp | 2 +- src/template/ctool_like.i | 2 +- src/template/ctool_obs.cpp | 9 ++------- src/template/ctool_obs.hpp | 2 +- src/template/ctool_obs.i | 2 +- 124 files changed, 388 insertions(+), 600 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4230f93..0a6861a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,10 @@ -2022-02-02 +2022-02-22 * Version 2.0.0 released ======================== + Rename virtual abstract ctool::run() method to ctool::process() and + add non-abstract ctool::run() method (#3592) (#3592) Add methods to access ctlike attributes Add csadd2caldb script Add restart of bisection in case of bad convergence in ctulimit diff --git a/NEWS b/NEWS index fb19398..13c0b85 100755 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 2.0.0 -2 February 2022 +22 February 2022 Introduction @@ -34,7 +34,10 @@ Added optimizer setter to ctlikelihood base class. Base classes ------------ -None +Renamed virtual abstract ctool::run() method to ctool::process() and introduce +high-level non-abstact class ctool::run() that handles the counting of running +GApplication instances. In that way a tool knows whether it is a child or a +parent application (#3592). ctbin - CTA event binning diff --git a/README.md b/README.md index fef57e5..672550b 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ctools information ================== -* Version: 2.0.0.dev (2 February 2022) +* Version: 2.0.0.dev (22 February 2022) * GammaLib dependency: 2.0.0.dev [![Build Status](https://cta-jenkins.irap.omp.eu/buildStatus/icon?job=ctools-integrate-os)](https://cta-jenkins.irap.omp.eu/job/ctools-integrate-os/) diff --git a/cscripts/csadd2caldb.py b/cscripts/csadd2caldb.py index 3990229..8c6ed58 100755 --- a/cscripts/csadd2caldb.py +++ b/cscripts/csadd2caldb.py @@ -2,7 +2,7 @@ # ========================================================================== # Add IRFs to CALDB # -# Copyright (C) 2021 Juergen Knoedlseder +# Copyright (C) 2021-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -376,14 +376,10 @@ class csadd2caldb(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csbkgmodel.py b/cscripts/csbkgmodel.py index 026b1be..c1909da 100755 --- a/cscripts/csbkgmodel.py +++ b/cscripts/csbkgmodel.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates background model # -# Copyright (C) 2018-2019 Juergen Knoedlseder +# Copyright (C) 2018-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -456,14 +456,10 @@ class csbkgmodel(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cscaldb.py b/cscripts/cscaldb.py index f765773..46f5e09 100755 --- a/cscripts/cscaldb.py +++ b/cscripts/cscaldb.py @@ -2,7 +2,7 @@ # ========================================================================== # Show the content of the ctools calibration database # -# Copyright (C) 2014-2017 Juergen Knoedlseder +# Copyright (C) 2014-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -136,14 +136,10 @@ class cscaldb(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script. + Process the script. """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csebins.py b/cscripts/csebins.py index eae4428..8bd66c7 100755 --- a/cscripts/csebins.py +++ b/cscripts/csebins.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates energy boundaries for stacked analysis # -# Copyright (C) 2017-2018 Juergen Knoedlseder +# Copyright (C) 2017-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -238,14 +238,10 @@ class csebins(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csfindobs.py b/cscripts/csfindobs.py index 6a73ef8..fa01182 100755 --- a/cscripts/csfindobs.py +++ b/cscripts/csfindobs.py @@ -2,7 +2,7 @@ # ========================================================================== # Find observations from an IACT data store # -# Copyright (C) 2016-2018 Michael Mayer +# Copyright (C) 2016-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -164,14 +164,10 @@ class csfindobs(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csfootprint.py b/cscripts/csfootprint.py index 57f549d..ac5dff0 100755 --- a/cscripts/csfootprint.py +++ b/cscripts/csfootprint.py @@ -493,14 +493,10 @@ class csfootprint(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csiactcopy.py b/cscripts/csiactcopy.py index d5b4dae..655aec0 100755 --- a/cscripts/csiactcopy.py +++ b/cscripts/csiactcopy.py @@ -2,7 +2,7 @@ # ========================================================================== # Copies IACT data from remote machine # -# Copyright (C) 2016-2018 Michael Mayer +# Copyright (C) 2016-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -397,14 +397,10 @@ class csiactcopy(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csiactdata.py b/cscripts/csiactdata.py index 2b1b540..e3c1d43 100755 --- a/cscripts/csiactdata.py +++ b/cscripts/csiactdata.py @@ -2,7 +2,7 @@ # ========================================================================== # Inspect an IACT data storage # -# Copyright (C) 2015-2018 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -118,14 +118,10 @@ class csiactdata(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csiactobs.py b/cscripts/csiactobs.py index 36822b6..942d4c2 100755 --- a/cscripts/csiactobs.py +++ b/cscripts/csiactobs.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates an IACT observation definition XML file # -# Copyright (C) 2015-2020 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -563,14 +563,10 @@ class csiactobs(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cslightcrv.py b/cscripts/cslightcrv.py index b1c797c..9277b79 100755 --- a/cscripts/cslightcrv.py +++ b/cscripts/cslightcrv.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates a lightcurve. # -# Copyright (C) 2014-2021 Michael Mayer +# Copyright (C) 2014-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -603,14 +603,10 @@ class cslightcrv(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csmodelinfo.py b/cscripts/csmodelinfo.py index 1002b89..e3d544d 100755 --- a/cscripts/csmodelinfo.py +++ b/cscripts/csmodelinfo.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows the content of a model container # -# Copyright (C) 2015-2018 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -85,14 +85,10 @@ class csmodelinfo(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csmodelmerge.py b/cscripts/csmodelmerge.py index 5a81961..c56624e 100755 --- a/cscripts/csmodelmerge.py +++ b/cscripts/csmodelmerge.py @@ -2,7 +2,7 @@ # ========================================================================== # Merge model definition XML files # -# Copyright (C) 2015-2018 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -110,14 +110,10 @@ class csmodelmerge(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csmodelselect.py b/cscripts/csmodelselect.py index a2e87e2..eaa017e 100755 --- a/cscripts/csmodelselect.py +++ b/cscripts/csmodelselect.py @@ -2,7 +2,7 @@ # ========================================================================== # Selects model from a model definition XML file # -# Copyright (C) 2016-2018 Juergen Knoedlseder +# Copyright (C) 2016-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -216,14 +216,10 @@ class csmodelselect(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csmodelsois.py b/cscripts/csmodelsois.py index 71b4680..60c7528 100755 --- a/cscripts/csmodelsois.py +++ b/cscripts/csmodelsois.py @@ -2,7 +2,7 @@ # ========================================================================== # Puts subset of sources in diffuse model cube # -# Copyright (C) 2017-2021 Josh Cardenzana +# Copyright (C) 2017-2022 Josh Cardenzana # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -146,14 +146,10 @@ class csmodelsois(ctools.cscript): # Public methods - def run(self): + def process(self): """ Implements the actual bulk of the script's tasks """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csobs2caldb.py b/cscripts/csobs2caldb.py index 5b95d36..f6892d5 100755 --- a/cscripts/csobs2caldb.py +++ b/cscripts/csobs2caldb.py @@ -2,7 +2,7 @@ # ========================================================================== # Creates a calibration database entry for an IACT observation # -# Copyright (C) 2015-2021 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -328,14 +328,10 @@ class csobs2caldb(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csobsdef.py b/cscripts/csobsdef.py index 46d5969..ce94f7d 100755 --- a/cscripts/csobsdef.py +++ b/cscripts/csobsdef.py @@ -2,7 +2,7 @@ # ========================================================================== # Generation of an observation definition file # -# Copyright (C) 2015-2018 Juergen Knoedlseder +# Copyright (C) 2015-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -157,19 +157,15 @@ class csobsdef(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script Raises ------ RuntimeError Invalid pointing definition file format """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csobsinfo.py b/cscripts/csobsinfo.py index 3b25184..71dfd86 100755 --- a/cscripts/csobsinfo.py +++ b/cscripts/csobsinfo.py @@ -2,7 +2,7 @@ # ========================================================================== # Dump information about observation into log file # -# Copyright (C) 2015-2018 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,14 +86,10 @@ class csobsinfo(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csobsselect.py b/cscripts/csobsselect.py index 3f1369f..3be845c 100755 --- a/cscripts/csobsselect.py +++ b/cscripts/csobsselect.py @@ -2,7 +2,7 @@ # ========================================================================== # Selects observations from an observation definition XML file # -# Copyright (C) 2016-2018 Juergen Knoedlseder +# Copyright (C) 2016-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -290,14 +290,10 @@ class csobsselect(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csphagen.py b/cscripts/csphagen.py index a5d3829..dd772a5 100755 --- a/cscripts/csphagen.py +++ b/cscripts/csphagen.py @@ -3,7 +3,7 @@ # Computes the PHA spectra for source/background and ARF/RMF files using the # reflected region method # -# Copyright (C) 2017-2021 Luigi Tibaldo +# Copyright (C) 2017-2022 Luigi Tibaldo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1005,14 +1005,10 @@ class csphagen(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csphasecrv.py b/cscripts/csphasecrv.py index 3b6b7d3..4ce9b7f 100755 --- a/cscripts/csphasecrv.py +++ b/cscripts/csphasecrv.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates spectra as a function of phase # -# Copyright (C) 2017-2021 Rolf Buehler +# Copyright (C) 2017-2022 Rolf Buehler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -461,14 +461,10 @@ class csphasecrv(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cspull.py b/cscripts/cspull.py index fddf7e6..298a36f 100755 --- a/cscripts/cspull.py +++ b/cscripts/cspull.py @@ -2,7 +2,7 @@ # ========================================================================== # This script generates the pull distribution for all model parameters. # -# Copyright (C) 2011-2021 Juergen Knoedlseder +# Copyright (C) 2011-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -439,14 +439,10 @@ class cspull(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csresmap.py b/cscripts/csresmap.py index 5d71e38..66835c0 100755 --- a/cscripts/csresmap.py +++ b/cscripts/csresmap.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates a residual map. # -# Copyright (C) 2014-2021 Michael Mayer +# Copyright (C) 2014-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -134,14 +134,10 @@ class csresmap(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csresspec.py b/cscripts/csresspec.py index fc74476..95f0a24 100755 --- a/cscripts/csresspec.py +++ b/cscripts/csresspec.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates a residual spectrum. # -# Copyright (C) 2017-2020 Luigi Tibaldo +# Copyright (C) 2017-2022 Luigi Tibaldo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -747,14 +747,10 @@ class csresspec(ctools.csobservation): return result # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csroot2caldb.py b/cscripts/csroot2caldb.py index 8c2c71d..5cd6ee4 100755 --- a/cscripts/csroot2caldb.py +++ b/cscripts/csroot2caldb.py @@ -2,7 +2,7 @@ # ========================================================================== # Generate IRFs in CALDB format from a ROOT offaxis performance file # -# Copyright (C) 2016-2021 Juergen Knoedlseder +# Copyright (C) 2016-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1739,9 +1739,9 @@ class csroot2caldb(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ # Optional ROOT import try: @@ -1755,10 +1755,6 @@ class csroot2caldb(ctools.cscript): gammalib.warning('csroot2caldb', 'ROOT Python module not present, ' 'script will create empty IRF.') - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csscs.py b/cscripts/csscs.py index 6fd256b..7e883f5 100755 --- a/cscripts/csscs.py +++ b/cscripts/csscs.py @@ -2,7 +2,7 @@ # ========================================================================== # Spectral component separation script # -# Copyright (C) 2020-2021 Luigi Tibaldo +# Copyright (C) 2020-2022 Luigi Tibaldo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -791,14 +791,10 @@ class csscs(ctools.csobservation): return skymap # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cssens.py b/cscripts/cssens.py index a3e65ed..9e2cc18 100755 --- a/cscripts/cssens.py +++ b/cscripts/cssens.py @@ -2,7 +2,7 @@ # ========================================================================== # Computes the array sensitivity using the Test Statistic for a test source # -# Copyright (C) 2011-2021 Juergen Knoedlseder +# Copyright (C) 2011-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1079,14 +1079,10 @@ class cssens(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csspec.py b/cscripts/csspec.py index 9c635d5..a21c6d3 100755 --- a/cscripts/csspec.py +++ b/cscripts/csspec.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates a spectrum. # -# Copyright (C) 2014-2021 Michael Mayer +# Copyright (C) 2014-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1253,14 +1253,10 @@ class csspec(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cssrcdetect.py b/cscripts/cssrcdetect.py index a42ecd4..84f6126 100755 --- a/cscripts/cssrcdetect.py +++ b/cscripts/cssrcdetect.py @@ -2,7 +2,7 @@ # ========================================================================== # Detects sources in a sky map # -# Copyright (C) 2016-2019 Juergen Knoedlseder +# Copyright (C) 2016-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -422,17 +422,13 @@ class cssrcdetect(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ # Clear model container self._models.clear() - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cstsdist.py b/cscripts/cstsdist.py index 58a69be..10be964 100755 --- a/cscripts/cstsdist.py +++ b/cscripts/cstsdist.py @@ -2,7 +2,7 @@ # ========================================================================== # Generates the TS distribution for a particular model # -# Copyright (C) 2011-2021 Juergen Knoedlseder +# Copyright (C) 2011-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -355,14 +355,10 @@ class cstsdist(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cstsmapmerge.py b/cscripts/cstsmapmerge.py index 34c1df2..b4b1e99 100755 --- a/cscripts/cstsmapmerge.py +++ b/cscripts/cstsmapmerge.py @@ -2,7 +2,7 @@ # ========================================================================== # Merge Test Statistic maps # -# Copyright (C) 2015-2021 Michael Mayer +# Copyright (C) 2015-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -248,14 +248,10 @@ class cstsmapmerge(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script. + Process the script. """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/cstsmapsplit.py b/cscripts/cstsmapsplit.py index 0db76f7..2270d21 100755 --- a/cscripts/cstsmapsplit.py +++ b/cscripts/cstsmapsplit.py @@ -2,7 +2,7 @@ # ========================================================================== # Create commands to split TS map computation # -# Copyright (C) 2016-2021 Michael Mayer +# Copyright (C) 2016-2022 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -121,14 +121,10 @@ class cstsmapsplit(ctools.cslikelihood): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csviscube.py b/cscripts/csviscube.py index 741c43d..22f78b4 100755 --- a/cscripts/csviscube.py +++ b/cscripts/csviscube.py @@ -631,14 +631,10 @@ class csviscube(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/cscripts/csworkflow.py b/cscripts/csworkflow.py index 55d00db..9258baa 100755 --- a/cscripts/csworkflow.py +++ b/cscripts/csworkflow.py @@ -2,7 +2,7 @@ # ========================================================================== # Executes analysis workflow # -# Copyright (C) 2016-2017 Juergen Knoedlseder +# Copyright (C) 2016-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -323,14 +323,10 @@ class csworkflow(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/doc/source/admin/release_history/2.0.rst b/doc/source/admin/release_history/2.0.rst index 474603e..cfa593a 100644 --- a/doc/source/admin/release_history/2.0.rst +++ b/doc/source/admin/release_history/2.0.rst @@ -1,7 +1,7 @@ .. _2.0: -ctools 2.0 release (2 February 2022) -==================================== +ctools 2.0 release (22 February 2022) +===================================== Overview -------- @@ -24,6 +24,8 @@ Bug fixes Improvements ------------ +* [`3592 `_] - + Rename virtual abstract ``ctool::run()`` method to ``ctool::process()`` and add non-abstract ``ctool::run()`` method (#3592) * Add methods to access :ref:`ctlike` attributes * Add restart of bisection in case of bad convergence in :ref:`ctulimit` * [`3662 `_] - diff --git a/modules/comscripts/comlixfit.py b/modules/comscripts/comlixfit.py index 3535674..71e732a 100755 --- a/modules/comscripts/comlixfit.py +++ b/modules/comscripts/comlixfit.py @@ -239,14 +239,10 @@ class comlixfit(ctools.cslikelihood): return # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comlixmap.py b/modules/comscripts/comlixmap.py index 1779ac7..5cc321b 100755 --- a/modules/comscripts/comlixmap.py +++ b/modules/comscripts/comlixmap.py @@ -341,14 +341,10 @@ class comlixmap(ctools.cslikelihood): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobsadd.py b/modules/comscripts/comobsadd.py index 5694add..cf0980e 100755 --- a/modules/comscripts/comobsadd.py +++ b/modules/comscripts/comobsadd.py @@ -569,14 +569,10 @@ class comobsadd(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobsback.py b/modules/comscripts/comobsback.py index db9a7bd..07aee71 100755 --- a/modules/comscripts/comobsback.py +++ b/modules/comscripts/comobsback.py @@ -2,7 +2,7 @@ # ========================================================================== # Generate background model for COMPTEL observations # -# Copyright (C) 2021 Juergen Knoedlseder +# Copyright (C) 2021-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -718,14 +718,10 @@ class comobsback(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobsbin.py b/modules/comscripts/comobsbin.py index 67cb1e4..6f76d87 100755 --- a/modules/comscripts/comobsbin.py +++ b/modules/comscripts/comobsbin.py @@ -699,14 +699,10 @@ class comobsbin(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobsmodel.py b/modules/comscripts/comobsmodel.py index 1f89c8f..61345fb 100755 --- a/modules/comscripts/comobsmodel.py +++ b/modules/comscripts/comobsmodel.py @@ -481,14 +481,10 @@ class comobsmodel(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobsres.py b/modules/comscripts/comobsres.py index d98135b..b764f78 100755 --- a/modules/comscripts/comobsres.py +++ b/modules/comscripts/comobsres.py @@ -2,7 +2,7 @@ # ========================================================================== # Generate residuals of COMPTEL observations # -# Copyright (C) 2019-2021 Juergen Knoedlseder +# Copyright (C) 2019-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -625,14 +625,10 @@ class comobsres(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobsselect.py b/modules/comscripts/comobsselect.py index 6029cde..efc2811 100755 --- a/modules/comscripts/comobsselect.py +++ b/modules/comscripts/comobsselect.py @@ -2,7 +2,7 @@ # ========================================================================== # Select observations from COMPTEL database # -# Copyright (C) 2019-2021 Juergen Knoedlseder +# Copyright (C) 2019-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -250,14 +250,10 @@ class comobsselect(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comobssim.py b/modules/comscripts/comobssim.py index f4f5be9..519d894 100755 --- a/modules/comscripts/comobssim.py +++ b/modules/comscripts/comobssim.py @@ -2,7 +2,7 @@ # ========================================================================== # Simulate COMPTEL observations # -# Copyright (C) 2021 Juergen Knoedlseder +# Copyright (C) 2021-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -109,14 +109,10 @@ class comobssim(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/compulbin.py b/modules/comscripts/compulbin.py index 94c2dd3..0f7c97e 100755 --- a/modules/comscripts/compulbin.py +++ b/modules/comscripts/compulbin.py @@ -382,14 +382,10 @@ class compulbin(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/modules/comscripts/comsrcdetect.py b/modules/comscripts/comsrcdetect.py index 3a57f52..d86b093 100755 --- a/modules/comscripts/comsrcdetect.py +++ b/modules/comscripts/comsrcdetect.py @@ -2,7 +2,7 @@ # ========================================================================== # Detect source in TS map # -# Copyright (C) 2021 Juergen Knoedlseder +# Copyright (C) 2021-2022 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -245,14 +245,10 @@ class comsrcdetect(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/pyext/ctbin.i b/pyext/ctbin.i index e6ac9d8..7478598 100755 --- a/pyext/ctbin.i +++ b/pyext/ctbin.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctbin - Event binning tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2018 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); int cubes(void) const; const GCTAEventCube& cube(const int& index = 0) const; void save(void); diff --git a/pyext/ctbkgcube.i b/pyext/ctbkgcube.i index 7a431cd..4cdc33f 100755 --- a/pyext/ctbkgcube.i +++ b/pyext/ctbkgcube.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctbkgcube - Background cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2018 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); void cntcube(const GCTAEventCube& cntcube); diff --git a/pyext/ctbutterfly.i b/pyext/ctbutterfly.i index 82c8de2..f0a7307 100755 --- a/pyext/ctbutterfly.i +++ b/pyext/ctbutterfly.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctbutterfly - butterfly calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Michael Mayer * + * copyright (C) 2014-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const GFits& butterfly(void) const; }; diff --git a/pyext/ctcubemask.i b/pyext/ctcubemask.i index 1d45667..62f25f5 100755 --- a/pyext/ctcubemask.i +++ b/pyext/ctcubemask.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctcubemask - Cube filter tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 Chia-Chun Lu * + * copyright (C) 2014-2022 Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); }; diff --git a/pyext/ctedispcube.i b/pyext/ctedispcube.i index 38a3969..c62fc96 100755 --- a/pyext/ctedispcube.i +++ b/pyext/ctedispcube.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctedispcube - Energy dispersion cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2016 by Maria Haupt * + * copyright (C) 2016-2022 by Maria Haupt * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -46,7 +46,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const GCTACubeEdisp& edispcube(void) const; }; diff --git a/pyext/cterror.i b/pyext/cterror.i index 89dd73e..cf2a882 100755 --- a/pyext/cterror.i +++ b/pyext/cterror.i @@ -1,7 +1,7 @@ /*************************************************************************** * cterror - Parameter error calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2016 by Florent Forest * + * copyright (C) 2015-2022 by Florent Forest * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -47,7 +47,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); }; diff --git a/pyext/ctexpcube.i b/pyext/ctexpcube.i index ef239ca..0c3a12b 100755 --- a/pyext/ctexpcube.i +++ b/pyext/ctexpcube.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctexpcube - Exposure cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 by Juergen Knoedlseder * + * copyright (C) 2014-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GCTACubeExposure& expcube(void) const; diff --git a/pyext/ctfindvar.i b/pyext/ctfindvar.i index 03dbd00..f068131 100644 --- a/pyext/ctfindvar.i +++ b/pyext/ctfindvar.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctfindvar - search time variability tool * * ----------------------------------------------------------------------- * - * copyright (C) 2018 by Simon Bonnefoy * + * copyright (C) 2018-2022 by Simon Bonnefoy * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); }; diff --git a/pyext/ctlike.i b/pyext/ctlike.i index 7d32835..a86f9bf 100755 --- a/pyext/ctlike.i +++ b/pyext/ctlike.i @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const int& iter(void) const; const double& logL(void) const; diff --git a/pyext/ctlikelihood.i b/pyext/ctlikelihood.i index 2ff888a..6e32151 100755 --- a/pyext/ctlikelihood.i +++ b/pyext/ctlikelihood.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctlikelihood - Base class for likelihood tools * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2021 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -63,7 +63,7 @@ public: // Dummy methods (implementation makes this class non-abstract) virtual void clear(void) {} - virtual void run(void) {} + virtual void process(void) {} virtual void save(void) {} }; %} @@ -120,7 +120,7 @@ public: // Pure virtual methods virtual void clear(void) = 0; - virtual void run(void) = 0; + virtual void process(void) = 0; virtual void save(void) = 0; // Methods @@ -162,7 +162,7 @@ public: // Methods virtual void clear(void); - virtual void run(void); + virtual void process(void); virtual void save(void); }; @@ -212,10 +212,23 @@ def _init_cslikelihood(self, name, version, argv): self._log.date(True) cslikelihood._init_cslikelihood = _init_cslikelihood +# Run the script +def _run(self): + if self._logDebug(): + self._log.cout(True) + self._inc_running() + self.process() + self._dec_running() +cslikelihood.run = _run + # Execute the script def _execute(self): + self._inc_running() self._read_ahead(True) - self.run() + if self._logDebug(): + self._log.cout(True) + self.process() self.save() + self._dec_running() cslikelihood.execute = _execute %} diff --git a/pyext/ctmapcube.i b/pyext/ctmapcube.i index 27b06b6..06bec29 100755 --- a/pyext/ctmapcube.i +++ b/pyext/ctmapcube.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctmapcube - Map cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2016 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GModelSpatialDiffuseCube& mapcube(void) const; diff --git a/pyext/ctmodel.i b/pyext/ctmodel.i index 69967e8..ade6fe9 100755 --- a/pyext/ctmodel.i +++ b/pyext/ctmodel.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctmodel - Model cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Juergen Knoedlseder * + * copyright (C) 2012-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GCTAEventCube& cube(void) const; diff --git a/pyext/ctobservation.i b/pyext/ctobservation.i index f5415e2..2b07209 100755 --- a/pyext/ctobservation.i +++ b/pyext/ctobservation.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctobservation - Base class for observation tools * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2019 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -63,7 +63,7 @@ public: // Dummy methods (implementation makes this class non-abstract) virtual void clear(void) {} - virtual void run(void) {} + virtual void process(void) {} virtual void save(void) {} }; %} @@ -99,7 +99,7 @@ public: // Pure virtual methods virtual void clear(void) = 0; - virtual void run(void) = 0; + virtual void process(void) = 0; virtual void save(void) = 0; // Public methods @@ -155,7 +155,7 @@ public: // Methods virtual void clear(void); - virtual void run(void); + virtual void process(void); virtual void save(void); }; @@ -214,10 +214,23 @@ def _unbinned_observations(self): ctool._unbinned_observations = _unbinned_observations cscript._unbinned_observations = _unbinned_observations +# Run the script +def _run(self): + if self._logDebug(): + self._log.cout(True) + self._inc_running() + self.process() + self._dec_running() +csobservation.run = _run + # Execute the script def _execute(self): + self._inc_running() self._read_ahead(True) - self.run() + if self._logDebug(): + self._log.cout(True) + self.process() self.save() + self._dec_running() csobservation.execute = _execute %} diff --git a/pyext/ctobssim.i b/pyext/ctobssim.i index 3e27cf9..9ff7917 100755 --- a/pyext/ctobssim.i +++ b/pyext/ctobssim.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctobssim - Observation simulator tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2020 by Juergen Knoedlseder * + * copyright (C) 2011-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const double& max_rate(void) const; diff --git a/pyext/ctool.i b/pyext/ctool.i index 58dc2ce..66c4b6f 100755 --- a/pyext/ctool.i +++ b/pyext/ctool.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctool - ctool base class * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2019 by Juergen Knoedlseder * + * copyright (C) 2014-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -51,7 +51,7 @@ public: // Dummy methods (implementation makes this class non-abstract) virtual void clear(void) { } - virtual void run(void) { + virtual void process(void) { } virtual void save(void) { } @@ -88,10 +88,11 @@ public: // Pure virtual methods virtual void clear(void) = 0; - virtual void run(void) = 0; + virtual void process(void) = 0; virtual void save(void) = 0; // Public methods + virtual void run(void); virtual void execute(void); // Make methods private in Python by prepending an underscore @@ -214,7 +215,7 @@ public: // Methods virtual void clear(void); - virtual void run(void); + virtual void process(void); virtual void save(void); }; @@ -337,10 +338,24 @@ def _pardict(self, *args): ctool.pardict = _pardict cscript.pardict = _pardict + +# Run the script +def _run(self): + if self._logDebug(): + self._log.cout(True) + self._inc_running() + self.process() + self._dec_running() +cscript.run = _run + # Execute the script def _execute(self): + self._inc_running() self._read_ahead(True) - self.run() + if self._logDebug(): + self._log.cout(True) + self.process() self.save() + self._dec_running() cscript.execute = _execute %} diff --git a/pyext/ctphase.i b/pyext/ctphase.i index d01fe16..aa37bbb 100755 --- a/pyext/ctphase.i +++ b/pyext/ctphase.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctphase - Append phase information to CTA events file * * ----------------------------------------------------------------------- * - * copyright (C) 2017 by Joshua Cardenzana * + * copyright (C) 2017-2022 by Joshua Cardenzana * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); }; diff --git a/pyext/ctprob.i b/pyext/ctprob.i index eec5d4c..75b5bea 100755 --- a/pyext/ctprob.i +++ b/pyext/ctprob.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctprob - Computes probability for a given model * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Leonardo Di Venere * + * copyright (C) 2012-2022 by Leonardo Di Venere * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); }; diff --git a/pyext/ctpsfcube.i b/pyext/ctpsfcube.i index 34896c0..28cb956 100755 --- a/pyext/ctpsfcube.i +++ b/pyext/ctpsfcube.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctpsfcube - PSF cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2015 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -46,7 +46,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const GCTACubePsf& psfcube(void) const; }; diff --git a/pyext/ctselect.i b/pyext/ctselect.i index 17c4f9b..457a35c 100755 --- a/pyext/ctselect.i +++ b/pyext/ctselect.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctselect - Data selection tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2016 by Jurgen Knodlseder * + * copyright (C) 2010-2022 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); }; diff --git a/pyext/ctskymap.i b/pyext/ctskymap.i index 8fef10f..c6bcb94 100755 --- a/pyext/ctskymap.i +++ b/pyext/ctskymap.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctskymap - Sky mapping tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2018 by Juergen Knoedlseder * + * copyright (C) 2012-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GSkyMap& skymap(void) const; diff --git a/pyext/cttsmap.i b/pyext/cttsmap.i index dd64342..ed21e26 100755 --- a/pyext/cttsmap.i +++ b/pyext/cttsmap.i @@ -1,7 +1,7 @@ /*************************************************************************** * cttsmap - TS map calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 by Michael Mayer * + * copyright (C) 2014-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,10 +43,10 @@ public: cttsmap(int argc, char *argv[]); cttsmap(const cttsmap& app); virtual ~cttsmap(void); - + // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GSkyMap& tsmap(void) const; diff --git a/pyext/ctulimit.i b/pyext/ctulimit.i index 135b27b..7cdf80f 100755 --- a/pyext/ctulimit.i +++ b/pyext/ctulimit.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctulimit - Upper limit calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2016 by Michael Mayer * + * copyright (C) 2015-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -42,10 +42,10 @@ public: ctulimit(int argc, char *argv[]); ctulimit(const ctulimit& app); virtual ~ctulimit(void); - + // Methods void clear(void); - void run(void); + void process(void); void save(void); const double& diff_ulimit(void) const; const double& flux_ulimit(void) const; diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index c29ae90..7045670 100755 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbin - Event binning tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2021 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -217,20 +217,15 @@ void ctbin::clear(void) /***********************************************************************//** - * @brief Run the event binning tool + * @brief Process the event binning tool * * Gets the user parameters and loops over all CTA observations in the * observation container to bin the events into either a single or a set of * counts cube. All observations in the observation container that do not * contain CTA event lists will be skipped. ***************************************************************************/ -void ctbin::run(void) +void ctbin::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctbin/ctbin.hpp b/src/ctbin/ctbin.hpp index d14740a..8950ca2 100755 --- a/src/ctbin/ctbin.hpp +++ b/src/ctbin/ctbin.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbin - Event binning tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2020 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -80,7 +80,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); int cubes(void) const; const GCTAEventCube& cube(const int& index = 0) const; void save(void); diff --git a/src/ctbkgcube/ctbkgcube.cpp b/src/ctbkgcube/ctbkgcube.cpp index 6caa276..b816232 100755 --- a/src/ctbkgcube/ctbkgcube.cpp +++ b/src/ctbkgcube/ctbkgcube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbkgcube - Background cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -33,7 +33,7 @@ #include "GTools.hpp" /* __ Method name definitions ____________________________________________ */ -#define G_RUN "ctbkgcube::run()" +#define G_PROCESS "ctbkgcube::process()" /* __ Debug definitions __________________________________________________ */ @@ -206,13 +206,8 @@ void ctbkgcube::clear(void) * observation container, loops over all CTA observations in the container * and generates a background cube from the CTA observations. ***************************************************************************/ -void ctbkgcube::run(void) +void ctbkgcube::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); @@ -281,7 +276,7 @@ void ctbkgcube::run(void) std::string msg = "No background model found in model container. " "At least one background model is required in the " "model container to generate a background cube."; - throw GException::invalid_value(G_RUN, msg); + throw GException::invalid_value(G_PROCESS, msg); } // Write header diff --git a/src/ctbkgcube/ctbkgcube.hpp b/src/ctbkgcube/ctbkgcube.hpp index 99c6e24..cfc9b87 100755 --- a/src/ctbkgcube/ctbkgcube.hpp +++ b/src/ctbkgcube/ctbkgcube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbkgcube - Background cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2019 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -56,7 +56,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); void cntcube(const GCTAEventCube& cntcube); diff --git a/src/ctbutterfly/ctbutterfly.cpp b/src/ctbutterfly/ctbutterfly.cpp index 9f3f633..117b670 100755 --- a/src/ctbutterfly/ctbutterfly.cpp +++ b/src/ctbutterfly/ctbutterfly.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbutterfly - butterfly calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Michael Mayer * + * copyright (C) 2014-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -208,13 +208,8 @@ void ctbutterfly::clear(void) * This method takes the spectral fit and its covariance matrix to compute * the confidence band via Gaussian error propagation ***************************************************************************/ -void ctbutterfly::run(void) +void ctbutterfly::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctbutterfly/ctbutterfly.hpp b/src/ctbutterfly/ctbutterfly.hpp index a9b93a9..6be55cd 100755 --- a/src/ctbutterfly/ctbutterfly.hpp +++ b/src/ctbutterfly/ctbutterfly.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbutterfly - butterfly calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Michael Mayer * + * copyright (C) 2014-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -67,7 +67,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const GFits& butterfly(void) const; diff --git a/src/ctcubemask/ctcubemask.cpp b/src/ctcubemask/ctcubemask.cpp index 2e5f7f7..dfab059 100755 --- a/src/ctcubemask/ctcubemask.cpp +++ b/src/ctcubemask/ctcubemask.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctcubemask - Cube filter tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -34,7 +34,6 @@ /* __ Method name definitions ____________________________________________ */ -#define G_RUN "ctcubemask::run()" #define G_APPLY_MASK "ctcubemask::apply_mask(GCTAObservation*)" /* __ Debug definitions __________________________________________________ */ @@ -201,18 +200,13 @@ void ctcubemask::clear(void) /***********************************************************************//** - * @brief mask data cube + * @brief Mask data cube * * This method reads in the application parameters and loops over all * observations that were found to apply a mask on the event cube. ***************************************************************************/ -void ctcubemask::run(void) +void ctcubemask::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); diff --git a/src/ctcubemask/ctcubemask.hpp b/src/ctcubemask/ctcubemask.hpp index cc8997b..e98447e 100755 --- a/src/ctcubemask/ctcubemask.hpp +++ b/src/ctcubemask/ctcubemask.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctcubemask - Cube filter tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2017 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -59,7 +59,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); diff --git a/src/ctedispcube/ctedispcube.cpp b/src/ctedispcube/ctedispcube.cpp index 9d2c884..2e1d6a4 100755 --- a/src/ctedispcube/ctedispcube.cpp +++ b/src/ctedispcube/ctedispcube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctedispcube - Energy dispersion cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2021 by Maria Haupt * + * copyright (C) 2016-2022 by Maria Haupt * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -216,13 +216,8 @@ void ctedispcube::clear(void) * Generates the energy dispersion cube by looping over all unbinned CTA * observations in the observation container. ***************************************************************************/ -void ctedispcube::run(void) +void ctedispcube::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctedispcube/ctedispcube.hpp b/src/ctedispcube/ctedispcube.hpp index 58d6cfe..c24e3d5 100755 --- a/src/ctedispcube/ctedispcube.hpp +++ b/src/ctedispcube/ctedispcube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctedispcube - Energy dispersion cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2016 by Maria Haupt * + * copyright (C) 2016-2022 by Maria Haupt * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -56,7 +56,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const GCTACubeEdisp& edispcube(void) const; diff --git a/src/cterror/cterror.cpp b/src/cterror/cterror.cpp index 76a359f..7821fe1 100755 --- a/src/cterror/cterror.cpp +++ b/src/cterror/cterror.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * cterror - Parameter error calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2019 by Florent Forest * + * copyright (C) 2015-2022 by Florent Forest * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -220,13 +220,8 @@ void cterror::clear(void) * * Computes the parameter errors using a likelihood profile method. ***************************************************************************/ -void cterror::run(void) +void cterror::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/cterror/cterror.hpp b/src/cterror/cterror.hpp index 98b101e..e8898d4 100755 --- a/src/cterror/cterror.hpp +++ b/src/cterror/cterror.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * cterror - Parameter error calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2016 by Florent Forest * + * copyright (C) 2015-2022 by Florent Forest * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -54,7 +54,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); protected: diff --git a/src/ctexpcube/ctexpcube.cpp b/src/ctexpcube/ctexpcube.cpp index 77bf1b3..e8fc920 100755 --- a/src/ctexpcube/ctexpcube.cpp +++ b/src/ctexpcube/ctexpcube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctexpcube - Exposure cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Juergen Knoedlseder * + * copyright (C) 2014-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -205,13 +205,8 @@ void ctexpcube::clear(void) * observation container, loops over all CTA observations in the container * and generates an exposure cube from the CTA observations. ***************************************************************************/ -void ctexpcube::run(void) +void ctexpcube::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctexpcube/ctexpcube.hpp b/src/ctexpcube/ctexpcube.hpp index 19bec02..50200fa 100755 --- a/src/ctexpcube/ctexpcube.hpp +++ b/src/ctexpcube/ctexpcube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctexpcube - Exposure cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 by Juergen Knoedlseder * + * copyright (C) 2014-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -56,7 +56,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GCTACubeExposure& expcube(void) const; diff --git a/src/ctfindvar/ctfindvar.cpp b/src/ctfindvar/ctfindvar.cpp index 1fb86df..5cc10b9 100644 --- a/src/ctfindvar/ctfindvar.cpp +++ b/src/ctfindvar/ctfindvar.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctfindvar - Time variability search tool * * ----------------------------------------------------------------------- * - * copyright (C) 2018-2021 by Simon Bonnefoy * + * copyright (C) 2018-2022 by Simon Bonnefoy * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -221,15 +221,10 @@ void ctfindvar::clear(void) /***********************************************************************//** - * @brief Run time variability search tool + * @brief Process time variability search tool ***************************************************************************/ -void ctfindvar::run(void) +void ctfindvar::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctfindvar/ctfindvar.hpp b/src/ctfindvar/ctfindvar.hpp index 6e4ffff..18f6139 100644 --- a/src/ctfindvar/ctfindvar.hpp +++ b/src/ctfindvar/ctfindvar.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctfindvar - Time variability search tool * * ----------------------------------------------------------------------- * - * copyright (C) 2018-2019 by Simon Bonnefoy * + * copyright (C) 2018-2022 by Simon Bonnefoy * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -58,7 +58,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); protected: diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index 11243fc..8d49aff 100755 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -205,7 +205,7 @@ void ctlike::clear(void) /***********************************************************************//** - * @brief Run maximum likelihood analysis + * @brief Process maximum likelihood analysis * * The following analysis steps are performed: * 1. Read the parameters (and write them into logger) @@ -213,13 +213,8 @@ void ctlike::clear(void) * 3. Setup models for optimizing * 4. Optimize model (and write result into logger) ***************************************************************************/ -void ctlike::run(void) +void ctlike::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); diff --git a/src/ctlike/ctlike.hpp b/src/ctlike/ctlike.hpp index 180f4c4..f621127 100755 --- a/src/ctlike/ctlike.hpp +++ b/src/ctlike/ctlike.hpp @@ -54,7 +54,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const int& iter(void) const; const double& logL(void) const; diff --git a/src/ctmapcube/ctmapcube.cpp b/src/ctmapcube/ctmapcube.cpp index 2ce618f..8a90b5c 100755 --- a/src/ctmapcube/ctmapcube.cpp +++ b/src/ctmapcube/ctmapcube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctmapcube - Map cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2021 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -182,13 +182,8 @@ void ctmapcube::clear(void) * This method reads the task parameters from the parfile and generates the * map cube. ***************************************************************************/ -void ctmapcube::run(void) +void ctmapcube::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctmapcube/ctmapcube.hpp b/src/ctmapcube/ctmapcube.hpp index 23619a7..7f2beb1 100755 --- a/src/ctmapcube/ctmapcube.hpp +++ b/src/ctmapcube/ctmapcube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctmapcube - Map cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2017 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -55,7 +55,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GModelSpatialDiffuseCube& mapcube(void) const; diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index 3799cac..3efb48f 100755 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctmodel - Model cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2021 by Juergen Knoedlseder * + * copyright (C) 2012-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -214,13 +214,8 @@ void ctmodel::clear(void) * observation container, loops over all CTA observations in the container * and generates a model map for each CTA observation. ***************************************************************************/ -void ctmodel::run(void) +void ctmodel::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctmodel/ctmodel.hpp b/src/ctmodel/ctmodel.hpp index 2ce9564..f77449a 100755 --- a/src/ctmodel/ctmodel.hpp +++ b/src/ctmodel/ctmodel.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctmodel - Model cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2017 by Juergen Knoedlseder * + * copyright (C) 2012-2012 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -65,7 +65,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GCTAEventCube& cube(void) const; diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index ed3d1a2..0975b3b 100755 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctobssim - Observation simulator tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2021 by Juergen Knoedlseder * + * copyright (C) 2011-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -227,18 +227,13 @@ void ctobssim::clear(void) /***********************************************************************//** - * @brief Run the ctobssim tool. + * @brief Process the ctobssim tool. * * Gets the user parameters, loops over all CTA observations in the * observation container, and simulate events for each observation. ***************************************************************************/ -void ctobssim::run(void) +void ctobssim::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); diff --git a/src/ctobssim/ctobssim.hpp b/src/ctobssim/ctobssim.hpp index 3964909..d04ad90 100755 --- a/src/ctobssim/ctobssim.hpp +++ b/src/ctobssim/ctobssim.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctobssim - Observation simulator tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2020 by Juergen Knoedlseder * + * copyright (C) 2011-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -62,7 +62,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const double& max_rate(void) const; diff --git a/src/ctphase/ctphase.cpp b/src/ctphase/ctphase.cpp index f961f15..e01c88e 100755 --- a/src/ctphase/ctphase.cpp +++ b/src/ctphase/ctphase.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctphase - Append phase information to CTA events file * * ----------------------------------------------------------------------- * - * copyright (C) 2017-2018 by Joshua Cardenzana * + * copyright (C) 2017-2022 by Joshua Cardenzana * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -200,19 +200,14 @@ void ctphase::clear(void) /***********************************************************************//** - * @brief Runs the ctprob tool + * @brief Process the ctprob tool * * This method reads in the application parameters and loops over all * unbinned observations to compute the phase information for each event * based on an input model. ***************************************************************************/ -void ctphase::run(void) +void ctphase::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); diff --git a/src/ctphase/ctphase.hpp b/src/ctphase/ctphase.hpp index 357b976..da4fac6 100755 --- a/src/ctphase/ctphase.hpp +++ b/src/ctphase/ctphase.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctphase - Append phase information to CTA events file * * ----------------------------------------------------------------------- * - * copyright (C) 2017 by Joshua Cardenzana * + * copyright (C) 2017-2022 by Joshua Cardenzana * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -60,7 +60,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); diff --git a/src/ctprob/ctprob.cpp b/src/ctprob/ctprob.cpp index ad6ddd9..695b474 100755 --- a/src/ctprob/ctprob.cpp +++ b/src/ctprob/ctprob.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctprob - Computes event probability for a given model * * ----------------------------------------------------------------------- * - * copyright (C) 2017-2018 by Leonardo Di Venere * + * copyright (C) 2017-2022 by Leonardo Di Venere * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -199,19 +199,14 @@ void ctprob::clear(void) /***********************************************************************//** - * @brief Runs the ctprob tool + * @brief Process the ctprob tool * * This method reads in the application parameters and loops over all * unbinned observations to compute the probability for each event that it * comes from one of the model components. ***************************************************************************/ -void ctprob::run(void) +void ctprob::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); diff --git a/src/ctprob/ctprob.hpp b/src/ctprob/ctprob.hpp index 6a46de9..bb3e5e8 100755 --- a/src/ctprob/ctprob.hpp +++ b/src/ctprob/ctprob.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctprob - Computes event probability for a given model * * ----------------------------------------------------------------------- * - * copyright (C) 2017 by Leonardo Di Venere * + * copyright (C) 2017-2022 by Leonardo Di Venere * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -58,7 +58,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); diff --git a/src/ctpsfcube/ctpsfcube.cpp b/src/ctpsfcube/ctpsfcube.cpp index e65a140..44b9b95 100755 --- a/src/ctpsfcube/ctpsfcube.cpp +++ b/src/ctpsfcube/ctpsfcube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctpsfcube - PSF cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -204,13 +204,8 @@ void ctpsfcube::clear(void) * observation container, loops over all CTA observations in the container * and generates a PSF cube from the CTA observations. ***************************************************************************/ -void ctpsfcube::run(void) +void ctpsfcube::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctpsfcube/ctpsfcube.hpp b/src/ctpsfcube/ctpsfcube.hpp index 76df42b..56e74a9 100755 --- a/src/ctpsfcube/ctpsfcube.hpp +++ b/src/ctpsfcube/ctpsfcube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctpsfcube - PSF cube generation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 by Chia-Chun Lu * + * copyright (C) 2014-2022 by Chia-Chun Lu * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -56,7 +56,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const GCTACubePsf& psfcube(void) const; diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index 91f7ad1..956e1bf 100755 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctselect - Data selection tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2020 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -33,7 +33,7 @@ #include "GTools.hpp" /* __ Method name definitions ____________________________________________ */ -#define G_RUN "ctselect::run()" +#define G_PROCESS "ctselect::process()" #define G_GET_PARAMETERS "ctselect::get_parameters()" #define G_SELECT_EVENTS "ctselect::select_events(GCTAObservation*, "\ "std::string&, std::string&, std::string&)" @@ -212,13 +212,8 @@ void ctselect::clear(void) * The temporary file is deleted after this action so that no disk overflow * will occur. ***************************************************************************/ -void ctselect::run(void) +void ctselect::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); @@ -291,7 +286,7 @@ void ctselect::run(void) if (!m_infiles[i].empty()) { std::string message = check_infile(m_infiles[i], m_evtname[i]); if (!message.empty()) { - throw GException::invalid_value(G_RUN, message); + throw GException::invalid_value(G_PROCESS, message); } } @@ -316,7 +311,7 @@ void ctselect::run(void) if (!filename.empty()) { std::string message = check_infile(filename, m_evtname[i]); if (!message.empty()) { - throw GException::invalid_value(G_RUN, message); + throw GException::invalid_value(G_PROCESS, message); } } @@ -953,7 +948,7 @@ void ctselect::select_events(GCTAObservation* obs, std::string msg = \ "Invalid RoI selection: the new RoI must be enclosed " "in the original RoI"; - throw GException::invalid_value(G_RUN, msg); + throw GException::invalid_value(G_PROCESS, msg); } } } diff --git a/src/ctselect/ctselect.hpp b/src/ctselect/ctselect.hpp index 5e4e2d5..b77ef1f 100755 --- a/src/ctselect/ctselect.hpp +++ b/src/ctselect/ctselect.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctselect - Data selection tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2018 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -58,7 +58,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); diff --git a/src/ctskymap/ctskymap.cpp b/src/ctskymap/ctskymap.cpp index 1b887b5..ee2c01e 100755 --- a/src/ctskymap/ctskymap.cpp +++ b/src/ctskymap/ctskymap.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctskymap - Sky mapping tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2021 by Juergen Knoedlseder * + * copyright (C) 2011-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -207,19 +207,14 @@ void ctskymap::clear(void) /***********************************************************************//** - * @brief Run the sky mapping tool + * @brief Process the sky mapping tool * * Generates a sky map from event list by looping over all unbinned CTA * observation in the observation container and filling all events into * a sky map. ***************************************************************************/ -void ctskymap::run(void) +void ctskymap::process(void) { - // Switch screen logging on in debug mode - if (logDebug()) { - log.cout(true); - } - // Get parameters get_parameters(); diff --git a/src/ctskymap/ctskymap.hpp b/src/ctskymap/ctskymap.hpp index cca16e4..d2e521f 100755 --- a/src/ctskymap/ctskymap.hpp +++ b/src/ctskymap/ctskymap.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctskymap - Sky mapping tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2019 by Juergen Knoedlseder * + * copyright (C) 2010-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -57,7 +57,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GSkyMap& skymap(void) const; diff --git a/src/cttsmap/cttsmap.cpp b/src/cttsmap/cttsmap.cpp index 0e98864..ae10022 100755 --- a/src/cttsmap/cttsmap.cpp +++ b/src/cttsmap/cttsmap.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * cttsmap - TS map calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Michael Mayer * + * copyright (C) 2014-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -204,13 +204,8 @@ void cttsmap::clear(void) * given models including this additional source. The fit parameters of the * source and its TS values are filled into respective position in the map. ***************************************************************************/ -void cttsmap::run(void) +void cttsmap::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/cttsmap/cttsmap.hpp b/src/cttsmap/cttsmap.hpp index a916fd0..ec66574 100755 --- a/src/cttsmap/cttsmap.hpp +++ b/src/cttsmap/cttsmap.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * cttsmap - TS map calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2016 by Michael Mayer * + * copyright (C) 2014-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -67,7 +67,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); void publish(const std::string& name = ""); const GSkyMap& tsmap(void) const; diff --git a/src/ctulimit/ctulimit.cpp b/src/ctulimit/ctulimit.cpp index 2945e6b..ec513c4 100755 --- a/src/ctulimit/ctulimit.cpp +++ b/src/ctulimit/ctulimit.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctulimit - Upper limit calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2021 by Michael Mayer * + * copyright (C) 2015-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -219,13 +219,8 @@ void ctulimit::clear(void) * * Computes the upper limit depending on the given algorithm ***************************************************************************/ -void ctulimit::run(void) +void ctulimit::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/ctulimit/ctulimit.hpp b/src/ctulimit/ctulimit.hpp index 0358f74..2a16ee0 100755 --- a/src/ctulimit/ctulimit.hpp +++ b/src/ctulimit/ctulimit.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctulimit - Upper limit calculation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2021 by Michael Mayer * + * copyright (C) 2015-2022 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -62,7 +62,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); const double& diff_ulimit(void) const; const double& flux_ulimit(void) const; diff --git a/src/support/ctlikelihood.hpp b/src/support/ctlikelihood.hpp index daff1f5..d113a75 100755 --- a/src/support/ctlikelihood.hpp +++ b/src/support/ctlikelihood.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctlikelihood - Base class for likelihood tools * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2021 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -62,7 +62,7 @@ public: // Pure virtual methods virtual void clear(void) = 0; - virtual void run(void) = 0; + virtual void process(void) = 0; virtual void save(void) = 0; // Methods diff --git a/src/support/ctobservation.hpp b/src/support/ctobservation.hpp index 51274db..e9b14ca 100755 --- a/src/support/ctobservation.hpp +++ b/src/support/ctobservation.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctobservation - Base class for observation tools * * ----------------------------------------------------------------------- * - * copyright (C) 2016-2019 by Juergen Knoedlseder * + * copyright (C) 2016-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -65,7 +65,7 @@ public: // Pure virtual methods virtual void clear(void) = 0; - virtual void run(void) = 0; + virtual void process(void) = 0; virtual void save(void) = 0; // Methods diff --git a/src/support/ctool.cpp b/src/support/ctool.cpp index 5640a89..3b08dc6 100755 --- a/src/support/ctool.cpp +++ b/src/support/ctool.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctool - ctool base class * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2021 by Juergen Knoedlseder * + * copyright (C) 2014-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -249,23 +249,61 @@ ctool& ctool::operator=(const ctool& app) ==========================================================================*/ /***********************************************************************//** - * @brief Execute application + * @brief Run ctool * - * This is the main execution method of a ctool. The method is invoked when - * the executable is called from the command line. It signals that output - * parameters should be read ahead, runs the tools, and saves the results. + * This method runs a ctool by calling the process() method of a ctool. The + * method switches on screen dump in case that the debug parameter is true. + ***************************************************************************/ +void ctool::run(void) +{ + // Increment number of running tools + running()++; + + // If we're in debug mode then all output is also dumped on the screen + if (logDebug()) { + log.cout(true); + } + + // Run the tool + process(); + + // Decrement number of running tools + running()--; + + // Return + return; +} + + +/***********************************************************************//** + * @brief Execute ctool + * + * This method executes a ctool by calling the process() and save() methods + * of a ctool. The method signals that some parameters should be read ahead + * and switches on screen dump in case that the debug parameter is true. ***************************************************************************/ void ctool::execute(void) { + // Increment number of running tools + running()++; + // Signal that some parameters should be read ahead m_read_ahead = true; + // If we're in debug mode then all output is also dumped on the screen + if (logDebug()) { + log.cout(true); + } + // Run the tool - run(); + process(); // Save the results save(); + // Decrement number of running tools + running()--; + // Return return; } diff --git a/src/support/ctool.hpp b/src/support/ctool.hpp index fc0a960..1bb9ce6 100755 --- a/src/support/ctool.hpp +++ b/src/support/ctool.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctool - ctool base class * * ----------------------------------------------------------------------- * - * copyright (C) 2014-2019 by Juergen Knoedlseder * + * copyright (C) 2014-2022 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -67,10 +67,11 @@ public: // Pure virtual methods virtual void clear(void) = 0; - virtual void run(void) = 0; + virtual void process(void) = 0; virtual void save(void) = 0; // Public methods + virtual void run(void); virtual void execute(void); #ifdef SWIG diff --git a/src/template/cscript_base.py b/src/template/cscript_base.py index f512eab..7cb957c 100755 --- a/src/template/cscript_base.py +++ b/src/template/cscript_base.py @@ -95,14 +95,10 @@ class cscript_base(ctools.cscript): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/src/template/cscript_like.py b/src/template/cscript_like.py index 560eec9..7bbd9f4 100755 --- a/src/template/cscript_like.py +++ b/src/template/cscript_like.py @@ -95,14 +95,10 @@ class cscript_like(ctools.cslikelihood): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/src/template/cscript_obs.py b/src/template/cscript_obs.py index 63125e9..c4636ab 100755 --- a/src/template/cscript_obs.py +++ b/src/template/cscript_obs.py @@ -95,14 +95,10 @@ class cscript_obs(ctools.csobservation): # Public methods - def run(self): + def process(self): """ - Run the script + Process the script """ - # Switch screen logging on in debug mode - if self._logDebug(): - self._log.cout(True) - # Get parameters self._get_parameters() diff --git a/src/template/ctool_base.cpp b/src/template/ctool_base.cpp index 372d675..93e845e 100755 --- a/src/template/ctool_base.cpp +++ b/src/template/ctool_base.cpp @@ -192,15 +192,10 @@ void ctool_base::clear(void) /***********************************************************************//** - * @brief Run [what] tool + * @brief Process [what] tool ***************************************************************************/ -void ctool_base::run(void) +void ctool_base::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/template/ctool_base.hpp b/src/template/ctool_base.hpp index bd14d4f..6eab740 100755 --- a/src/template/ctool_base.hpp +++ b/src/template/ctool_base.hpp @@ -54,7 +54,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); protected: diff --git a/src/template/ctool_base.i b/src/template/ctool_base.i index f9e5bcf..7cfdc9c 100755 --- a/src/template/ctool_base.i +++ b/src/template/ctool_base.i @@ -44,7 +44,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); }; diff --git a/src/template/ctool_like.cpp b/src/template/ctool_like.cpp index 13708a5..796799d 100755 --- a/src/template/ctool_like.cpp +++ b/src/template/ctool_like.cpp @@ -211,15 +211,10 @@ void ctool_like::clear(void) /***********************************************************************//** - * @brief Run [what] tool + * @brief Process [what] tool ***************************************************************************/ -void ctool_like::run(void) +void ctool_like::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/template/ctool_like.hpp b/src/template/ctool_like.hpp index 2135d60..4541f46 100755 --- a/src/template/ctool_like.hpp +++ b/src/template/ctool_like.hpp @@ -55,7 +55,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); protected: diff --git a/src/template/ctool_like.i b/src/template/ctool_like.i index 4fbd3d4..14418cc 100755 --- a/src/template/ctool_like.i +++ b/src/template/ctool_like.i @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); }; diff --git a/src/template/ctool_obs.cpp b/src/template/ctool_obs.cpp index 0aceae5..71e844f 100755 --- a/src/template/ctool_obs.cpp +++ b/src/template/ctool_obs.cpp @@ -211,15 +211,10 @@ void ctool_obs::clear(void) /***********************************************************************//** - * @brief Run [what] tool + * @brief Process [what] tool ***************************************************************************/ -void ctool_obs::run(void) +void ctool_obs::process(void) { - // If we're in debug mode then all output is also dumped on the screen - if (logDebug()) { - log.cout(true); - } - // Get task parameters get_parameters(); diff --git a/src/template/ctool_obs.hpp b/src/template/ctool_obs.hpp index ac4a597..6e54cab 100755 --- a/src/template/ctool_obs.hpp +++ b/src/template/ctool_obs.hpp @@ -55,7 +55,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); protected: diff --git a/src/template/ctool_obs.i b/src/template/ctool_obs.i index c2c4ff5..39c6ea0 100755 --- a/src/template/ctool_obs.i +++ b/src/template/ctool_obs.i @@ -45,7 +45,7 @@ public: // Methods void clear(void); - void run(void); + void process(void); void save(void); }; -- libgit2 0.21.4