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

Allow missing layer in class SHPC

Especially, we want to allow missing layer `max_speed_contour` when
running script `plot_eddy_contours.py`.
parent 6ca366ab
No related branches found
No related tags found
No related merge requests found
......@@ -65,8 +65,12 @@ class SHPC_class:
my_shapefile = path.join(self.dir, f"Slice_{i_slice}", orientation,
layer)
print("Opening", my_shapefile, "...")
self._readers[i_slice][orientation][layer] \
= shapefile.Reader(my_shapefile)
try:
self._readers[i_slice][orientation][layer] \
= shapefile.Reader(my_shapefile)
except shapefile.ShapefileException:
print("Not found")
self._readers[i_slice][orientation][layer] = None
return self._readers[i_slice][orientation][layer]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment