From 7529291ab411ace7c574fb08be9797116f5d4909 Mon Sep 17 00:00:00 2001 From: Gael-de-Sailly Date: Sun, 20 Dec 2020 18:48:10 +0100 Subject: [PATCH] For bounds.py (calculation of offsets), use the same data type as rivers --- terrainlib/bounds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terrainlib/bounds.py b/terrainlib/bounds.py index 830a87d..b179a1f 100644 --- a/terrainlib/bounds.py +++ b/terrainlib/bounds.py @@ -6,8 +6,8 @@ def make_bounds(dirs, rivers): """ (Y, X) = dirs.shape - bounds_h = np.zeros((Y, X-1), dtype='i4') - bounds_v = np.zeros((Y-1, X), dtype='i4') + bounds_h = np.zeros((Y, X-1), dtype=rivers.dtype) + bounds_v = np.zeros((Y-1, X), dtype=rivers.dtype) bounds_v += (rivers * (dirs==1))[:-1,:] bounds_h += (rivers * (dirs==2))[:,:-1]