mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3512 System : Remove unused functions
This commit is contained in:
@@ -35,23 +35,6 @@
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Find the largest possible "ususal" value to use for absent data (-999.25, -9999.25, etc.)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
static double sg_createAbsentValue(double lowestDataValue)
|
||||
{
|
||||
double absentValue = -999.0;
|
||||
|
||||
while (absentValue > lowestDataValue)
|
||||
{
|
||||
absentValue *= 10;
|
||||
absentValue -= 9;
|
||||
}
|
||||
|
||||
return absentValue - 0.25;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -265,95 +248,6 @@ QString RigWellLogFile::wellLogChannelUnitString(const QString& wellLogChannelNa
|
||||
return unit;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellLogFile::exportToLasFile(const RimWellLogCurve* curve, const QString& fileName)
|
||||
{
|
||||
CVF_ASSERT(curve);
|
||||
|
||||
const RigWellLogCurveData* curveData = curve->curveData();
|
||||
if (!curveData)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double minX, maxX;
|
||||
curve->valueRange(&minX, &maxX);
|
||||
double absentValue = sg_createAbsentValue(minX);
|
||||
|
||||
std::vector<double> wellLogValues = curveData->xValues();
|
||||
for (size_t vIdx = 0; vIdx < wellLogValues.size(); vIdx++)
|
||||
{
|
||||
double value = wellLogValues[vIdx];
|
||||
if (value == HUGE_VAL || value == -HUGE_VAL || value != value)
|
||||
{
|
||||
wellLogValues[vIdx] = absentValue;
|
||||
}
|
||||
}
|
||||
|
||||
QString wellLogChannelName = curve->wellLogChannelName().trimmed();
|
||||
wellLogChannelName.replace(".", "_");
|
||||
|
||||
QString wellLogDate = curve->wellDate().trimmed();
|
||||
wellLogDate.replace(".", "_");
|
||||
wellLogDate.replace(" ", "_");
|
||||
|
||||
NRLib::LasWell lasFile;
|
||||
lasFile.addWellInfo("WELL", curve->wellName().trimmed().toStdString());
|
||||
lasFile.addWellInfo("DATE", wellLogDate.toStdString());
|
||||
|
||||
if (curveData->depthUnit() == RiaDefines::UNIT_METER)
|
||||
{
|
||||
lasFile.AddLog("DEPTH", "M", "Depth in meters", curveData->measuredDepths());
|
||||
}
|
||||
else if (curveData->depthUnit() == RiaDefines::UNIT_FEET)
|
||||
{
|
||||
lasFile.AddLog("DEPTH", "FT", "Depth in feet", curveData->measuredDepths());
|
||||
}
|
||||
else if (curveData->depthUnit() == RiaDefines::UNIT_NONE)
|
||||
{
|
||||
CVF_ASSERT(false);
|
||||
lasFile.AddLog("DEPTH", "", "Depth in connection number", curveData->measuredDepths());
|
||||
}
|
||||
|
||||
if(curveData->tvDepths().size())
|
||||
{
|
||||
lasFile.AddLog("TVDMSL", "M", "True vertical depth in meters", curveData->tvDepths());
|
||||
}
|
||||
|
||||
lasFile.AddLog(wellLogChannelName.trimmed().toStdString(), "NO_UNIT", "", wellLogValues);
|
||||
lasFile.SetMissing(absentValue);
|
||||
|
||||
double minDepth = 0.0;
|
||||
double maxDepth = 0.0;
|
||||
curveData->calculateMDRange(&minDepth, &maxDepth);
|
||||
|
||||
lasFile.setStartDepth(minDepth);
|
||||
lasFile.setStopDepth(maxDepth);
|
||||
|
||||
if (curveData->depthUnit() == RiaDefines::UNIT_METER)
|
||||
{
|
||||
lasFile.setDepthUnit("M");
|
||||
}
|
||||
else if (curveData->depthUnit() == RiaDefines::UNIT_FEET)
|
||||
{
|
||||
lasFile.setDepthUnit("FT");
|
||||
}
|
||||
else if ( curveData->depthUnit() == RiaDefines::UNIT_NONE )
|
||||
{
|
||||
CVF_ASSERT(false);
|
||||
lasFile.setDepthUnit("");
|
||||
}
|
||||
|
||||
lasFile.setVersionInfo("2.0");
|
||||
|
||||
std::vector<std::string> commentHeader;
|
||||
lasFile.WriteToFile(fileName.toStdString(), commentHeader);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user