mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6227 Filter out zero values in logarithmic plot.
This commit is contained in:
parent
55034759c5
commit
ad07b18781
@ -69,4 +69,10 @@ double defaultPermeability()
|
||||
{
|
||||
return 1.0e-5;
|
||||
}
|
||||
|
||||
double zeroReplacementForLogarithmicPlot()
|
||||
{
|
||||
return 1.0e-5;
|
||||
}
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -56,5 +56,6 @@ enum class CurveProperty
|
||||
|
||||
double defaultPorosity();
|
||||
double defaultPermeability();
|
||||
double zeroReplacementForLogarithmicPlot();
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -591,7 +591,7 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
m_explicitTickIntervals.uiCapability()->setUiHidden( m_isLogarithmicScaleEnabled() );
|
||||
|
||||
updateXZoom();
|
||||
m_plotWidget->scheduleReplot();
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay ||
|
||||
changedField == &m_formationSource || changedField == &m_colorShadingTransparency ||
|
||||
@ -2065,6 +2065,14 @@ void RimWellLogTrack::setLogarithmicScale( bool enable )
|
||||
computeAndSetXRangeMinForLogarithmicScale();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogTrack::isLogarithmicScale() const
|
||||
{
|
||||
return m_isLogarithmicScaleEnabled;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -190,6 +190,7 @@ public:
|
||||
caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const override;
|
||||
|
||||
void setLogarithmicScale( bool enable );
|
||||
bool isLogarithmicScale() const;
|
||||
|
||||
std::map<int, std::vector<RimWellLogCurve*>> visibleStackedCurves();
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "RimStimPlanModel.h"
|
||||
#include "RimStimPlanModelCalculator.h"
|
||||
#include "RimStimPlanModelPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
@ -158,6 +159,13 @@ void RimStimPlanModelCurve::performDataExtraction( bool* isUsingPseudoLength )
|
||||
bool performDataSmoothing = false;
|
||||
if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() )
|
||||
{
|
||||
RimWellLogTrack* track = nullptr;
|
||||
firstAncestorOfType( track );
|
||||
if ( track && track->isLogarithmicScale() )
|
||||
{
|
||||
filterInvalidValuesForLogarithmicScale( values );
|
||||
}
|
||||
|
||||
this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit, !performDataSmoothing, xUnits );
|
||||
}
|
||||
}
|
||||
@ -172,3 +180,17 @@ QString RimStimPlanModelCurve::createCurveAutoName()
|
||||
|
||||
return textWithLineFeed;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanModelCurve::filterInvalidValuesForLogarithmicScale( std::vector<double>& values )
|
||||
{
|
||||
for ( double& v : values )
|
||||
{
|
||||
if ( v <= 0.0 )
|
||||
{
|
||||
v = RiaDefines::zeroReplacementForLogarithmicPlot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,8 @@ protected:
|
||||
|
||||
QString createCurveAutoName();
|
||||
|
||||
static void filterInvalidValuesForLogarithmicScale( std::vector<double>& values );
|
||||
|
||||
caf::PdmPtrField<RimStimPlanModel*> m_stimPlanModel;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user