diff --git a/HISTORY.rst b/HISTORY.rst index ed02163554bf64ae98c0fa57aba5d785a79a792f..d23450d4d79dcbdb35f665fddbfd8333192b8afc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,11 +2,12 @@ History ======= -0.19.3 (coming soon) --------------------- +0.19.3 (2023-04-03) +------------------- * !87: Adapted conda environments to latest changes of enmapbox requirements. enpt_enmapboxapp is now installed from conda-forge as this is now available. +* !88: Fixed #103 ("ValueError: cannot convert float NaN to integer" within dead pixel correction). 0.19.2 (2023-03-22) diff --git a/enpt/processors/dead_pixel_correction/dead_pixel_correction.py b/enpt/processors/dead_pixel_correction/dead_pixel_correction.py index 00354c15b41918bfdb0a02b6620a61f365e10dc4..1240b80051ab163d22a4d223de2b0bc99d511e26 100644 --- a/enpt/processors/dead_pixel_correction/dead_pixel_correction.py +++ b/enpt/processors/dead_pixel_correction/dead_pixel_correction.py @@ -345,8 +345,10 @@ def interp_nodata_spatially_2d(data_2d: np.ndarray, data_2d = np.array(DataFrame(data2int) .interpolate(method=method, axis=axis)).astype(data_2d.dtype) - if fill_value: - data_2d[np.isnan(data_2d)] = fill_value + if np.isfinite(fill_value): + mask_nan = np.isnan(data_2d) + if True in mask_nan: + data_2d[mask_nan] = fill_value else: raise ValueError(implementation, 'Unknown implementation.')