Commit 8168bddc authored by thopri's avatar thopri
Browse files

added try except to catch missing input files due to THREDDS server being down

parent 55587d9b
......@@ -11,6 +11,7 @@ Ported from Matlab code by James Harle
#External Imports
import numpy as np
import logging
import sys
#Local Imports
from .utils.nemo_bdy_lib import sub2ind
......@@ -74,7 +75,10 @@ class Boundary:
bdy_msk[grid_ind] = fval
# Create padded array for overlays
msk = np.pad(bdy_msk,((1,1),(1,1)), 'constant', constant_values=(-1))
try:
msk = np.pad(bdy_msk,((1,1),(1,1)), 'constant', constant_values=(-1))
except ValueError:
raise Exception('the ValueError above is commonly due to PyNEMO not finding the bathymetry/mask file')
# create index arrays of I and J coords
igrid, jgrid = np.meshgrid(np.arange(bdy_msk.shape[1]), np.arange(bdy_msk.shape[0]))
......
......@@ -40,7 +40,7 @@ def main():
elif opt in ("-d", "--download_cmems"):
setup_file = arg
t0 = time.time()
with yaspin(Spinners.earth, text='PyNEMO is running'):
with yaspin(Spinners.earth, text='Download CMEMS function is running'):
profile.download_cmems(setup_file)
t1 = time.time()
print("CMEMS download time: %s" % (t1 - t0))
......
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