Skip to content

Commit fb241f0

Browse files
authored
Merge pull request pytroll#3315 from avalentino/bugfix/issue-2934
2 parents 32c8467 + 7b86d9c commit fb241f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

satpy/enhancements/colormap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def lookup(img, **kwargs):
4343
def _lookup_table(band_data, luts=None, index=-1):
4444
# NaN/null values will become 0
4545
lut = luts[:, index] if len(luts.shape) == 2 else luts
46-
band_data = band_data.clip(0, lut.size - 1).astype(np.uint8)
46+
band_data = band_data.clip(0, lut.size - 1)
47+
# Convert to uint8, with NaN/null values changed into 0
48+
band_data = np.nan_to_num(band_data).astype(np.uint8)
4749
return lut[band_data]
4850

4951

0 commit comments

Comments
 (0)