From c73a96e36ba0c94d330d0adc16bdc89c7d3a53ee Mon Sep 17 00:00:00 2001 From: Saransh Date: Fri, 15 Nov 2024 12:04:33 -0800 Subject: [PATCH] Update hexrd/gridutil.py Co-authored-by: Patrick Avery --- hexrd/gridutil.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hexrd/gridutil.py b/hexrd/gridutil.py index cb51c9a4..22ff4eb0 100644 --- a/hexrd/gridutil.py +++ b/hexrd/gridutil.py @@ -87,9 +87,8 @@ def cellIndices(edges, points_1d): # idx[off_lo] = np.nan # if np.any(off_hi): # idx[off_hi] = np.nan - idx = np.array(idx) - idx[np.isnan(idx)] = 0 - return np.array(idx).astype(int) + idx[np.isnan(idx)] = -1 + return idx.astype(int) @numba.njit(nogil=True, cache=True)