Commit c621f1138e3ff902eb1d734966a1082ee9285dff

Authored by Michael Mayer
1 parent 01a747bb

Improved error handling and fixed some bugs

Showing 1 changed file with 5 additions and 2 deletions
cscripts/csfindobs.py
@@ -123,6 +123,9 @@ class csfindobs(ctools.cscript): @@ -123,6 +123,9 @@ class csfindobs(ctools.cscript):
123 # Intiialise flag if spatial selection is required 123 # Intiialise flag if spatial selection is required
124 self.select_radec = True 124 self.select_radec = True
125 125
  126 + # Initialise invalid radius
  127 + self.m_radius = 0.0
  128 +
126 # Check for vailidity of spatial parameters 129 # Check for vailidity of spatial parameters
127 if self["ra"].is_valid() and self["dec"].is_valid() and self["rad"].is_valid(): 130 if self["ra"].is_valid() and self["dec"].is_valid() and self["rad"].is_valid():
128 131
@@ -176,7 +179,7 @@ class csfindobs(ctools.cscript): @@ -176,7 +179,7 @@ class csfindobs(ctools.cscript):
176 if self.m_obs_index == "": 179 if self.m_obs_index == "":
177 raise RuntimeError("FITS data store \""+self.m_prodname+"\" not available. Run csiactdata to get a list of available storage names") 180 raise RuntimeError("FITS data store \""+self.m_prodname+"\" not available. Run csiactdata to get a list of available storage names")
178 if not gammalib.is_fits(self.m_obs_index+"[OBS_INDEX]"): 181 if not gammalib.is_fits(self.m_obs_index+"[OBS_INDEX]"):
179 - raise RuntimeError("Observation index file \""+self.m_obs_index+"[OBS_INDEX]\" for FITS data store \""+self.m_prodname+"\" not available. Check your master index file or run csdsinfo to get a list of available storage names.") 182 + raise RuntimeError("Observation index file \""+self.m_obs_index+"[OBS_INDEX]\" for FITS data store \""+self.m_prodname+"\" not available. Check your master index file or run csiactdata to get a list of available storage names.")
180 183
181 # Set other members 184 # Set other members
182 self.m_log = False # Logging in client tools 185 self.m_log = False # Logging in client tools
@@ -190,7 +193,7 @@ class csfindobs(ctools.cscript): @@ -190,7 +193,7 @@ class csfindobs(ctools.cscript):
190 """ 193 """
191 Return OBS IDs 194 Return OBS IDs
192 """ 195 """
193 - 196 +
194 # Return 197 # Return
195 return self.runs 198 return self.runs
196 199