mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-29 08:30:17 -05:00
Extract RFT cross plot static helpers into RimRftCrossPlotTools, add unit tests
- Move depthTypeAbbreviation(), computePressureSamplesPerCase() and computeMeanPressurePerCase() out of RimParameterRftCrossPlot into a new standalone RimRftCrossPlotTools namespace, shared by RimParameterRftCrossPlot and RimRftTornadoPlot (removing duplicated code in the latter). - Extract pure, reader-independent helpers filterPressuresByDepthRange() and computeMean() so the depth filtering and averaging logic can be unit tested without RFT reader/ensemble mocks. - Add RimRftCrossPlotTools-Test.cpp with gtest cases covering depth range filtering (disabled, inclusive bounds, out-of-range, mismatched sizes) and mean computation (empty/normal), plus depth type abbreviation. Move RimWellLogRftCurve::rftCurveDepthValues into RimRftCrossPlotTools This static helper's only caller was already RimRftCrossPlotTools::computePressureSamplesPerCase, so move it alongside the other RFT cross plot/tornado plot helpers for consistency.
This commit is contained in:
1 parent
9791aaf52a
commit
b35b481ff1
10 files changed
+424
-239
No files matched your search
@@ -1220,32 +1220,6 @@ std::vector<double> RimWellLogRftCurve::measuredDepthValues( QString& prefixText
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimWellLogRftCurve::rftCurveDepthValues( RifReaderRftInterface* reader,
|
||||
const QString& wellName,
|
||||
const QDateTime& timeStep,
|
||||
RigEclipseWellLogExtractor* extractor,
|
||||
RiaDefines::DepthType depthType )
|
||||
{
|
||||
if ( !reader ) return {};
|
||||
|
||||
if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
auto tvdAddress = RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
|
||||
std::vector<double> tvdDepths;
|
||||
reader->values( tvdAddress, &tvdDepths );
|
||||
return tvdDepths;
|
||||
}
|
||||
|
||||
auto mdAddress = RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD );
|
||||
std::vector<double> depths;
|
||||
reader->values( mdAddress, &depths );
|
||||
if ( depths.empty() && extractor ) depths = reader->computeMeasuredDepth( wellName, timeStep, extractor );
|
||||
return depths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user