mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 14:03:18 -06:00
For property Beta, low values are high (max, P10) case and high values are low (min, P90) case. Calculation of statistical Beta values now uses inverted logic. Fixes #8232.
This commit is contained in:
parent
0c25794518
commit
7747f822bc
@ -446,6 +446,10 @@ std::vector<QString> RimEnsembleFractureStatistics::computeStatistics()
|
|||||||
std::shared_ptr<RigSlice2D> distanceGrid = std::make_shared<RigSlice2D>( gridXs.size(), gridYs.size() );
|
std::shared_ptr<RigSlice2D> distanceGrid = std::make_shared<RigSlice2D>( gridXs.size(), gridYs.size() );
|
||||||
sampleAllGrids( fractureGrids, gridXs, gridYs, samples, areaGrid, distanceGrid );
|
sampleAllGrids( fractureGrids, gridXs, gridYs, samples, areaGrid, distanceGrid );
|
||||||
|
|
||||||
|
// Beta should be reported inverted: low values are high, high values are low.
|
||||||
|
bool swapLowAndHigh = result.first.contains( "BETA", Qt::CaseInsensitive );
|
||||||
|
if ( swapLowAndHigh ) RiaLogging::info( QString( "Inverting statistics for: %1" ).arg( result.first ) );
|
||||||
|
|
||||||
std::map<RimEnsembleFractureStatistics::StatisticsType, std::shared_ptr<RigSlice2D>> statisticsGrids;
|
std::map<RimEnsembleFractureStatistics::StatisticsType, std::shared_ptr<RigSlice2D>> statisticsGrids;
|
||||||
generateStatisticsGrids( samples,
|
generateStatisticsGrids( samples,
|
||||||
gridXs.size(),
|
gridXs.size(),
|
||||||
@ -455,7 +459,8 @@ std::vector<QString> RimEnsembleFractureStatistics::computeStatistics()
|
|||||||
selectedStatistics,
|
selectedStatistics,
|
||||||
areaHistogramData,
|
areaHistogramData,
|
||||||
areaGrid,
|
areaGrid,
|
||||||
distanceGrid );
|
distanceGrid,
|
||||||
|
swapLowAndHigh );
|
||||||
|
|
||||||
for ( auto [statType, slice] : statisticsGrids )
|
for ( auto [statType, slice] : statisticsGrids )
|
||||||
{
|
{
|
||||||
@ -1138,7 +1143,8 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids(
|
|||||||
const std::vector<caf::AppEnum<RimEnsembleFractureStatistics::StatisticsType>>& statisticsTypes,
|
const std::vector<caf::AppEnum<RimEnsembleFractureStatistics::StatisticsType>>& statisticsTypes,
|
||||||
const RigHistogramData& areaHistogram,
|
const RigHistogramData& areaHistogram,
|
||||||
std::shared_ptr<RigSlice2D> areaGrid,
|
std::shared_ptr<RigSlice2D> areaGrid,
|
||||||
std::shared_ptr<RigSlice2D> distanceGrid )
|
std::shared_ptr<RigSlice2D> distanceGrid,
|
||||||
|
bool swapLowAndHigh )
|
||||||
{
|
{
|
||||||
for ( auto t : statisticsTypes )
|
for ( auto t : statisticsTypes )
|
||||||
{
|
{
|
||||||
@ -1193,6 +1199,8 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids(
|
|||||||
double dev;
|
double dev;
|
||||||
RigStatisticsMath::calculateBasicStatistics( values, &min, &max, &sum, &range, &mean, &dev );
|
RigStatisticsMath::calculateBasicStatistics( values, &min, &max, &sum, &range, &mean, &dev );
|
||||||
|
|
||||||
|
if ( swapLowAndHigh ) std::swap( min, max );
|
||||||
|
|
||||||
if ( calculateMean )
|
if ( calculateMean )
|
||||||
setValueNoInf( statisticsGrids[RimEnsembleFractureStatistics::StatisticsType::MEAN], x, y, mean );
|
setValueNoInf( statisticsGrids[RimEnsembleFractureStatistics::StatisticsType::MEAN], x, y, mean );
|
||||||
|
|
||||||
@ -1216,6 +1224,8 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids(
|
|||||||
&mean,
|
&mean,
|
||||||
RigStatisticsMath::PercentileStyle::SWITCHED );
|
RigStatisticsMath::PercentileStyle::SWITCHED );
|
||||||
|
|
||||||
|
if ( swapLowAndHigh ) std::swap( p10, p90 );
|
||||||
|
|
||||||
if ( calculateP10 )
|
if ( calculateP10 )
|
||||||
setValueNoInf( statisticsGrids[RimEnsembleFractureStatistics::StatisticsType::P10], x, y, p10 );
|
setValueNoInf( statisticsGrids[RimEnsembleFractureStatistics::StatisticsType::P10], x, y, p10 );
|
||||||
|
|
||||||
|
@ -197,7 +197,8 @@ protected:
|
|||||||
const std::vector<caf::AppEnum<RimEnsembleFractureStatistics::StatisticsType>>& statisticsTypes,
|
const std::vector<caf::AppEnum<RimEnsembleFractureStatistics::StatisticsType>>& statisticsTypes,
|
||||||
const RigHistogramData& areaHistogram,
|
const RigHistogramData& areaHistogram,
|
||||||
std::shared_ptr<RigSlice2D> areaGrid,
|
std::shared_ptr<RigSlice2D> areaGrid,
|
||||||
std::shared_ptr<RigSlice2D> distanceGrid );
|
std::shared_ptr<RigSlice2D> distanceGrid,
|
||||||
|
bool highIsLow );
|
||||||
|
|
||||||
static bool writeStatisticsToCsv( const QString& filePath, const RigSlice2D& samples );
|
static bool writeStatisticsToCsv( const QString& filePath, const RigSlice2D& samples );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user