Skip to content
Snippets Groups Projects
Commit cd434174 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Return None from `open_shpc` when no `ishape_last`

Return None from `open_shpc` when `ishape_last.txt` is not found,
instead of `[len(readers["extremum"]) - 1]`, as needed by
`plot_eddy_contours.py`. So that we can take another action in another
script.
parent e9969103
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,6 @@ def open_shpc(shpc_dir):
ishape_last = np.loadtxt(fname, dtype = int, ndmin = 1)
except OSError:
print("Could not read", fname)
print("We will use all the shapes.")
ishape_last = [len(readers["extremum"]) - 1]
ishape_last = None
return readers, d_init, ishape_last
......@@ -265,6 +265,11 @@ if __name__ == "__main__":
readers, d_init, ishape_last \
= util_detect_eddies.open_shpc(args.shpc_dir)
if ishape_last is None:
print("We will use all the shapes.")
ishape_last = [len(readers["extremum"]) - 1]
fig = plt.figure()
src_crs = ccrs.PlateCarree()
projection = ccrs.PlateCarree()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment