From 29e7a8c78d07b51d057672d934c8260bb6c1e976 Mon Sep 17 00:00:00 2001 From: Giacomo Caria Date: Mon, 3 May 2021 15:52:32 +0200 Subject: [PATCH] Use numpy.linspace to generate grid --- lib/iris/coords.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 6129b35150..c167e4c03e 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -2334,7 +2334,10 @@ def from_regular( bounds values will be defined. Defaults to False. """ - points = (zeroth + step) + step * np.arange(count, dtype=np.float32) + start = zeroth + step + end = zeroth + (count * step) + points = np.linspace(start, end, num=count, dtype=np.float32) + _, regular = iris.util.points_step(points) if not regular: points = (zeroth + step) + step * np.arange(