Make nanMask compatible with 3D data

This commit is contained in:
Jan Kotanski 2020-03-07 10:16:49 +01:00 committed by Kenneth Lyons
parent 61967bd7f7
commit daeacad71f

View File

@ -1113,7 +1113,10 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False):
# awkward, but fastest numpy native nan evaluation
#
nanMask = None
if data.ndim == 2 and data.dtype.kind == 'f' and np.isnan(data.min()):
if data.dtype.kind == 'f' and np.isnan(data.min()):
nanMask = np.isnan(data)
if data.ndim > 2:
nanMask = np.any(nanMask, axis=-1)
nanMask = np.isnan(data)
# Apply levels if given
if levels is not None: