RFT Plot - make sure we handle feet vs. meters in well log type plots (#6551)

* Fix the meter <-> feet conversion (it was backwards)

* Make sure we refresh the plots after changing the depth axis unit

* Make sure formation overlays etc. also gets converted to correct depth unit (correct as in the same unit any loaded Eclipse Result case use)
This commit is contained in:
jonjenssen
2020-09-25 11:14:56 +02:00
committed by GitHub
parent 49be87e38a
commit 5c4498db9f
7 changed files with 163 additions and 19 deletions

View File

@@ -47,15 +47,24 @@ public:
static std::vector<FloatType> convertDepths( const std::vector<FloatType>& depthsIn,
RiaDefines::DepthUnitType unitsIn,
RiaDefines::DepthUnitType unitsOut );
static bool convertValues( const std::vector<FloatType>& tvdRKBs,
const std::vector<FloatType>& valuesIn,
std::vector<FloatType>* valuesOut,
const QString& unitsIn,
const QString& unitsOut );
static bool convertValues( std::vector<std::pair<FloatType, FloatType>>* measuredDepthsAndValues,
const QString& unitsIn,
const QString& unitsOut,
const RigWellPath* wellPath );
static std::vector<std::pair<FloatType, FloatType>>
convertDepths( const std::vector<std::pair<FloatType, FloatType>>& depthsIn,
RiaDefines::DepthUnitType unitsIn,
RiaDefines::DepthUnitType unitsOut );
static FloatType
convertDepth( FloatType depthIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut );
static bool convertValues( const std::vector<FloatType>& tvdRKBs,
const std::vector<FloatType>& valuesIn,
std::vector<FloatType>* valuesOut,
const QString& unitsIn,
const QString& unitsOut );
static bool convertValues( std::vector<std::pair<FloatType, FloatType>>* measuredDepthsAndValues,
const QString& unitsIn,
const QString& unitsOut,
const RigWellPath* wellPath );
static std::vector<FloatType> tvdRKBs( const std::vector<FloatType>& measuredDepths, const RigWellPath* wellPath );

View File

@@ -140,15 +140,64 @@ std::vector<FloatType> RiaWellLogUnitTools<FloatType>::convertDepths( const std:
{
if ( unitsOut == RiaDefines::DepthUnitType::UNIT_METER && unitsIn == RiaDefines::DepthUnitType::UNIT_FEET )
{
return multiply( depthsIn, RiaEclipseUnitTools::feetPerMeter() );
return multiply( depthsIn, RiaEclipseUnitTools::meterPerFeet() );
}
else if ( unitsOut == RiaDefines::DepthUnitType::UNIT_FEET && unitsIn == RiaDefines::DepthUnitType::UNIT_METER )
{
return multiply( depthsIn, RiaEclipseUnitTools::meterPerFeet() );
return multiply( depthsIn, RiaEclipseUnitTools::feetPerMeter() );
}
return depthsIn;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
template <typename FloatType>
FloatType RiaWellLogUnitTools<FloatType>::convertDepth( FloatType depthIn,
RiaDefines::DepthUnitType unitsIn,
RiaDefines::DepthUnitType unitsOut )
{
FloatType factor = 1.0;
if ( unitsOut == RiaDefines::DepthUnitType::UNIT_METER && unitsIn == RiaDefines::DepthUnitType::UNIT_FEET )
{
factor = RiaEclipseUnitTools::meterPerFeet();
}
else if ( unitsOut == RiaDefines::DepthUnitType::UNIT_FEET && unitsIn == RiaDefines::DepthUnitType::UNIT_METER )
{
factor = RiaEclipseUnitTools::feetPerMeter();
}
return depthIn * factor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
template <typename FloatType>
std::vector<std::pair<FloatType, FloatType>>
RiaWellLogUnitTools<FloatType>::convertDepths( const std::vector<std::pair<FloatType, FloatType>>& depthsIn,
RiaDefines::DepthUnitType unitsIn,
RiaDefines::DepthUnitType unitsOut )
{
std::vector<std::pair<FloatType, FloatType>> convertedDepths( depthsIn.size() );
double factor = 1.0;
if ( unitsOut == RiaDefines::DepthUnitType::UNIT_METER && unitsIn == RiaDefines::DepthUnitType::UNIT_FEET )
{
factor = RiaEclipseUnitTools::meterPerFeet();
}
else if ( unitsOut == RiaDefines::DepthUnitType::UNIT_FEET && unitsIn == RiaDefines::DepthUnitType::UNIT_METER )
{
factor = RiaEclipseUnitTools::feetPerMeter();
}
int i = 0;
for ( auto& p : depthsIn )
{
convertedDepths[i++] = std::make_pair( factor * p.first, factor * p.second );
}
return convertedDepths;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------