Skip to content

Commit f26dca2

Browse files
CO2 Migration: Rename hazardous to no-go, add contours, and other minor fixes/changes (#1365)
1 parent 49e918b commit f26dca2

File tree

9 files changed

+389
-97
lines changed

9 files changed

+389
-97
lines changed

webviz_subsurface/_providers/ensemble_polygon_provider/_provider_impl_file.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class Col:
3333

3434
class PolygonType(StrEnum):
3535
SIMULATED = "simulated"
36-
HAZARDUOUS_BOUNDARY = "hazarduous_boundary"
36+
HAZARDOUS_BOUNDARY = "hazardous_boundary" # Keep for backward compatibility
37+
NOGO_BOUNDARY = "nogo_boundary"
3738
CONTAINMENT_BOUNDARY = "containment_boundary"
3839

3940

webviz_subsurface/plugins/_co2_migration/_plugin.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
MapAttribute,
4141
MapThresholds,
4242
MapType,
43+
check_hazardous_polygon,
44+
deactivate_polygon_warnings,
4345
)
4446
from webviz_subsurface.plugins._co2_migration._utilities.initialization import (
4547
init_containment_data_providers,
@@ -95,7 +97,7 @@ class CO2Migration(WebvizPluginABC):
9597
* **`map_surface_names_to_fault_polygons`:** Mapping between surface map names and
9698
surface names used by the fault polygons
9799
* **`boundary_settings`:** Settings for polygons representing the containment and
98-
hazardous areas
100+
nogo areas
99101
---
100102
101103
This plugin is tightly linked to the FMU CCS post-process available in the ccs-scripts
@@ -141,17 +143,17 @@ class CO2Migration(WebvizPluginABC):
141143
Similar for `map_surface_names_to_fault_polygons`.
142144
143145
`boundary_settings` is the final override option, and it can be used to specify
144-
polygons representing the containment and hazardous areas. By default, the polygons are
146+
polygons representing the containment and nogo areas. By default, the polygons are
145147
expected to be named:
146148
- `share/results/polygons/containment--boundary.csv`
147-
- `share/results/polygons/hazarduous--boundary.csv`
149+
- `share/results/polygons/nogo--boundary.csv`
148150
149151
This corresponds to the following input:
150152
```
151153
boundary_settings:
152154
polygon_file_pattern: share/results/polygons/*.csv
153155
attribute: boundary
154-
hazardous_name: hazardous
156+
nogo_name: nogo
155157
containment_name: containment
156158
```
157159
All four settings are optional, and if not specified, the default values are used.
@@ -182,6 +184,8 @@ def __init__(
182184
super().__init__()
183185
self._error_message = ""
184186
try:
187+
deactivate_polygon_warnings()
188+
check_hazardous_polygon(boundary_settings)
185189
ensemble_paths = {
186190
ensemble_name: webviz_settings.shared_settings["scratch_ensembles"][
187191
ensemble_name
@@ -435,6 +439,13 @@ def _add_create_map_callback(self) -> None:
435439
"cm_max_val": Input(
436440
self._settings_component(ViewSettings.Ids.CM_MAX), "value"
437441
),
442+
"contour_switch": Input(
443+
self._settings_component(ViewSettings.Ids.CONTOURS_SWITCH), "value"
444+
),
445+
"contour_quantity": Input(
446+
self._settings_component(ViewSettings.Ids.CONTOURS_QUANTITY),
447+
"value",
448+
),
438449
"plume_threshold": Input(
439450
self._settings_component(ViewSettings.Ids.PLUME_THRESHOLD),
440451
"value",
@@ -480,12 +491,14 @@ def update_map_attribute(
480491
cm_min_val: Optional[float],
481492
cm_max_auto: List[str],
482493
cm_max_val: Optional[float],
494+
contour_switch: List[str],
495+
contour_quantity: Optional[float],
483496
plume_threshold: Optional[float],
484497
plume_smoothing: Optional[float],
485498
visualization_update: int,
486499
mass_unit: str,
487500
mass_unit_update: int,
488-
options_dialog_options: List[int],
501+
options_dialog_options: List[str],
489502
selected_wells: List[str],
490503
ensemble: str,
491504
current_views: List[Any],
@@ -545,13 +558,12 @@ def update_map_attribute(
545558
map_attribute_names=self._map_attribute_names,
546559
)
547560
assert isinstance(self._visualization_info["unit"], str)
548-
surf_data, self._summed_co2 = process_summed_mass(
561+
current_summed_mass, self._summed_co2 = process_summed_mass(
549562
formation,
550563
realization,
551564
datestr,
552565
attribute,
553566
summed_mass,
554-
surf_data,
555567
self._summed_co2,
556568
self._visualization_info["unit"],
557569
)
@@ -568,6 +580,9 @@ def update_map_attribute(
568580
fault_polygon_url = self._fault_polygon_handlers[
569581
ensemble
570582
].extract_fault_polygon_url(formation, realization)
583+
nogo_polygon_url = self._polygon_handlers[ensemble].extract_nogo_poly_url(
584+
realization
585+
)
571586
hazardous_polygon_url = self._polygon_handlers[
572587
ensemble
573588
].extract_hazardous_poly_url(realization)
@@ -580,18 +595,26 @@ def update_map_attribute(
580595
surface_data=surf_data,
581596
fault_polygon_url=fault_polygon_url,
582597
containment_bounds_url=containment_polygon_url,
583-
haz_bounds_url=hazardous_polygon_url,
598+
nogo_bounds_url=nogo_polygon_url,
599+
hazardous_bounds_url=hazardous_polygon_url,
584600
well_pick_provider=self._well_pick_provider.get(ensemble, None),
585601
plume_extent_data=plume_polygon,
586602
options_dialog_options=options_dialog_options,
587603
selected_wells=selected_wells,
604+
show_contours=len(contour_switch) > 0,
605+
num_contours=contour_quantity,
588606
)
589607
annotations = create_map_annotations(
590608
formation=formation,
591609
surface_data=surf_data,
592610
colortables=self._color_tables,
593611
attribute=attribute,
594612
unit=self._visualization_info["unit"],
613+
current_total=current_summed_mass,
614+
options=options_dialog_options,
615+
con_url=containment_polygon_url,
616+
haz_url=hazardous_polygon_url,
617+
nogo_url=nogo_polygon_url,
595618
)
596619
viewports = no_update if current_views else create_map_viewports()
597620
return layers, annotations, viewports

0 commit comments

Comments
 (0)