diff --git a/src/porespy/__version__.py b/src/porespy/__version__.py index 11a995e37..44892437e 100644 --- a/src/porespy/__version__.py +++ b/src/porespy/__version__.py @@ -1 +1 @@ -__version__ = '3.0.0a0.dev13' +__version__ = '3.0.0a0.dev14' diff --git a/src/porespy/metrics/_funcs.py b/src/porespy/metrics/_funcs.py index 49c0ce58b..d94296a36 100644 --- a/src/porespy/metrics/_funcs.py +++ b/src/porespy/metrics/_funcs.py @@ -768,11 +768,11 @@ def _radial_profile(autocorr, bins, pf=None, voxel_size=1): @njit(parallel=False) def _get_radial_sum(dt, bins, bin_size, autocorr): - radial_sum = np.zeros_like(bins[:-1]) + radial_sum = np.zeros_like(bins[:-1], dtype=np.float64) for i, r in enumerate(bins[:-1]): - mask = (dt <= r) * (dt > (r - bin_size[i])) - radial_sum[i] = np.sum(np.ravel(autocorr)[np.ravel(mask)], dtype=np.int64) \ - / np.sum(mask) + mask = (dt <= r) & (dt > (r - bin_size[i])) + if np.any(mask): + radial_sum[i] = np.sum(autocorr[mask], dtype=np.float64) / np.sum(mask, dtype=np.float64) return radial_sum