Commit 194447f8 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed dtype conversion issue within spectral resampling.

parent aa1029c7
Pipeline #3206 failed with stage
in 17 minutes and 6 seconds
......@@ -471,7 +471,9 @@ class SpectralResampler(object):
tile_rsp = np.zeros((*tile_1nm.shape[:2], len(self.srf_tgt.bands)), dtype=tiledata.dtype)
for band_idx, band in enumerate(self.srf_tgt.bands):
# compute the resampled image cube (np.average computes the weighted mean value)
tile_rsp[:, :, band_idx] = np.average(tile_1nm, weights=self.srf_1nm[band], axis=2)
res = np.average(tile_1nm, weights=self.srf_1nm[band], axis=2)
# NOTE: rounding here is important to prevent -9999. converted to -9998
tile_rsp[:, :, band_idx] = res if np.issubdtype(tile_rsp.dtype, np.floating) else np.around(res)
return tilebounds, tile_rsp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment