-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into multiColorLegend
- Loading branch information
Showing
19 changed files
with
676 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import numpy as np | ||
import xtgeo | ||
import dash | ||
import webviz_subsurface_components as wsc | ||
|
||
from utils.xtgeo_surface_to_float32 import get_surface_float32 | ||
from utils.xtgeo_polygons_to_json import xtgeo_polygons_to_polylines_geojson | ||
|
||
# Import a depth surface and a property surface using xtgeo | ||
depth_surface = xtgeo.surface_from_file("examples/example-data/topvolantis_depth.gri") | ||
property_surface = xtgeo.surface_from_file( | ||
"examples/example-data/topvolantis_seismic_attribute.gri" | ||
) | ||
polygons = xtgeo.polygons_from_file( | ||
"examples/example-data/topvolantis_faultpolygons.pol" | ||
) | ||
|
||
app = dash.Dash(__name__) | ||
|
||
app.layout = wsc.SubsurfaceViewerDashWrapper( | ||
id="deckgl-map", | ||
layers=[ | ||
{ | ||
"@@type": "AxesLayer", | ||
"id": "axes-layer", | ||
"bounds": [ | ||
depth_surface.xmin, | ||
depth_surface.ymin, | ||
-np.nanmax(depth_surface.values), | ||
depth_surface.xmax, | ||
depth_surface.ymax, | ||
np.nanmin(depth_surface.values), | ||
], | ||
}, | ||
{ | ||
"@@type": "MapLayer", | ||
"id": "mesh-layer", | ||
"meshUrl": "/map/mesh", | ||
"frame": { | ||
"origin": [depth_surface.xori, depth_surface.yori], | ||
"count": [depth_surface.ncol, depth_surface.nrow], | ||
"increment": [depth_surface.xinc, depth_surface.yinc], | ||
"rotDeg": depth_surface.rotation, | ||
}, | ||
"contours": [0, 20], | ||
"isContoursDepth": True, | ||
"gridLines": False, | ||
"material": True, | ||
"colorMapName": "Physics", | ||
"name": "mesh", | ||
}, | ||
{ | ||
"@@type": "MapLayer", | ||
"id": "mesh-and-property-layer", | ||
"meshUrl": "/map/mesh", | ||
"propertiesUrl": "/map/property", | ||
"frame": { | ||
"origin": [depth_surface.xori, depth_surface.yori], | ||
"count": [depth_surface.ncol, depth_surface.nrow], | ||
"increment": [depth_surface.xinc, depth_surface.yinc], | ||
"rotDeg": depth_surface.rotation, | ||
}, | ||
"isContoursDepth": True, | ||
"gridLines": False, | ||
"material": True, | ||
"colorMapName": "Seismic", | ||
"name": "mesh", | ||
}, | ||
{ | ||
"@@type": "FaultPolygonsLayer", | ||
"id": "fault-layer", | ||
"data": "/faults/faults.json", | ||
"refine": False, | ||
}, | ||
], | ||
views={ | ||
"layout": [1, 2], | ||
"showLabel": True, | ||
"viewports": [ | ||
{ | ||
"id": "view_1", | ||
"show3D": False, | ||
"name": "Depth surface", | ||
"layerIds": ["axes-layer", "mesh-layer"], | ||
"isSync": True, | ||
}, | ||
{ | ||
"id": "view_2", | ||
"show3D": False, | ||
"name": "Property mapped on depth surface", | ||
"layerIds": [ | ||
"fault-layer", | ||
"axes-layer", | ||
"mesh-and-property-layer", | ||
], | ||
"isSync": True, | ||
}, | ||
], | ||
}, | ||
children=[ | ||
wsc.ViewAnnotation(id="view_1", children=[wsc.ViewFooter(children="Hugin")]), | ||
wsc.ViewAnnotation(id="view_2", children=[wsc.ViewFooter(children="sdfsfd")]), | ||
], | ||
) | ||
|
||
|
||
@app.server.route("/map/<map_name>") | ||
def send_map(map_name: str): | ||
if map_name == "mesh": | ||
return get_surface_float32(depth_surface) | ||
if map_name == "property": | ||
return get_surface_float32(property_surface) | ||
|
||
|
||
@app.server.route("/faults/faults.json") | ||
def send_faults(): | ||
return xtgeo_polygons_to_polylines_geojson(polygons, xy_only=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run_server(debug=True) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
react/src/lib/components/DeckGLMap/SubsurfaceViewerDashWrapper.stories.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.