#821 Implemented a method to do resampling of the well log data. Untested.

This commit is contained in:
Jacob Støren 2016-09-14 16:33:07 +02:00
parent 0fc911e50b
commit 5e9308f7b3
2 changed files with 50 additions and 0 deletions

View File

@ -175,6 +175,55 @@ std::vector< std::pair<size_t, size_t> > RigWellLogCurveData::polylineStartStopI
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateReSampeledCurveData(double newMeasuredDepthStepSize)
{
std::vector<double> xValues;
std::vector<double> measuredDepths;
std::vector<double> tvDepths;
size_t segmentStartIdx = 0;
if(m_measuredDepths.size() > 0)
{
double currentMd = m_measuredDepths[0];
while(segmentStartIdx < m_measuredDepths.size() - 1)
{
double segmentStartMd = m_measuredDepths[segmentStartIdx];
double segmentEndMd = m_measuredDepths[segmentStartIdx + 1];
double segmentStartX = m_xValues[segmentStartIdx];
double segmentEndX = m_xValues[segmentStartIdx +1];
double segmentStartTvd = tvDepths[segmentStartIdx];
double segmentEndTvd = tvDepths[segmentStartIdx +1];
while(currentMd <= segmentEndMd)
{
measuredDepths.push_back(currentMd);
double endWeight = (currentMd - segmentStartMd)/ (segmentEndMd - segmentStartMd);
xValues.push_back((1.0-endWeight) * segmentStartX + endWeight*segmentEndX);
// The tvd calculation is a simplification. We should use the wellpath, as it might have a better resolution, and have a none-linear shape
// This is much simpler, and possibly accurate enough ?
tvDepths.push_back((1.0-endWeight) * segmentStartTvd + endWeight*segmentEndTvd);
currentMd += newMeasuredDepthStepSize;
}
segmentStartIdx++;
}
}
cvf::ref<RigWellLogCurveData> reSampledData = new RigWellLogCurveData;
reSampledData->setValuesWithTVD(xValues, measuredDepths, tvDepths, m_depthUnit);
return reSampledData;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -59,6 +59,7 @@ public:
std::vector<double> measuredDepthPlotValues(RimDefines::DepthUnitType destinationDepthUnit) const;
std::vector< std::pair<size_t, size_t> > polylineStartStopIndices() const;
cvf::ref<RigWellLogCurveData> calculateReSampeledCurveData(double newMeasuredDepthStepSize);
private:
void calculateIntervalsOfContinousValidValues();