Make azimuth in WBS plots continous in most cases

This commit is contained in:
Gaute Lindkvist 2019-11-27 14:17:05 +01:00
parent e41cadfa02
commit ded7be1d73
2 changed files with 14 additions and 3 deletions

View File

@ -286,7 +286,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setVisibleXRange( 0.0, 2.5 );
stabilityCurvesTrack->setColSpan( RimPlot::FIVE );
stabilityCurvesTrack->setAutoScaleXEnabled( true );
stabilityCurvesTrack->setTickIntervals( 0.5, 0.05 );
stabilityCurvesTrack->setTickIntervals( 0.5, 0.1 );
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechCase );
@ -383,12 +383,12 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
{
minValue -= angleIncrement;
}
maxValue = cvf::Math::clamp( maxValue, angleIncrement, 360.0 );
maxValue = cvf::Math::clamp( maxValue, angleIncrement, 720.0 );
minValue = cvf::Math::clamp( minValue, 0.0, maxValue - 90.0 );
}
wellPathAnglesTrack->setColSpan( RimPlot::THREE );
wellPathAnglesTrack->setVisibleXRange( minValue, maxValue );
wellPathAnglesTrack->setTickIntervals( 90.0, 30.0 );
wellPathAnglesTrack->setTickIntervals( 180.0, 45.0 );
wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setFormationWellPath( wellPath );
wellPathAnglesTrack->setFormationCase( geoMechCase );

View File

@ -353,6 +353,7 @@ void RigGeoMechWellLogExtractor::wellPathAngles( const RigFemResultAddress& resA
const double epsilon = 1.0e-6 * 360;
const cvf::Vec3d trueNorth( 0.0, 1.0, 0.0 );
const cvf::Vec3d up( 0.0, 0.0, 1.0 );
double previousAzimuth = 0.0;
for ( int64_t intersectionIdx = 0; intersectionIdx < (int64_t)m_intersections.size(); ++intersectionIdx )
{
cvf::Vec3d wellPathTangent = calculateWellPathTangent( intersectionIdx, TangentFollowWellPathSegments );
@ -384,8 +385,18 @@ void RigGeoMechWellLogExtractor::wellPathAngles( const RigFemResultAddress& resA
azimuth = azimuth + 360.0;
}
}
// Make azimuth continuous in most cases
if ( azimuth - previousAzimuth > 300.0 )
{
azimuth -= 360.0;
}
else if ( previousAzimuth - azimuth > 300.0 )
{
azimuth += 360.0;
}
( *values )[intersectionIdx] = azimuth;
previousAzimuth = azimuth;
}
else
{