Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CLIMATE-353 Bounds doesnt cast input values into proper format
  • Loading branch information
MichaelArthurAnderson committed Jan 21, 2018
1 parent f7346ad commit 8443eca1d000d2c84cd0d377ad05677dc43a5772
Showing 1 changed file with 15 additions and 1 deletion.
@@ -297,6 +297,10 @@ def __init__(self, boundary_type='rectangular',

self._start = None
self._end = None
self.lat_min = None
self.lat_max = None
self.lon_min = None
self.lon_max = None

if start and self._validate_start(start):
self._start = start
@@ -305,12 +309,15 @@ def __init__(self, boundary_type='rectangular',
self._end = end

if boundary_type == 'us_states':

self.masked_regions = utils.shapefile_boundary(boundary_type, us_states)

if boundary_type == 'countries':

self.masked_regions = utils.shapefile_boundary(boundary_type, countries)

if boundary_type == 'user':

file_object = netCDF4.Dataset(user_mask_file)
self.mask_variable = file_object.variables[mask_variable_name][:]
mask_longitude = file_object.variables[longitude_name][:]
@@ -331,9 +338,16 @@ def __init__(self, boundary_type='rectangular',
self.lon_max = float(lon_max)

if boundary_type[:6].upper() == 'CORDEX':
self.lat_min, self.lat_max, self.lon_min, self.lon_max = \

lat_min, lat_max, lon_min, lon_max = \
utils.CORDEX_boundary(boundary_type[6:].replace(" ", "").lower())

if self._validate_lat_lon(lat_max=lat_max, lat_min=lat_min, lon_max=lon_max, lon_min=lon_min):
self.lat_min = float(lat_min)
self.lat_max = float(lat_max)
self.lon_min = float(lon_min)
self.lon_max = float(lon_max)

@property
def start(self):
""" Getter for start attribute. """

0 comments on commit 8443eca

Please sign in to comment.