Skip to content

RFT correlation report plot: combined RFT/correlation/cross-plot view with formation filtering - #14837

Draft
magnesj wants to merge 6 commits into
OPM:devfrom
magnesj:feature/rft-correlation-report-plot
Draft

magnesj wants to merge 6 commits into
OPM:devfrom
magnesj:feature/rft-correlation-report-plot

Conversation

@magnesj

@magnesj magnesj commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a combined RFT correlation report plot (RimRftCorrelationReportPlot), similar to RimCorrelationReportPlot but built around RFT data:

  1. RimWellRftPlot - the RFT well log plot
  2. A correlation/tornado plot between observed pressure and a selected ensemble parameter
  3. A cross plot between pressure values and the uncertainty parameter

Correlation and cross plots can be filtered by formation name/depth range, driven by RimObservedFmuRftData.

Key features

  • Combined dock layout hosting the RFT plot, correlation plot, and cross plot together.
  • Depth range filter merged with formation selection (single combo box: pick a named formation or an explicit MD/TVD range).
  • Cross plot sample mode: "Mean" (per-realization average) or "All" (every sample).
  • Observed pressure shown as a reference line in the cross plot, with the observation error band as stippled lines and text labels; axis ranges account for these so they stay visible.
  • Clicking a parameter in the correlation (tornado) plot updates the RFT curve coloring by that parameter, and vice versa.
  • Clicking in the formation background of the RFT track sets the depth filter to that formation.
  • New explicit "Observed RFT Data" formation source option for RFT plot tracks (previously only an invisible automatic fallback), so formations derived from FMU RFT observation data can be selected even when a grid case is also present in the project. Formation tops for this source are stored on the track itself so they work even for wells with no imported RimWellPath.
  • Formation names derived from observed RFT data are tagged with an (Estimate) postfix wherever shown (formation filter dropdown, RFT track formation bands), since their depth ranges are approximate (derived from the MD span of RFT observation points), not exact geological picks.

Fixes #14850

@magnesj
magnesj force-pushed the feature/rft-correlation-report-plot branch 2 times, most recently from e0f64bf to 56b8c6e Compare October 3, 2026 15:07
@magnesj
magnesj requested a balanced review from Copilot October 4, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Dock lifecycle regressions, incorrect depth-coordinate handling, and stale or destructive formation state can produce broken UI behavior and inaccurate filtering.

Review effort: Balanced
Findings: 3 High severity · 5 Medium severity

Open (8)
What changed in this PR

Extends the RFT correlation report with formation filtering, sample modes, observed-pressure references, and synchronized plots.

Changes:

  • Adds formation-derived filtering and clickable formation regions.
  • Adds per-realization/all-sample cross-plot modes and observed-pressure markers.
  • Adds RFT curve coloring synchronization and embedded plot lifecycle handling.
File Description
ApplicationLibCode/​UserInterface/​RiuWellLogTrack.h Adds formation-click signal.
ApplicationLibCode/​UserInterface/​RiuWellLogTrack.cpp Resolves clicked formations.
ApplicationLibCode/​UserInterface/​RiuQwtPlotWidget.h Adds plot-click hook.
ApplicationLibCode/​UserInterface/​RiuQwtPlotWidget.cpp Dispatches canvas clicks.
ApplicationLibCode/​UnitTests/​RifReaderFmuRft-Test.cpp Tests MD-to-TVD conversion.
ApplicationLibCode/​ReservoirDataModel/​Well/​RigWellPathFormations.h Adds range and lookup APIs.
ApplicationLibCode/​ReservoirDataModel/​Well/​RigWellPathFormations.cpp Implements formation ranges and lookup.
ApplicationLibCode/​ProjectDataModel/​WellLog/​WellLogTrack/​RimWellLogTrack.h Exposes formation-source operations.
ApplicationLibCode/​ProjectDataModel/​WellLog/​WellLogTrack/​RimWellLogTrack.cpp Renders and queries formation regions.
ApplicationLibCode/​ProjectDataModel/​WellLog/​WellLogTrack/​RimWellLogRegionAnnotationSettings.cpp Adjusts default transparency.
ApplicationLibCode/​ProjectDataModel/​WellLog/​WellLogTrack/​RimWellLogFormationSettings.cpp Adds observed-RFT source UI.
ApplicationLibCode/​ProjectDataModel/​WellLog/​RimWellLogRftCurve.h Reports returned depth type.
ApplicationLibCode/​ProjectDataModel/​WellLog/​RimWellLogRftCurve.cpp Implements depth-type reporting.
ApplicationLibCode/​ProjectDataModel/​RimViewWindow.cpp Changes dock-controller removal.
ApplicationLibCode/​ProjectDataModel/​RimObservedFmuRftData.h Exposes formation and pressure helpers.
ApplicationLibCode/​ProjectDataModel/​RimObservedFmuRftData.cpp Delegates new reader operations.
ApplicationLibCode/​ProjectDataModel/​Flow/​RimWellRftPlot.h Adds observed-formation support.
ApplicationLibCode/​ProjectDataModel/​Flow/​RimWellRftPlot.cpp Builds and applies RFT formations.
ApplicationLibCode/​ProjectDataModel/​Flow/​RimWellRftEnsembleCurveSet.h Adds appearance access and coloring API.
ApplicationLibCode/​ProjectDataModel/​Flow/​RimWellRftEnsembleCurveSet.cpp Applies parameter-based coloring.
ApplicationLibCode/​ProjectDataModel/​CorrelationPlots/​RimRftTornadoPlot.h Adds formation title state.
ApplicationLibCode/​ProjectDataModel/​CorrelationPlots/​RimRftTornadoPlot.cpp Displays formation-filter titles.
ApplicationLibCode/​ProjectDataModel/​CorrelationPlots/​RimRftCorrelationReportPlot.h Adds reload and click handling.
ApplicationLibCode/​ProjectDataModel/​CorrelationPlots/​RimRftCorrelationReportPlot.cpp Connects embedded plot interactions.
ApplicationLibCode/​ProjectDataModel/​CorrelationPlots/​RimParameterRftCrossPlot.h Adds filters and sample modes.
ApplicationLibCode/​ProjectDataModel/​CorrelationPlots/​RimParameterRftCrossPlot.cpp Implements filtering, samples, and references.
ApplicationLibCode/​ProjectDataModel/​Appearance/​RimCurveSetAppearance.h Adds appearance getters.
ApplicationLibCode/​ProjectDataModel/​Appearance/​RimCurveSetAppearance.cpp Implements appearance getters.
ApplicationLibCode/​FileInterface/​RifReaderFmuRft.h Adds formation and observation APIs.
ApplicationLibCode/​FileInterface/​RifReaderFmuRft.cpp Implements range and pressure calculations.
ApplicationLibCode/​Commands/​WellLogCommands/​RicCreateRftPlotsFeature.cpp Explicitly docks standalone plots.
ApplicationLibCode/​Application/​RiaWellLogTrackDefines.h Adds observed-RFT source enum.
ApplicationLibCode/​Application/​RiaWellLogTrackDefines.cpp Registers the source option.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp Outdated
Comment thread ApplicationLibCode/ProjectDataModel/RimViewWindow.cpp
Comment thread ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp Outdated
Comment thread ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp Outdated
Comment thread ApplicationLibCode/UserInterface/RiuWellLogTrack.cpp Outdated
magnesj added a commit to magnesj/ResInsight that referenced this pull request Oct 4, 2026
- Fix setColorByEnsembleParameter() to actually switch color mode to BY_ENSEMBLE_PARAM
- Stop mutating the well path's persistent formationsGeometry() from observed-RFT data
- Clear stale observed-RFT formation bands on failed refresh (only when source is RFT_OBSERVED_DATA)
- Fix convertMdRangeToTvd() to handle a single observation instead of defaulting TVD range to 0
- Revert removeWindowFromDock() regression that broke ordinary view close/show-again; add
  detachWindowFromDockPermanently() for the one-off permanent-detach case used by the embedded RFT plot
- Fix TVD/MD unit mismatch in RimParameterRftCrossPlot when falling back to TVD-only depths
- Add reverse sync: changing an embedded curve set's ensemble-parameter coloring in the RFT plot now
  updates the tornado plot and cross plot (RimWellRftEnsembleCurveSet::colorByEnsembleParameterChanged)
- Fix depth-unit/RKB-offset mismatch in RiuWellLogTrack::onMouseClickEvent() via new
  RimWellLogTrack::formationNameAtDisplayDepth()
magnesj added a commit to magnesj/ResInsight that referenced this pull request Oct 5, 2026
…nPlot

Fixes a null-pointer access violation when a track's formation data is updated (e.g. observed RFT formations) after the track's view widget has already been destroyed, such as during application shutdown.
magnesj added a commit to magnesj/ResInsight that referenced this pull request Oct 5, 2026
…loaded from project file

RimWellRftPlot::createEnsembleCurveSets() only connected the colorByEnsembleParameterChanged signal for newly created curve sets. Curve sets restored from a project file already exist in m_ensembleCurveSets, so the connection was never made, and reverse-sync to the correlation report plot's tornado/cross plots did not work after loading a project. Now connect unconditionally for both new and pre-existing curve sets (connecting twice is a safe no-op).
@magnesj
magnesj force-pushed the feature/rft-correlation-report-plot branch from 38d9c4f to c0ea479 Compare October 5, 2026 05:55
… FMU RFT data

Add RifReaderFmuRft/RimObservedFmuRftData APIs to retrieve zone (formation) names and their MD/TVD
depth ranges for a given well and time step, and add a RigWellPathFormations constructor/helpers to
build a formation-tops object directly from a list of named ranges rather than only from a grid case.
Also add the RFT_OBSERVED_DATA value to the WellLogTrackFormationSource enum so this new data source
can be selected as a formation source elsewhere in the plot framework.

These building blocks are not yet wired into any plot; later commits use them to let RFT plots and
well log tracks derive formation tops from observed RFT data instead of a grid case or well path.
…er, and pressure error bands

RimWellLogTrack/RiuWellLogTrack:
 - Support "Observed RFT Data" as an explicit formation source (RimWellLogFormationSettings), with
   the track itself owning the observed-RFT formation geometry (rather than the well path), restore
   formation color shading for well-pick/RFT formation sources, and change the default color shading
   transparency from 50 to 85.
 - Emit a formationClicked signal from RiuWellLogTrack when the user clicks a formation annotation
   band, for use by composite plots that want to use the clicked formation as a filter.
 - Guard against a null plot widget in updateRegionAnnotationsOnPlot() to avoid a crash when a
   track's formation data is updated after its view widget has already been destroyed.

RimWellLogRftCurve/RiuQwtPlotWidget: add text labels and a transparent +/- error band background for
observed pressure curves, and keep the plot's Y-axis range wide enough to keep them visible; later
tuned to a light-pink band without text labels.

RimWellRftPlot: derive formation tops from observed FMU RFT data (zone names and MD/TVD ranges) when
the user selects "Observed RFT Data" as the formation source, or automatically as a fallback when no
grid case is available to provide formation tops (e.g. ensemble-only projects).
…sample mode selection

Combine the "Formation" and "Filter by Depth Range" controls into a single combo box that lets the
user pick either a named formation (deriving its depth range via the new formation depth-range
lookup) or an explicit numeric depth range, and fix a bug where a degenerate depth-range filter
produced no correlation data.

Replace the old boolean "Show All Samples" toggle with a SampleMode combo box (Mean vs. show all
per-case samples), naming the option "Mean" to match plot terminology rather than "Average".
RimCurveSetAppearance: expose colorMode()/ensembleParameter() accessors needed by callers that react
to or synchronize with a curve set's current coloring state.

RimWellRftEnsembleCurveSet: add a colorByEnsembleParameterChanged signal, emitted whenever the curve
set settles on by-ensemble-parameter coloring, and updateEnsembleParameterIfColoringActive(), which
updates the active ensemble parameter only if the curve set is already in that coloring mode (it never
switches a curve set from single-color or any other mode into by-ensemble-parameter coloring).

RimRftTornadoPlot: add setFormationFilterName() to show the active formation filter in the plot title.

None of this is wired up to any UI yet; the next commit connects it to the RFT correlation report plot.
…ilter, and coloring sync

RimViewWindow: add detachWindowFromDockPermanently(), which removes a window from its dock and
discards the window controller for good (unlike removeWindowFromDock(), which must leave the
controller intact so the window can be re-docked later). RicCreateRftPlotsFeature now explicitly
docks a stand-alone RimWellRftPlot, since RimWellRftPlot no longer docks itself by default.

RimRftCorrelationReportPlot:
 - Permanently detach the embedded RimWellRftPlot from the dock system instead of just hiding it, and
   re-apply that detachment (plus callback wiring) in initAfterRead(), since the PDM factory bypasses
   the constructor when restoring child plots from a project file.
 - Connect to the RFT plot track's formationClicked signal so clicking a formation annotation band
   applies it as the depth-range filter used by the tornado/cross plots, and forward the cross plot's
   selected formation name to the tornado plot title.
 - Stop forcing the embedded RFT plot's curve set into by-ensemble-parameter coloring when a parameter
   is selected in the tornado/cross plot; only update the active parameter if that coloring mode is
   already in use. Add the reverse sync: when the user changes an ensemble curve set's coloring
   directly in the RFT plot, mirror the active parameter onto the tornado plot and cross plot.
@magnesj
magnesj force-pushed the feature/rft-correlation-report-plot branch from c0ea479 to ef91821 Compare October 5, 2026 06:14
@magnesj
magnesj requested a review from kriben October 5, 2026 06:21
@magnesj
magnesj marked this pull request as ready for review October 5, 2026 06:21
Comment thread ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp Outdated
Comment thread ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp Outdated
Comment thread ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp Outdated
Comment thread ApplicationLibCode/ReservoirDataModel/Well/RigWellPathFormations.cpp Outdated
Comment thread ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp Outdated
Comment thread ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp Outdated
Comment thread ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterRftCrossPlot.cpp Outdated
Comment thread ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterRftCrossPlot.cpp Outdated
Comment thread ApplicationLibCode/ReservoirDataModel/Well/RigWellPathFormations.cpp Outdated
…stale depth-range filter, support CASE formation clicks

- RifReaderFmuRft: replace early-continue loops with guarded bodies (kriben review)
- RigWellPathFormations::namesAndRangesUpToLevel: append fluids before the NONE
  early return so 'None' + 'Show Fluids' matches depthAndFormationNamesUpToLevel()
- RimWellRftPlot: drop unnecessary continues when building observed-RFT formations
- RimParameterRftCrossPlot: reject (clear) the formation filter selection when no
  matching observed FMU RFT interval is found instead of leaving a stale depth
  range while the title shows the new formation name
- RimRftCorrelationReportPlot: use nested-if connection style instead of continues
- RimWellLogFormationSettings: remove unnecessary continue in calculateValueOptions
- RimWellLogTrack: cache CASE-derived formation names/depth ranges so
  formationNameAtDepth() resolves a name for CASE-sourced formation bands too,
  so clicking them now emits formationClicked() like the other sources
@magnesj
magnesj marked this pull request as draft October 5, 2026 18:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFT correlation report plot: combined RFT/correlation/cross-plot view with formation filtering

3 participants