Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to SurfaceViewerFMU #526

Merged
merged 1 commit into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED] - YYYY-MM-DD
### Fixed
- [#526](https://github.com/equinor/webviz-subsurface/pull/526) - Fixes to `SurfaceViewerFMU`. User defined map units are now correctly displayed. Map height can now be set (useful for maps with elongated geometry). Added some missing documentation
- [#531](https://github.com/equinor/webviz-subsurface/pull/531) - The change in [#505](https://github.com/equinor/webviz-subsurface/pull/505) resulted in potentially very large datasets when using `raw` sampling. Some users experienced `MemoryError`. `column_keys` filtering is therefore now used when loading and storing data if `sampling` is `raw` in plugins using `UNSMRY` data, most noticable in `BhpQc` which has `raw` as the default and only option.

## [0.1.6] - 2020-11-30
Expand Down
2 changes: 1 addition & 1 deletion webviz_subsurface/_datainput/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def make_surface_layer(
color: Optional[List[str]] = None,
shader_type: Optional[str] = "soft-hillshading",
shadows: bool = False,
unit: str = "",
unit: str = " ",
) -> Dict[str, Any]:
"""Make NewLayeredMap surface image base layer
Args:
Expand Down
24 changes: 17 additions & 7 deletions webviz_subsurface/plugins/_surface_viewer_fmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,19 @@ class SurfaceViewerFMU(WebvizPluginABC):
Available settings are:
* `min`: Truncate colorscale (lower limit).
* `max`: Truncate colorscale (upper limit).
* `color`: Set the colormap (default is viridis).
* `color`: List of hexadecimal colors.
* `unit`: Text to display as unit in label.
* **`wellfolder`:** Folder with RMS wells.
* **`wellsuffix`:** File suffix for wells in well folder.
* **`map_height`:** Set the height in pixels for the map views.

---
The available maps are gathered from the `share/results/maps/` folder
for each realization. Subfolders are not supported.

The filenames need to follow a fairly strict convention, as the filenames are used as metadata:
`horizon_name--attribute--date` (`--date` is optional). The files should be on `irap binary`
format (typically `.gri` or `.irapbin`) The date is of the form `YYYYMMDD` or
format with the suffix `.gri`. The date is of the form `YYYYMMDD` or
`YYYYMMDD_YYYYMMDD`, the latter would be for a delta surface between two dates.
See [this folder]\
(https://github.com/equinor/webviz-subsurface-testdata/tree/master/reek_history_match/\
Expand All @@ -76,9 +77,12 @@ class SurfaceViewerFMU(WebvizPluginABC):
max: 10
unit: m
atr_b:
color: rainbow
color:
- "#000004"
- "#1b0c41"
- "#4a0c6b"
- "#781c6d"
```
Valid options for `color` are `viridis` (default), `inferno`, `warm`, `cool` and `rainbow`.

"""

Expand All @@ -90,6 +94,7 @@ def __init__(
attribute_settings: dict = None,
wellfolder: Path = None,
wellsuffix: str = ".w",
map_height: int = 600,
):

super().__init__()
Expand All @@ -107,6 +112,7 @@ def __init__(
if self.surfacedf.empty:
raise ValueError("No surfaces found with the given attributes")
self.attribute_settings: dict = attribute_settings if attribute_settings else {}
self.map_height = map_height
self.surfaceconfig = surfacedf_to_dict(self.surfacedf)
self.wellfolder = wellfolder
self.wellsuffix = wellsuffix
Expand Down Expand Up @@ -370,7 +376,11 @@ def layout(self) -> html.Div:
style={"fontSize": "1rem"},
children=[
html.Div(
style={"height": "600px", "margin": "10px", "flex": 4},
style={
"height": self.map_height,
"margin": "10px",
"flex": 4,
},
children=[
LeafletMap(
syncedMaps=[self.uuid("map2"), self.uuid("map3")],
Expand Down Expand Up @@ -623,7 +633,7 @@ def _set_base_layer(
shader_type=hillshade,
min_val=attribute_settings.get(data["attr"], {}).get("min", None),
max_val=attribute_settings.get(data["attr"], {}).get("max", None),
unit=attribute_settings.get(data2["attr"], {}).get("unit", ""),
unit=attribute_settings.get(data["attr"], {}).get("unit", " "),
)
]
surface_layers2: List[dict] = [
Expand All @@ -634,7 +644,7 @@ def _set_base_layer(
shader_type=hillshade2,
min_val=attribute_settings.get(data2["attr"], {}).get("min", None),
max_val=attribute_settings.get(data2["attr"], {}).get("max", None),
unit=attribute_settings.get(data2["attr"], {}).get("unit", ""),
unit=attribute_settings.get(data2["attr"], {}).get("unit", " "),
)
]

Expand Down