Commit 09d100ea authored by Hoek, Steven's avatar Hoek, Steven
Browse files

Better exception handling for something that seems to sometimes fail (wrt....

Better exception handling for something that seems to sometimes fail (wrt. Dataset from Netcdf4 library)
parent 0c9398ab
......@@ -52,7 +52,10 @@ class Netcdf4Raster(Netcdf4Envelope2D):
Netcdf4Envelope2D.__init__(self, self._dataset, self.__X, self.__Y);
self._dataset = ds;
self._varname = self._get_varname();
self.nodatavalue = ds.variables[self._varname]._FillValue
try:
self.nodatavalue = ds.variables[self._varname]._FillValue
except Exception as e:
print(e)
return True;
else: return False;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment