Commit e8d1815d authored by thopri's avatar thopri
Browse files

updated bdy_mask.py so that it handles missing attributes

parent 9bc759f3
...@@ -81,14 +81,13 @@ class Mask(object): ...@@ -81,14 +81,13 @@ class Mask(object):
try: try:
self.bathy_data = self.bathy_nc.variables['Bathymetry'][:,:] self.bathy_data = self.bathy_nc.variables['Bathymetry'][:,:]
except:
self.bathy_data = self.bathy_nc.variables['deptho'][:,:]
try: #check if units exists otherwise unknown. TODO
self.data_units = self.bathy_nc.variables['Bathymetry'].units self.data_units = self.bathy_nc.variables['Bathymetry'].units
except: except KeyError:
self.bathy_data = self.bathy_nc.variables['deptho'][:,:]
self.data_units = self.bathy_nc.variables['deptho'].units self.data_units = self.bathy_nc.variables['deptho'].units
# except AttributeError: except AttributeError:
# self.data_units = "unknown" self.logger.warning('Bathymetry Units unknown....')
self.data_units = "unknown"
if self.data is None: if self.data is None:
try: try:
self.data = self.bathy_nc.variables['Bathymetry'] self.data = self.bathy_nc.variables['Bathymetry']
......
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