#880 LAS: Export of TVDRKB

This commit is contained in:
Magne Sjaastad
2016-09-23 10:07:15 +02:00
parent 120cc8b6dc
commit 8514664d06
4 changed files with 57 additions and 4 deletions

View File

@@ -634,3 +634,16 @@ QString RimWellLogExtractionCurve::caseName() const
return QString(); return QString();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogExtractionCurve::rkbDiff() const
{
if (m_wellPath && m_wellPath->wellPathGeometry())
{
return cvf::Math::abs(m_wellPath->wellPathGeometry()->m_measuredDepths[0] - m_wellPath->wellPathGeometry()->m_wellPathPoints[0].z());
}
return HUGE_VAL;
}

View File

@@ -51,6 +51,7 @@ public:
bool isEclipseCurve() const; bool isEclipseCurve() const;
QString caseName() const; QString caseName() const;
double rkbDiff() const;
protected: protected:
virtual QString createCurveAutoName(); virtual QString createCurveAutoName();

View File

@@ -90,7 +90,8 @@ class SingleLasFileMetaData
{ {
public: public:
SingleLasFileMetaData() SingleLasFileMetaData()
: m_minimumCurveValue(HUGE_VAL) : m_minimumCurveValue(HUGE_VAL),
m_rkbDiff(HUGE_VAL)
{ {
} }
@@ -109,10 +110,9 @@ public:
m_date = date; m_date = date;
} }
void setDepthValues(RimDefines::DepthUnitType depthUnit, const std::vector<double>& depthValues) void setRkbDiff(double rkbDiff)
{ {
m_depthUnit = depthUnit; m_rkbDiff = rkbDiff;
m_depthValues = depthValues;
} }
void addLogData(const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData) void addLogData(const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData)
@@ -197,6 +197,25 @@ public:
if (firstCurveData->tvDepths().size()) if (firstCurveData->tvDepths().size())
{ {
lasFile->AddLog("TVDMSL", "M", "True vertical depth in meters", firstCurveData->tvDepths()); lasFile->AddLog("TVDMSL", "M", "True vertical depth in meters", firstCurveData->tvDepths());
if (m_rkbDiff != HUGE_VAL)
{
// Export True Vertical Depth Rotary Kelly Bushing - TVDRKB
std::vector<double> tvdrkbValues = firstCurveData->tvDepths();
for (auto& value : tvdrkbValues)
{
value += m_rkbDiff;
}
if (firstCurveData->depthUnit() == RimDefines::UNIT_METER)
{
lasFile->AddLog("TVDRKB", "M", "True vertical depth (Rotary Kelly Bushing)", tvdrkbValues);
}
else if (firstCurveData->depthUnit() == RimDefines::UNIT_FEET)
{
lasFile->AddLog("TVDRKB", "FT", "True vertical depth (Rotary Kelly Bushing)", tvdrkbValues);
}
}
} }
double minDepth = 0.0; double minDepth = 0.0;
@@ -250,6 +269,7 @@ private:
QString m_wellName; QString m_wellName;
QString m_caseName; QString m_caseName;
QString m_date; QString m_date;
double m_rkbDiff;
RimDefines::DepthUnitType m_depthUnit; RimDefines::DepthUnitType m_depthUnit;
std::vector<double> m_depthValues; std::vector<double> m_depthValues;
@@ -382,6 +402,7 @@ void RigLasFileExporter::appendLasFileDescriptions(const std::vector<RimWellLogC
QString m_wellName; QString m_wellName;
QString m_caseName; QString m_caseName;
QString m_date; QString m_date;
double datumElevation;
}; };
std::vector<CurveCollectionDefinition> curveDefinitions; std::vector<CurveCollectionDefinition> curveDefinitions;
@@ -414,8 +435,11 @@ void RigLasFileExporter::appendLasFileDescriptions(const std::vector<RimWellLogC
for (auto curve : curves) for (auto curve : curves)
{ {
if (curveDef.isEqual(curve, caseNameFromCurve(curve))) if (curveDef.isEqual(curve, caseNameFromCurve(curve)))
{ {
singleLasFileMeta.setRkbDiff(rkbDiff(curve));
const RigWellLogCurveData* curveData = nullptr; const RigWellLogCurveData* curveData = nullptr;
if (m_isResampleActive) if (m_isResampleActive)
{ {
@@ -456,3 +480,17 @@ QString RigLasFileExporter::caseNameFromCurve(RimWellLogCurve* curve)
return caseName; return caseName;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigLasFileExporter::rkbDiff(RimWellLogCurve* curve)
{
RimWellLogExtractionCurve* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>(curve);
if (extractionCurve)
{
return extractionCurve->rkbDiff();
}
return HUGE_VAL;
}

View File

@@ -43,6 +43,7 @@ private:
void appendLasFileDescriptions(const std::vector<RimWellLogCurve*>& curves, void appendLasFileDescriptions(const std::vector<RimWellLogCurve*>& curves,
std::vector<SingleLasFileMetaData>* lasFileDescriptions); std::vector<SingleLasFileMetaData>* lasFileDescriptions);
QString caseNameFromCurve(RimWellLogCurve* curve); QString caseNameFromCurve(RimWellLogCurve* curve);
double rkbDiff(RimWellLogCurve* curve);
private: private:
std::vector<RimWellLogCurve*> m_curves; std::vector<RimWellLogCurve*> m_curves;