From 3da0a8b28d6ed6087ddc4197d1afebb6cd778a55 Mon Sep 17 00:00:00 2001
From: acdi <acdi@dtu.dk>
Date: Tue, 24 Apr 2018 15:10:21 +0200
Subject: [PATCH] fixed initialization error for interpolated envelopes

---
 wetb/utils/envelope.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wetb/utils/envelope.py b/wetb/utils/envelope.py
index 85ec7f18..4a3c1b38 100644
--- a/wetb/utils/envelope.py
+++ b/wetb/utils/envelope.py
@@ -281,8 +281,8 @@ def compute_envelope(cloud, int_env=False, Nx=300):
     vertices, ivertices = closed_contour(cloud)
 
     # interpolate to a fixed location of equally spaced vertices
-    vert_int = np.ndarray(vertices.shape)
     if int_env:
+        vert_int = np.ndarray((Nx+1, cloud.shape[1]))
         _,_,_,vert_int[:,0:2] = int_envelope(vertices[:,0], vertices[:,1], Nx)
         for i in range(2, cloud.shape[1]):
             _,_,_,extra = int_envelope(vertices[:,0], vertices[:,i], Nx)
-- 
GitLab