mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#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:
parent
36d2bb224c
commit
507c30b93f
@ -27,6 +27,7 @@
|
|||||||
#include "RimWellLogFile.h"
|
#include "RimWellLogFile.h"
|
||||||
#include "RimWellLogPlotTrack.h"
|
#include "RimWellLogPlotTrack.h"
|
||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
|
#include "RimWellLogExtractionCurveImpl.h"
|
||||||
|
|
||||||
#include "RiuWellLogTrackPlot.h"
|
#include "RiuWellLogTrackPlot.h"
|
||||||
#include "RiuWellLogPlotCurve.h"
|
#include "RiuWellLogPlotCurve.h"
|
||||||
@ -83,8 +84,20 @@ void RimWellLogFileCurve::updatePlotData()
|
|||||||
std::vector<double> depthValues = wellLogFile->depthValues();
|
std::vector<double> depthValues = wellLogFile->depthValues();
|
||||||
|
|
||||||
if (values.size() > 0 && depthValues.size() > 0)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||||
|
|
||||||
#define RIG_WELL_FOOTPERMETER 3.2808399
|
#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 (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());
|
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 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>();
|
return std::vector<double>();
|
||||||
|
Loading…
Reference in New Issue
Block a user