diff --git a/pynemo/nemo_bdy_gen_c.py b/pynemo/nemo_bdy_gen_c.py index 4f1a2958f1cc8224c703b55cc39a2594f3601286..01b2d390bdbd49f17a5c0e6663c928fe11ce6032 100644 --- a/pynemo/nemo_bdy_gen_c.py +++ b/pynemo/nemo_bdy_gen_c.py @@ -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])) diff --git a/pynemo/pynemo_exe.py b/pynemo/pynemo_exe.py index 706985361234ac78dfef414fad98c3e9f8133db0..b3a95ee957d3aa9fce24747b7fc177d1e38ad530 100644 --- a/pynemo/pynemo_exe.py +++ b/pynemo/pynemo_exe.py @@ -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))