mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-09 23:53:04 -06:00
(#541) Setting depth range for export from the curve's raw data, not the plot curve's data
This commit is contained in:
parent
2dd1e98f81
commit
3683dc95cd
@ -244,3 +244,39 @@ void RigWellLogCurveData::computeFilteredIntervals(const std::vector< std::pair<
|
||||
index += intervalSize;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellLogCurveData::depthRange(double* minimumDepth, double* maximumDepth) const
|
||||
{
|
||||
CVF_ASSERT(minimumDepth && maximumDepth);
|
||||
|
||||
double minValue = HUGE_VAL;
|
||||
double maxValue = -HUGE_VAL;
|
||||
|
||||
for (size_t vIdx = 0; vIdx < m_yValues.size(); vIdx++)
|
||||
{
|
||||
double value = m_yValues[vIdx];
|
||||
|
||||
if (value < minValue)
|
||||
{
|
||||
minValue = value;
|
||||
}
|
||||
|
||||
if (value > maxValue)
|
||||
{
|
||||
maxValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxValue >= minValue)
|
||||
{
|
||||
*minimumDepth = minValue;
|
||||
*maximumDepth = maxValue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
virtual ~RigWellLogCurveData();
|
||||
|
||||
void setPoints(const std::vector<double>& xValues, const std::vector<double>& yValues);
|
||||
bool depthRange(double* minimumDepth, double* maximumDepth) const;
|
||||
|
||||
const std::vector<double>& xValues() const;
|
||||
const std::vector<double>& yValues() const;
|
||||
|
@ -274,8 +274,9 @@ bool RigWellLogFile::exportToLasFile(const RimWellLogPlotCurve* curve, const QSt
|
||||
lasFile.AddLog(wellLogChannelName.toStdString(), "NO_UNIT", "", wellLogValues);
|
||||
lasFile.SetMissing(absentValue);
|
||||
|
||||
double minDepth, maxDepth;
|
||||
curve->depthRange(&minDepth, &maxDepth);
|
||||
double minDepth = 0.0;
|
||||
double maxDepth = 0.0;
|
||||
curveData->depthRange(&minDepth, &maxDepth);
|
||||
|
||||
lasFile.setStartDepth(minDepth);
|
||||
lasFile.setStopDepth(maxDepth);
|
||||
|
Loading…
Reference in New Issue
Block a user