mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user