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

Improve robustness

nx is 0 if the script is run on a triplet of shapefiles for
interpolated eddies.
parent 2c4df98e
No related branches found
No related tags found
No related merge requests found
...@@ -10,10 +10,13 @@ def plot_distr_funct(x, label = None, ax = None): ...@@ -10,10 +10,13 @@ def plot_distr_funct(x, label = None, ax = None):
x.sort() x.sort()
nx = np.size(x) nx = np.size(x)
if ax is None: ax = plt.gca()
ax.plot(x, (1 + np.arange(nx)) / nx, label = label) if nx != 0:
print("minimum value:", x[0]) if ax is None: ax = plt.gca()
print("maximum value:", x[-1]) ax.plot(x, (1 + np.arange(nx)) / nx, label = label)
print("minimum value:", x[0])
print("maximum value:", x[-1])
print("number of values:", nx, "\n") print("number of values:", nx, "\n")
def read(): def read():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment