Skip to content

Add RFT correlation plots#13871

Draft
magnesj wants to merge 21 commits intoOPM:devfrom
magnesj:rft-correlation-plot
Draft

Add RFT correlation plots#13871
magnesj wants to merge 21 commits intoOPM:devfrom
magnesj:rft-correlation-plot

Conversation

@magnesj
Copy link
Copy Markdown
Member

@magnesj magnesj commented Apr 14, 2026

Closes #12276

magnesj and others added 21 commits April 14, 2026 15:05
Add a second pass that linearly interpolates MD for any infinity-TVD entries,
ensuring the result vector is always the same size as the input and remains
monotonically rising. Add unit tests covering all-infinity, mixed, single,
and consecutive infinity cases.
…lotPage

Add null checks for m_plotWidgets[i] in updateSubTitles,
legendsForVisiblePlots, legendFramesForVisiblePlots, and
subTitlesForVisiblePlots to prevent crashes on dangling QPointers.
…plots

New event filter class that selects a PDM item in the plot main window tree
when the user left-clicks near a curve on a Qwt plot canvas. Includes a
static closestPointIndex helper using axis-normalised distance with a 3%
threshold. Register the new files in CMakeLists_files.cmake.
Return a default-constructed RifDataSourceForRftPlt instead of dereferencing
a null m_eclCase for RFT_SIM_WELL_DATA and GRID_MODEL_CELL_DATA source types.
… and RftPlot

Replace the local CurveSelectorFilter inner class in RimParameterResultCrossPlot
with the shared RiuQwtCurveSelectorFilter, using a PdmPointer guard in the lambda.
Add findClosestCase helper to encapsulate the hit-test logic.

Wire up RiuQwtCurveSelectorFilter in RimWellRftPlot using a canvas property flag
to avoid duplicate installations across updateCurvesInPlot calls. Add
findClosestRealization using pixel-distance hit-testing on RimWellLogRftCurve.

Also expose selectedTimeSteps accessors, cleanupLegendCurves, and
selectedEnsembles on RimWellRftPlot, and update the plot name when the well
name changes in setSimWellOrWellPathName.
…rface

Skip RFT cells whose IJK indices exceed the main grid dimensions to prevent
out-of-bounds access in cellIndexFromIJK. For cells not intersected by the
well path, push infinity as the TVD estimate when the cell is invalid rather
than using its center, avoiding NaN/garbage geometry from inactive cells.
New classes:
- RimRftCorrelationReportPlot: composite plot showing an RFT well log track
  alongside a parameter cross-plot and a summary address selector sub-plot.
- RimParameterRftCrossPlot: cross-plot of ensemble parameters vs RFT-derived
  measured depth values, with click-to-select realization support.
- RicCreateRftCorrelationReportFeature: context menu command on RimWellRftPlot
  that creates a RimRftCorrelationReportPlot in the correlation plot collection.

Wire up the new types in RimCorrelationPlotCollection and
RimContextCommandBuilder, and register files in both CMakeLists.
When creating an RFT correlation report plot, set the ensemble parameter
to the first alphabetic numeric parameter so the cross plot has a
meaningful default instead of remaining empty.
Add m_useDepthRange boolean field (default off) that gates the depth
filter in createCaseData. When disabled, all pressure samples are used
regardless of depth. The min/max depth fields are read-only when unchecked,
and the axis label and auto plot title omit the depth range bracket.
…meter list

New class RimRftTornadoPlot computes Pearson correlation between all numeric
ensemble parameters and mean RFT pressure, renders as a horizontal bar chart
using RiuGroupedBarChartBuilder, and emits parameterSelected when a bar is
clicked. Features:
- Positive/negative/selected parameter bars in configurable colors (collapsed
  Colors group)
- Configurable bar label, axis title, and axis value font sizes
- Show absolute values with small negative axis margin to keep labels visible
- Top-N filter and sort by absolute value options

Wire RimRftTornadoPlot into RimRftCorrelationReportPlot as m_correlationPlot:
- Default layout: RFT plot left, tornado top-right, cross plot bottom-right
- Clicking a tornado bar updates the selected parameter highlight and reloads
  the cross plot
- syncTornadoInputsFromCrossPlot syncs ensemble, well, time step, and
  selected parameter before each tornado reload

Sort ensemble parameter dropdown in RimParameterRftCrossPlot by absolute
Pearson correlation descending when well and time step are available,
falling back to alphabetical order otherwise.
Removes ~120 lines of duplicated RFT pressure-per-case logic that
appeared identically in createCaseData, calculateValueOptions, and
RimRftTornadoPlot::addDataToChartBuilder.
- RicCreateRftCorrelationReportFeature: null-check the report returned by
  createRftCorrelationReportPlot() before use
- RimParameterRftCrossPlot: add comment documenting the fallback behaviour
  when depths remain empty after computeMeasuredDepth(), so the implicit
  "use all pressures" path is explicit
- RimRftCorrelationReportPlot: guard initializeFromSourcePlot() against
  creating duplicate WellLogTrack if called more than once
- RimRftTornadoPlot: remove redundant dynamic_cast on the return of
  QwtPlotBarChart::symbol(), which already has the correct static type
- RiuQwtCurveSelectorFilter: replace exact float equality (== 0.0) with
  epsilon guard (< 1e-14) for axis range zero-check
Use std::optional<std::pair<double,double>> for m_xValueRange and
m_yValueRange instead of infinity-initialised pairs. This makes the
'no data' state explicit and also fixes a latent bug where clearing
all data left stale axis ranges from the previous update, because the
early return in updateValueRanges() skipped the assignment.
parameterSelected signal replaced with a ParameterSelectedCallback
(std::function<void(const QString&)>) set via setParameterSelectedCallback().
Removes the CAF signal machinery and SignalEmitter dependency from both
the tornado plot and the report plot.
…taToChartBuilder

addDataToChartBuilder now returns std::map<QString,double> instead of
writing to a mutable member. onLoadDataAndUpdate captures the return
value into m_lastCorrelations; asciiDataForPlotExport discards it.
The member is now a plain (non-mutable) field.
… and named z-order

Add Z_HIGHLIGHTED_CURVE to ZIndex enum and replace all raw z-order integers with
named constants. Selected realization is shown in contrast color against the plot
background and raised above other curves. Reacts to both click-to-select in the
plot and selection changes in the Data Sources panel.
…values

Infinity TVD entries were passed to solveForX which produced garbage MD values.
Those values then corrupted the startMD search interval for subsequent valid entries
via the monotonic progression adjustment. Fix by skipping infinity entries in the
first pass (pushing a placeholder) and tracking only the last two valid MD values
for the startMD adjustment. The existing second pass already handles filling in the
correct linearly-interpolated MD values for infinity entries.
…on sub-plot toggle

- Call updateDockTitleBarsVisibility() after toggling a sub-plot so the
  Show Title Bars setting is honored for all open dock areas
- Call updateConnectedEditors() in onTornadoParameterSelected so the
  property panel reflects the new parameter selection
- Make splitter handle slightly wider and lighter (#a0a0a0) for better visibility
@magnesj magnesj force-pushed the rft-correlation-plot branch from 17f9470 to 1b2d2e2 Compare April 14, 2026 13:06
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.

change RFT plots to enable correlation plot on RFTs

1 participant