diff --git a/cscripts/csmodelmerge.py b/cscripts/csmodelmerge.py index ff67612..1a15a72 100755 --- a/cscripts/csmodelmerge.py +++ b/cscripts/csmodelmerge.py @@ -121,7 +121,7 @@ class csmodelmerge(ctools.cscript): msg = "Parameter \"inmodels\" must contain either an @ASCII"+\ " file, a comma-separated or whitespace-separated list"+\ " of files or a wildcard string" - raise gammalib.GException.invalid_argument("csmodelmerge::get_parameters", msg) + raise RuntimeError(msg) # Get output file self.outmodel = self["outmodel"].filename() diff --git a/cscripts/csobsdef.py b/cscripts/csobsdef.py index 0c54f02..0b4a4aa 100755 --- a/cscripts/csobsdef.py +++ b/cscripts/csobsdef.py @@ -249,8 +249,7 @@ class csobsdef(ctools.cscript): pntdir = gammalib.GSkyDir() pntdir.lb_deg(lon,lat) else: - raise gammalib.GException.invalid_value(self.name, - "No (ra,dec) or (lon,lat) columns found in pointing" + raise RuntimeError("No (ra,dec) or (lon,lat) columns found in pointing" " definition file.") obs.pointing(gammalib.GCTAPointing(pntdir)) diff --git a/cscripts/cssens.py b/cscripts/cssens.py index 64f34a7..a0a12ae 100755 --- a/cscripts/cssens.py +++ b/cscripts/cssens.py @@ -241,7 +241,7 @@ class cssens(ctools.cscript): else: msg = "Invalid sensitivity type \""+self.m_type+"\" encountered."+ \ " Either use \"Differential\" or \"Integral\"." - raise gammalib.GException.invalid_value("cssens", msg) + raise RuntimeError(msg) # Determine sensitivity result = self.get_sensitivity(self.obs, emin, emax, @@ -347,7 +347,7 @@ class cssens(ctools.cscript): if not model.has_par("Prefactor"): msg = "Model \""+self.m_srcname+"\" has no parameter \"Prefactor\"."+ \ " Only spectral models with a \"Prefactor\" parameter are supported." - raise gammalib.GException.invalid_value("cssens", msg) + raise RuntimeError(msg) # Set source position if self.m_ra != None and self.m_dec != None: diff --git a/cscripts/csspec.py b/cscripts/csspec.py index 54a6349..bbe80a0 100755 --- a/cscripts/csspec.py +++ b/cscripts/csspec.py @@ -206,7 +206,7 @@ class csspec(ctools.cscript): "cube does not overlap with specified energy range ["+ \ str(emin)+", "+str(emax)+"]. Specify "+ \ "overlapping energy range." - raise gammalib.GException.invalid_argument("csspec", msg) + raise RuntimeError(msg) # Determine number of layers to use for each spectral bin n_layers = int(len(use_layers) / self.m_enumbins) diff --git a/cscripts/cstsdist.py b/cscripts/cstsdist.py index 282d2c8..c4b2b49 100755 --- a/cscripts/cstsdist.py +++ b/cscripts/cstsdist.py @@ -275,7 +275,7 @@ class cstsdist(ctools.cscript): if not model.has_par("Prefactor"): msg = "Model \""+self.m_srcname+"\" has no parameter \"Prefactor\"."+ \ " Only spectral models with a \"Prefactor\" parameter are supported." - raise gammalib.GException.invalid_value("cssens", msg) + raise RuntimeError(msg) # Fit or fix spatial parameters if fitpos: diff --git a/cscripts/cstsmapmerge.py b/cscripts/cstsmapmerge.py index df444d9..5ab465e 100755 --- a/cscripts/cstsmapmerge.py +++ b/cscripts/cstsmapmerge.py @@ -123,13 +123,13 @@ class cstsmapmerge(ctools.cscript): msg = "Parameter \"inmmaps\" must contain either an @ASCII file,"+\ " a comma-separated or whitespace-separated list of files"+\ " or a wildcard string" - raise gammalib.GException.invalid_argument("cstsmapmerge::get_parameters", msg) + raise RuntimeError(msg) # Check number of files. We need at least two files. if len(self.files) <= 1: msg = "Need at least two files to start merging, "+\ str(len(self.files))+" files given." - raise gammalib.GException.invalid_argument("cstsmapmerge::get_parameters", msg) + raise RuntimeError(msg) # Get output file self.outmap = self["outmap"].filename() @@ -217,7 +217,7 @@ class cstsmapmerge(ctools.cscript): " been merged. File \""+fitsfile+"\" contains"+\ " already merged bins. Set hidden parameter"+\ " overwrite=yes to avoid this error." - raise gammalib.GException.invalid_value("cstsmapmerge::add", msg) + raise RuntimeError(msg) # Copy TS values self.tsmap[i] = add_tsmap[i]