Skip to content

Commit

Permalink
[deploy test]
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Kallekleiv committed Sep 2, 2020
1 parent 242e1bd commit 8dde318
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions webviz_subsurface/_datainput/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,11 @@ def new_make_surface_layer(
Returns:
A surface layer that can be plotted in NewLayeredMap
"""
from uuid import uuid4

zvalues = get_surface_arr(surface)[2]
bounds = [[surface.xmin, surface.ymin], [surface.xmax, surface.ymax]]
min_val = min_val if min_val is not None else np.nanmin(zvalues)
max_val = max_val if max_val is not None else np.nanmax(zvalues)
# color = None
image = base64.b64decode(array_to_png(zvalues.copy())[22:])
img = Image.open(io.BytesIO(image))
img = Image.open(io.BytesIO(base64.b64decode(array_to_png(zvalues.copy())[22:])))
width, height = img.size
if width * height >= 300 * 300:
scale = 1.0
Expand Down Expand Up @@ -138,7 +134,7 @@ def new_make_surface_layer(
"pixelScale": 1000,
"setBlackToAlpha": True,
},
"bounds": bounds,
"bounds": [[surface.xmin, surface.ymin], [surface.xmax, surface.ymax]],
"minvalue": round(min_val, 4) if min_val else None,
"maxvalue": round(max_val, 4) if max_val else None,
"unit": str(unit),
Expand Down

0 comments on commit 8dde318

Please sign in to comment.