Commit 85210ec0 authored by Anton Akhmerov's avatar Anton Akhmerov

correctly ignore missing data in limit calculations

parent 50ec2786
Pipeline #14339 passed with stages
in 33 minutes and 11 seconds
......@@ -1302,6 +1302,7 @@ def map(sys, value, colorbar=True, cmap=None, vmin=None, vmax=None, a=None,
# Calculate the min/max bounds for the colormap.
# User-provided values take precedence.
unmasked_data = img[~img.mask].data.flatten()
unmasked_data = unmasked_data[~np.isnan(unmasked_data)]
new_vmin, new_vmax = percentile_bound(unmasked_data, vmin, vmax)
overflow_pct = 100 * np.sum(unmasked_data > new_vmax) / len(unmasked_data)
underflow_pct = 100 * np.sum(unmasked_data < new_vmin) / len(unmasked_data)
......
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