Commit 0fd0bbc6 authored by Anthony's avatar Anthony
Browse files

Handle light overfit domain issues

parent 4a8cf649
......@@ -28,12 +28,17 @@ def getbox(ncdf, corners) :
lonrange=[np.min(ncdf.variables["nav_lon"][:,:]),np.max(ncdf.variables["nav_lon"][:,:])]
if len(latrange[0]) <= 0 :
latrange=[np.min(ncdf.variables["nav_lat"][:,:]),np.max(ncdf.variables["nav_lat"][:,:])]
if np.min(corners[0][:]) < np.min(lonrange) or \
if np.abs(np.min(corners[0][:]) - np.min(lonrange)) < -5 or \
np.abs(np.max(corners[0][:]) > np.max(lonrange)) > 5 or \
np.abs(np.min(corners[1][:]) < np.min(latrange)) < -5 or \
np.abs(np.max(corners[1][:]) > np.max(latrange)) > 5 :
ERROR("The atmospheric domain does not fit inside the area covered by HydroFile. Please check the file.")
sys.exit()
elif np.min(corners[0][:]) < np.min(lonrange) or \
np.max(corners[0][:]) > np.max(lonrange) or \
np.min(corners[1][:]) < np.min(latrange) or \
np.max(corners[1][:]) > np.max(latrange) :
ERROR("The atmospheric domain does not fit inside the area covered by HydroFile. Please check the file.")
sys.exit()
INFO("The atmospheric domain slightly outfit the area covered by HydroFile. Please check this doesn't generate issues.")
#
# Add a few points to tbe box to make sure to cover everything
halo_pts=2
......
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