Commit d3f2c7540d085d1e95118bbce1d88a942fdf060d
1 parent
8f3a3306
Changed 'raise gammalib.GException' to 'raise RuntimeError' in all occurences in cscripts
Showing
6 changed files
with
9 additions
and
10 deletions
cscripts/csmodelmerge.py
| ... | ... | @@ -121,7 +121,7 @@ class csmodelmerge(ctools.cscript): |
| 121 | 121 | msg = "Parameter \"inmodels\" must contain either an @ASCII"+\ |
| 122 | 122 | " file, a comma-separated or whitespace-separated list"+\ |
| 123 | 123 | " of files or a wildcard string" |
| 124 | - raise gammalib.GException.invalid_argument("csmodelmerge::get_parameters", msg) | |
| 124 | + raise RuntimeError(msg) | |
| 125 | 125 | |
| 126 | 126 | # Get output file |
| 127 | 127 | self.outmodel = self["outmodel"].filename() | ... | ... |
cscripts/csobsdef.py
| ... | ... | @@ -249,8 +249,7 @@ class csobsdef(ctools.cscript): |
| 249 | 249 | pntdir = gammalib.GSkyDir() |
| 250 | 250 | pntdir.lb_deg(lon,lat) |
| 251 | 251 | else: |
| 252 | - raise gammalib.GException.invalid_value(self.name, | |
| 253 | - "No (ra,dec) or (lon,lat) columns found in pointing" | |
| 252 | + raise RuntimeError("No (ra,dec) or (lon,lat) columns found in pointing" | |
| 254 | 253 | " definition file.") |
| 255 | 254 | obs.pointing(gammalib.GCTAPointing(pntdir)) |
| 256 | 255 | ... | ... |
cscripts/cssens.py
| ... | ... | @@ -241,7 +241,7 @@ class cssens(ctools.cscript): |
| 241 | 241 | else: |
| 242 | 242 | msg = "Invalid sensitivity type \""+self.m_type+"\" encountered."+ \ |
| 243 | 243 | " Either use \"Differential\" or \"Integral\"." |
| 244 | - raise gammalib.GException.invalid_value("cssens", msg) | |
| 244 | + raise RuntimeError(msg) | |
| 245 | 245 | |
| 246 | 246 | # Determine sensitivity |
| 247 | 247 | result = self.get_sensitivity(self.obs, emin, emax, |
| ... | ... | @@ -347,7 +347,7 @@ class cssens(ctools.cscript): |
| 347 | 347 | if not model.has_par("Prefactor"): |
| 348 | 348 | msg = "Model \""+self.m_srcname+"\" has no parameter \"Prefactor\"."+ \ |
| 349 | 349 | " Only spectral models with a \"Prefactor\" parameter are supported." |
| 350 | - raise gammalib.GException.invalid_value("cssens", msg) | |
| 350 | + raise RuntimeError(msg) | |
| 351 | 351 | |
| 352 | 352 | # Set source position |
| 353 | 353 | if self.m_ra != None and self.m_dec != None: | ... | ... |
cscripts/csspec.py
| ... | ... | @@ -206,7 +206,7 @@ class csspec(ctools.cscript): |
| 206 | 206 | "cube does not overlap with specified energy range ["+ \ |
| 207 | 207 | str(emin)+", "+str(emax)+"]. Specify "+ \ |
| 208 | 208 | "overlapping energy range." |
| 209 | - raise gammalib.GException.invalid_argument("csspec", msg) | |
| 209 | + raise RuntimeError(msg) | |
| 210 | 210 | |
| 211 | 211 | # Determine number of layers to use for each spectral bin |
| 212 | 212 | n_layers = int(len(use_layers) / self.m_enumbins) | ... | ... |
cscripts/cstsdist.py
| ... | ... | @@ -275,7 +275,7 @@ class cstsdist(ctools.cscript): |
| 275 | 275 | if not model.has_par("Prefactor"): |
| 276 | 276 | msg = "Model \""+self.m_srcname+"\" has no parameter \"Prefactor\"."+ \ |
| 277 | 277 | " Only spectral models with a \"Prefactor\" parameter are supported." |
| 278 | - raise gammalib.GException.invalid_value("cssens", msg) | |
| 278 | + raise RuntimeError(msg) | |
| 279 | 279 | |
| 280 | 280 | # Fit or fix spatial parameters |
| 281 | 281 | if fitpos: | ... | ... |
cscripts/cstsmapmerge.py
| ... | ... | @@ -123,13 +123,13 @@ class cstsmapmerge(ctools.cscript): |
| 123 | 123 | msg = "Parameter \"inmmaps\" must contain either an @ASCII file,"+\ |
| 124 | 124 | " a comma-separated or whitespace-separated list of files"+\ |
| 125 | 125 | " or a wildcard string" |
| 126 | - raise gammalib.GException.invalid_argument("cstsmapmerge::get_parameters", msg) | |
| 126 | + raise RuntimeError(msg) | |
| 127 | 127 | |
| 128 | 128 | # Check number of files. We need at least two files. |
| 129 | 129 | if len(self.files) <= 1: |
| 130 | 130 | msg = "Need at least two files to start merging, "+\ |
| 131 | 131 | str(len(self.files))+" files given." |
| 132 | - raise gammalib.GException.invalid_argument("cstsmapmerge::get_parameters", msg) | |
| 132 | + raise RuntimeError(msg) | |
| 133 | 133 | |
| 134 | 134 | # Get output file |
| 135 | 135 | self.outmap = self["outmap"].filename() |
| ... | ... | @@ -217,7 +217,7 @@ class cstsmapmerge(ctools.cscript): |
| 217 | 217 | " been merged. File \""+fitsfile+"\" contains"+\ |
| 218 | 218 | " already merged bins. Set hidden parameter"+\ |
| 219 | 219 | " overwrite=yes to avoid this error." |
| 220 | - raise gammalib.GException.invalid_value("cstsmapmerge::add", msg) | |
| 220 | + raise RuntimeError(msg) | |
| 221 | 221 | |
| 222 | 222 | # Copy TS values |
| 223 | 223 | self.tsmap[i] = add_tsmap[i] | ... | ... |