From 2163e6502bdcf317e10fd7bea8181b05354cce7d Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Sat, 12 Oct 2024 17:17:03 -0400 Subject: [PATCH] bugfix --- spectral_cube/spectral_cube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectral_cube/spectral_cube.py b/spectral_cube/spectral_cube.py index 704d4845..97ebdbcd 100644 --- a/spectral_cube/spectral_cube.py +++ b/spectral_cube/spectral_cube.py @@ -1060,7 +1060,7 @@ def apply_function(self, function, axis=None, weights=None, unit=None, # check dtype first (for argmax/argmin) result = function(np.arange(3, dtype=self._data.dtype), **kwargs) if 'int' in str(result.dtype): - out = np.zeros([nz, nx, ny], dtype=dtype) + out = np.zeros([nz, nx, ny], dtype=result.dtype) else: out = np.empty([nz, nx, ny]) * np.nan