From e58682b625191fc323dd54101c9bb9a8010794a2 Mon Sep 17 00:00:00 2001 From: Hans Kallekleiv Date: Tue, 23 Mar 2021 16:47:27 +0100 Subject: [PATCH] Set surface values to zero if all are masked --- CHANGELOG.md | 1 + webviz_subsurface/_models/surface_leaflet_model.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1efb16a6..5a0132964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] - YYYY-MM-DD ### Fixed - [#569](https://github.com/equinor/webviz-subsurface/pull/584) - Fixed bug for in RelativePermeability plugin where it was not possible to plot against oil saturation axis when using relperm data of "family 2". +- [#594](https://github.com/equinor/webviz-subsurface/pull/594) - Fixed bug in SurfaceViewerFMU where surfaces with only undefined values was not handled properly. ## [0.1.9] - 2021-02-23 ### Fixed diff --git a/webviz_subsurface/_models/surface_leaflet_model.py b/webviz_subsurface/_models/surface_leaflet_model.py index e92b9826b..93862ecde 100644 --- a/webviz_subsurface/_models/surface_leaflet_model.py +++ b/webviz_subsurface/_models/surface_leaflet_model.py @@ -80,6 +80,9 @@ def get_zvalues( values = surface.values if flip: values = np.flip(values.transpose(), axis=0) + # If all values are masked set to zero + if values.mask.all(): + values = np.zeros(values.shape) return values @property