TNO Intern

Commit 2df16856 authored by Arjo Segers's avatar Arjo Segers
Browse files

Support masked arrays for selecting no-data values.

parent c4bb6f50
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#
# 2025-09, Arjo Segers
#   Improved supported for defined number of color entries.
#   Support masked arrays for selecting no-data values.
#

#
@@ -1066,7 +1067,11 @@ class ColorbarFigure(Figure):
        # adhoc: add layer with no-data colors
        if self.cmap__color_bad is not None:
            # any nan values?
            if hasattr(cc,"mask"):
                jj, ii = numpy.where(cc.mask)
            else:
                jj, ii = numpy.where(numpy.isnan(cc))
            #endif
            if len(jj) > 0:
                # init as full nan field:
                cc2 = numpy.full(cc.shape, numpy.nan)