Skip to content

Commit

Permalink
Handle operations between surfaces of different topology (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv authored Jun 11, 2021
1 parent 2ebe7aa commit a145dc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#658](https://github.com/equinor/webviz-subsurface/pull/658) - Refactored Tornado figure code to be more reusable. Improved the Tornado bar visualization, added table display
and improved layout in relevant plugins.

### Fixed
- [#666](https://github.com/equinor/webviz-subsurface/pull/666) - Handle operations between surfaces with different topology in `SurfaceViewerFMU`

## [0.2.3] - 2021-06-07

### Changed
Expand Down
11 changes: 5 additions & 6 deletions webviz_subsurface/plugins/_surface_viewer_fmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,13 +731,12 @@ def calculate_surface_difference(
surface2: xtgeo.RegularSurface,
calculation: str = "Difference",
) -> xtgeo.RegularSurface:
surface3 = surface.copy()
if calculation == "Difference":
surface3.values = surface3.values - surface2.values
calculated_surface = surface - surface2
elif calculation == "Sum":
surface3.values = surface3.values + surface2.values
calculated_surface = surface + surface2
elif calculation == "Product":
surface3.values = surface3.values * surface2.values
calculated_surface = surface * surface2
elif calculation == "Quotient":
surface3.values = surface3.values / surface2.values
return surface3
calculated_surface = surface / surface2
return calculated_surface

0 comments on commit a145dc7

Please sign in to comment.