mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-10 08:03:05 -06:00
(#538) Support both meter and feet in LAS export
This commit is contained in:
parent
d18e8f7bd3
commit
de14b93f6b
@ -30,8 +30,6 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||||
|
|
||||||
#define RIG_WELL_FOOTPERMETER 3.2808399
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Find the largest possible "ususal" value to use for absent data (-999.25, -9999.25, etc.)
|
/// Find the largest possible "ususal" value to use for absent data (-999.25, -9999.25, etc.)
|
||||||
@ -172,33 +170,18 @@ std::vector<double> RigWellLogFile::values(const QString& name) const
|
|||||||
|
|
||||||
if (m_wellLogFile->HasContLog(name.toStdString()))
|
if (m_wellLogFile->HasContLog(name.toStdString()))
|
||||||
{
|
{
|
||||||
if (name == m_depthLogName && (depthUnitString().toUpper() == "F" || depthUnitString().toUpper() == "FT"))
|
std::vector<double> logValues = m_wellLogFile->GetContLog(name.toStdString());
|
||||||
|
|
||||||
|
for (size_t vIdx = 0; vIdx < logValues.size(); vIdx++)
|
||||||
{
|
{
|
||||||
std::vector<double> footValues = m_wellLogFile->GetContLog(name.toStdString());
|
if (m_wellLogFile->IsMissing(logValues[vIdx]))
|
||||||
|
|
||||||
std::vector<double> meterValues;
|
|
||||||
meterValues.reserve(footValues.size());
|
|
||||||
|
|
||||||
for (size_t vIdx = 0; vIdx < footValues.size(); vIdx++)
|
|
||||||
{
|
|
||||||
meterValues.push_back(footValues[vIdx]/RIG_WELL_FOOTPERMETER);
|
|
||||||
}
|
|
||||||
|
|
||||||
return meterValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<double> values = m_wellLogFile->GetContLog(name.toStdString());
|
|
||||||
|
|
||||||
for (size_t vIdx = 0; vIdx < values.size(); vIdx++)
|
|
||||||
{
|
|
||||||
if (m_wellLogFile->IsMissing(values[vIdx]))
|
|
||||||
{
|
{
|
||||||
// Convert missing ("NULL") values to HUGE_VAL
|
// Convert missing ("NULL") values to HUGE_VAL
|
||||||
values[vIdx] = HUGE_VAL;
|
logValues[vIdx] = HUGE_VAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return values;
|
return logValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::vector<double>();
|
return std::vector<double>();
|
||||||
@ -279,7 +262,16 @@ bool RigWellLogFile::exportToLasFile(const RimWellLogCurve* curve, const QString
|
|||||||
NRLib::LasWell lasFile;
|
NRLib::LasWell lasFile;
|
||||||
lasFile.addWellInfo("WELL", curve->wellName().trimmed().toStdString());
|
lasFile.addWellInfo("WELL", curve->wellName().trimmed().toStdString());
|
||||||
lasFile.addWellInfo("DATE", wellLogDate.toStdString());
|
lasFile.addWellInfo("DATE", wellLogDate.toStdString());
|
||||||
|
|
||||||
|
if (curveData->depthUnit() == RimDefines::UNIT_METER)
|
||||||
|
{
|
||||||
lasFile.AddLog("DEPTH", "M", "Depth in meters", curveData->measuredDepths());
|
lasFile.AddLog("DEPTH", "M", "Depth in meters", curveData->measuredDepths());
|
||||||
|
}
|
||||||
|
else if (curveData->depthUnit() == RimDefines::UNIT_FEET)
|
||||||
|
{
|
||||||
|
lasFile.AddLog("DEPTH", "FT", "Depth in feet", curveData->measuredDepths());
|
||||||
|
}
|
||||||
|
|
||||||
lasFile.AddLog(wellLogChannelName.trimmed().toStdString(), "NO_UNIT", "", wellLogValues);
|
lasFile.AddLog(wellLogChannelName.trimmed().toStdString(), "NO_UNIT", "", wellLogValues);
|
||||||
lasFile.SetMissing(absentValue);
|
lasFile.SetMissing(absentValue);
|
||||||
|
|
||||||
@ -289,7 +281,15 @@ bool RigWellLogFile::exportToLasFile(const RimWellLogCurve* curve, const QString
|
|||||||
|
|
||||||
lasFile.setStartDepth(minDepth);
|
lasFile.setStartDepth(minDepth);
|
||||||
lasFile.setStopDepth(maxDepth);
|
lasFile.setStopDepth(maxDepth);
|
||||||
|
|
||||||
|
if (curveData->depthUnit() == RimDefines::UNIT_METER)
|
||||||
|
{
|
||||||
lasFile.setDepthUnit("M");
|
lasFile.setDepthUnit("M");
|
||||||
|
}
|
||||||
|
else if (curveData->depthUnit() == RimDefines::UNIT_FEET)
|
||||||
|
{
|
||||||
|
lasFile.setDepthUnit("FT");
|
||||||
|
}
|
||||||
|
|
||||||
lasFile.setVersionInfo("2.0");
|
lasFile.setVersionInfo("2.0");
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ public:
|
|||||||
std::vector<double> depthValues() const;
|
std::vector<double> depthValues() const;
|
||||||
std::vector<double> values(const QString& name) const;
|
std::vector<double> values(const QString& name) const;
|
||||||
|
|
||||||
QString depthUnitString() const;
|
|
||||||
QString wellLogChannelUnitString(const QString& wellLogChannelName) const;
|
QString wellLogChannelUnitString(const QString& wellLogChannelName) const;
|
||||||
RimDefines::DepthUnitType depthUnit() const;
|
RimDefines::DepthUnitType depthUnit() const;
|
||||||
|
|
||||||
@ -59,6 +58,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void close();
|
void close();
|
||||||
|
QString depthUnitString() const;
|
||||||
|
|
||||||
NRLib::Well* m_wellLogFile;
|
NRLib::Well* m_wellLogFile;
|
||||||
QStringList m_wellLogChannelNames;
|
QStringList m_wellLogChannelNames;
|
||||||
|
Loading…
Reference in New Issue
Block a user