(#545) Handling "NULL"/absent values in LAS files

Converting to absent values to HUGE_VAL when reading from LAS file.
Splitting into multiple curves when plotting.
This commit is contained in:
Pål Hagen 2015-10-12 14:50:32 +02:00
parent 36d2bb224c
commit 507c30b93f
2 changed files with 29 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#include "RimWellLogFile.h"
#include "RimWellLogPlotTrack.h"
#include "RimWellLogPlot.h"
#include "RimWellLogExtractionCurveImpl.h"
#include "RiuWellLogTrackPlot.h"
#include "RiuWellLogPlotCurve.h"
@ -83,8 +84,20 @@ void RimWellLogFileCurve::updatePlotData()
std::vector<double> depthValues = wellLogFile->depthValues();
if (values.size() > 0 && depthValues.size() > 0)
{
m_plotCurve->setSamples(values.data(), depthValues.data(), (int)depthValues.size());
{
std::vector< std::pair<size_t, size_t> > valuesIntervals;
RimWellLogExtractionCurveImpl::validValuesIntervals(values, valuesIntervals);
std::vector<double> filteredValues;
std::vector<double> filteredDepths;
RimWellLogExtractionCurveImpl::addValuesFromIntervals(values, valuesIntervals, &filteredValues);
RimWellLogExtractionCurveImpl::addValuesFromIntervals(depthValues, valuesIntervals, &filteredDepths);
std::vector< std::pair<size_t, size_t> > fltrIntervals;
RimWellLogExtractionCurveImpl::filteredIntervals(valuesIntervals, &fltrIntervals);
m_plotCurve->setSamples(filteredValues.data(), filteredDepths.data(), (int)filteredDepths.size());
m_plotCurve->setPlotIntervals(fltrIntervals);
}
else
{

View File

@ -26,6 +26,7 @@
#include <QFileInfo>
#include <exception>
#include <cmath> // Needed for HUGE_VAL on Linux
#define RIG_WELL_FOOTPERMETER 3.2808399
@ -164,7 +165,7 @@ std::vector<double> RigWellLogFile::values(const QString& name) const
if (m_wellLogFile->HasContLog(name.toStdString()))
{
if (name == m_depthLogName && depthUnit().toUpper() == "F" || depthUnit().toUpper() == "FT")
if (name == m_depthLogName && (depthUnit().toUpper() == "F" || depthUnit().toUpper() == "FT"))
{
std::vector<double> footValues = m_wellLogFile->GetContLog(name.toStdString());
@ -179,7 +180,18 @@ std::vector<double> RigWellLogFile::values(const QString& name) const
return meterValues;
}
return m_wellLogFile->GetContLog(name.toStdString());
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
values[vIdx] = HUGE_VAL;
}
}
return values;
}
return std::vector<double>();