mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve ensemble cross plot statistics
* Support cross plot in plot templates * Fix source stepping for cross plots * Show cross plot data in "Show Plot Data" * Use bin size and realization count when computing cross plot statistics
This commit is contained in:
parent
0ccddcb836
commit
d34bb8a64c
@ -68,7 +68,7 @@ void RicSplitMultiPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
for ( auto curveSet : plot->curveSets() )
|
for ( auto curveSet : plot->curveSets() )
|
||||||
{
|
{
|
||||||
RimSummaryAddress* addr = RimSummaryAddress::wrapFileReaderAddress( curveSet->summaryAddress() );
|
RimSummaryAddress* addr = RimSummaryAddress::wrapFileReaderAddress( curveSet->summaryAddressY() );
|
||||||
addr->setEnsembleId( curveSet->ensembleId() );
|
addr->setEnsembleId( curveSet->ensembleId() );
|
||||||
objects.push_back( addr );
|
objects.push_back( addr );
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ RimEnsembleCurveSet* RicSummaryPlotBuilder::createCurveSet( RimSummaryCaseCollec
|
|||||||
auto curveSet = new RimEnsembleCurveSet();
|
auto curveSet = new RimEnsembleCurveSet();
|
||||||
|
|
||||||
curveSet->setSummaryCaseCollection( ensemble );
|
curveSet->setSummaryCaseCollection( ensemble );
|
||||||
curveSet->setSummaryAddressAndStatisticsFlag( addr );
|
curveSet->setSummaryAddressYAndStatisticsFlag( addr );
|
||||||
|
|
||||||
return curveSet;
|
return curveSet;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl
|
|||||||
ensembleReferenceStrings.insert( reference );
|
ensembleReferenceStrings.insert( reference );
|
||||||
}
|
}
|
||||||
|
|
||||||
addresses.push_back( curveSet->summaryAddress() );
|
addresses.push_back( curveSet->summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
replaceStrings( ensembleReferenceStrings,
|
replaceStrings( ensembleReferenceStrings,
|
||||||
|
@ -320,11 +320,16 @@ void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryPlot*
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace placeholders with object names from selection
|
// Replace placeholders with object names from selection
|
||||||
auto curveAdr = curveSet->summaryAddress();
|
auto adr = curveSet->curveAddress();
|
||||||
setPlaceholderWellName( &curveAdr, wellNames );
|
auto curveAdrY = adr.summaryAddressY();
|
||||||
setPlaceholderGroupName( &curveAdr, groupNames );
|
setPlaceholderWellName( &curveAdrY, wellNames );
|
||||||
setPlaceholderRegion( &curveAdr, regions );
|
setPlaceholderGroupName( &curveAdrY, groupNames );
|
||||||
curveSet->setSummaryAddressAndStatisticsFlag( curveAdr );
|
setPlaceholderRegion( &curveAdrY, regions );
|
||||||
|
auto curveAdrX = adr.summaryAddressX();
|
||||||
|
setPlaceholderWellName( &curveAdrX, wellNames );
|
||||||
|
setPlaceholderGroupName( &curveAdrX, groupNames );
|
||||||
|
setPlaceholderRegion( &curveAdrX, regions );
|
||||||
|
curveSet->setCurveAddress( RiaSummaryCurveAddress( curveAdrX, curveAdrY ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ void RicNewEnsembleCurveFilterFeature::onActionTriggered( bool isChecked )
|
|||||||
{
|
{
|
||||||
std::vector<RifEclipseSummaryAddress> addresses;
|
std::vector<RifEclipseSummaryAddress> addresses;
|
||||||
|
|
||||||
auto candidateAdr = newFilter->parentCurveSet()->summaryAddress();
|
auto candidateAdr = newFilter->parentCurveSet()->summaryAddressY();
|
||||||
auto nativeQuantityName = RimObjectiveFunctionTools::nativeQuantityName( candidateAdr.vectorName() );
|
auto nativeQuantityName = RimObjectiveFunctionTools::nativeQuantityName( candidateAdr.vectorName() );
|
||||||
candidateAdr.setVectorName( nativeQuantityName );
|
candidateAdr.setVectorName( nativeQuantityName );
|
||||||
addresses.push_back( candidateAdr );
|
addresses.push_back( candidateAdr );
|
||||||
|
@ -89,7 +89,7 @@ std::vector<RimEnsembleCurveSet*> RicNewSummaryEnsembleCurveSetFeature::addDefau
|
|||||||
RimEnsembleCurveSetColorManager::cycledEnsembleColorRange( static_cast<int>( colorIndex ) ) ) );
|
RimEnsembleCurveSetColorManager::cycledEnsembleColorRange( static_cast<int>( colorIndex ) ) ) );
|
||||||
|
|
||||||
curveSet->setSummaryCaseCollection( ensemble );
|
curveSet->setSummaryCaseCollection( ensemble );
|
||||||
curveSet->setSummaryAddressAndStatisticsFlag( addr );
|
curveSet->setSummaryAddressYAndStatisticsFlag( addr );
|
||||||
auto filter = curveSet->filterCollection()->addFilter();
|
auto filter = curveSet->filterCollection()->addFilter();
|
||||||
filter->setActive( false );
|
filter->setActive( false );
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection()
|
|||||||
for ( const auto& curveSet : currentCurveSetsInPreviewPlot )
|
for ( const auto& curveSet : currentCurveSetsInPreviewPlot )
|
||||||
{
|
{
|
||||||
RimSummaryCaseCollection* ensemble = curveSet->summaryCaseCollection();
|
RimSummaryCaseCollection* ensemble = curveSet->summaryCaseCollection();
|
||||||
currentCurveSetDefs.insert( RiaCurveSetDefinition( ensemble, curveSet->summaryAddress() ) );
|
currentCurveSetDefs.insert( RiaCurveSetDefinition( ensemble, curveSet->summaryAddressY() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( allCurveSetDefinitions.size() < currentCurveSetsInPreviewPlot.size() )
|
if ( allCurveSetDefinitions.size() < currentCurveSetsInPreviewPlot.size() )
|
||||||
@ -428,7 +428,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection()
|
|||||||
for ( const auto& curveSet : currentCurveSetsInPreviewPlot )
|
for ( const auto& curveSet : currentCurveSetsInPreviewPlot )
|
||||||
{
|
{
|
||||||
RimSummaryCaseCollection* ensemble = curveSet->summaryCaseCollection();
|
RimSummaryCaseCollection* ensemble = curveSet->summaryCaseCollection();
|
||||||
RiaCurveSetDefinition curveSetDef = RiaCurveSetDefinition( ensemble, curveSet->summaryAddress() );
|
RiaCurveSetDefinition curveSetDef = RiaCurveSetDefinition( ensemble, curveSet->summaryAddressY() );
|
||||||
if ( deleteCurveSetDefs.count( curveSetDef ) > 0 ) curveSetsToDelete.insert( curveSet );
|
if ( deleteCurveSetDefs.count( curveSetDef ) > 0 ) curveSetsToDelete.insert( curveSet );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -489,7 +489,7 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
|
|||||||
RimEnsembleCurveSet* curveSet = nullptr;
|
RimEnsembleCurveSet* curveSet = nullptr;
|
||||||
for ( const auto& cs : m_previewPlot->ensembleCurveSetCollection()->curveSets() )
|
for ( const auto& cs : m_previewPlot->ensembleCurveSetCollection()->curveSets() )
|
||||||
{
|
{
|
||||||
if ( cs->summaryCaseCollection() == curveDef.ensemble() && cs->summaryAddress() == curveDef.summaryAddressY() )
|
if ( cs->summaryCaseCollection() == curveDef.ensemble() && cs->summaryAddressY() == curveDef.summaryAddressY() )
|
||||||
{
|
{
|
||||||
curveSet = cs;
|
curveSet = cs;
|
||||||
break;
|
break;
|
||||||
@ -503,7 +503,7 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
|
|||||||
|
|
||||||
// Do not call setSummaryAddressAndStatisticsFlag() here, as the call to m_statistics->updateAllRequiredEditors(); causes a
|
// Do not call setSummaryAddressAndStatisticsFlag() here, as the call to m_statistics->updateAllRequiredEditors(); causes a
|
||||||
// crash in updateUiOrdering. The statistics curves will be created when the curve set is added to the plot.
|
// crash in updateUiOrdering. The statistics curves will be created when the curve set is added to the plot.
|
||||||
curveSet->setSummaryAddress( curveDef.summaryAddressY() );
|
curveSet->setSummaryAddressY( curveDef.summaryAddressY() );
|
||||||
|
|
||||||
// Set single curve set color
|
// Set single curve set color
|
||||||
auto allCurveSets = m_previewPlot->ensembleCurveSetCollection()->curveSets();
|
auto allCurveSets = m_previewPlot->ensembleCurveSetCollection()->curveSets();
|
||||||
@ -644,7 +644,7 @@ void RicSummaryPlotEditorUi::populateCurveCreator( const RimSummaryPlot& sourceS
|
|||||||
previewCurveSetColl->addCurveSet( newCurveSet );
|
previewCurveSetColl->addCurveSet( newCurveSet );
|
||||||
|
|
||||||
RimSummaryCaseCollection* ensemble = curveSet->summaryCaseCollection();
|
RimSummaryCaseCollection* ensemble = curveSet->summaryCaseCollection();
|
||||||
curveDefs.emplace_back( ensemble, curveSet->summaryAddress() );
|
curveDefs.emplace_back( ensemble, curveSet->summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_previewPlot->copyAxisPropertiesFromOther( sourceSummaryPlot );
|
m_previewPlot->copyAxisPropertiesFromOther( sourceSummaryPlot );
|
||||||
@ -958,12 +958,12 @@ void RicSummaryPlotEditorUi::setInitialCurveVisibility( const RimSummaryPlot* ta
|
|||||||
std::set<std::pair<RimSummaryCaseCollection*, RifEclipseSummaryAddress>> sourceCurveSetDefs;
|
std::set<std::pair<RimSummaryCaseCollection*, RifEclipseSummaryAddress>> sourceCurveSetDefs;
|
||||||
for ( const auto& curveSet : targetPlot->ensembleCurveSetCollection()->curveSets() )
|
for ( const auto& curveSet : targetPlot->ensembleCurveSetCollection()->curveSets() )
|
||||||
{
|
{
|
||||||
sourceCurveSetDefs.insert( std::make_pair( curveSet->summaryCaseCollection(), curveSet->summaryAddress() ) );
|
sourceCurveSetDefs.insert( std::make_pair( curveSet->summaryCaseCollection(), curveSet->summaryAddressY() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( const auto& curveSet : m_previewPlot->ensembleCurveSetCollection()->curveSets() )
|
for ( const auto& curveSet : m_previewPlot->ensembleCurveSetCollection()->curveSets() )
|
||||||
{
|
{
|
||||||
auto curveDef = std::make_pair( curveSet->summaryCaseCollection(), curveSet->summaryAddress() );
|
auto curveDef = std::make_pair( curveSet->summaryCaseCollection(), curveSet->summaryAddressY() );
|
||||||
if ( sourceCurveSetDefs.count( curveDef ) == 0 )
|
if ( sourceCurveSetDefs.count( curveDef ) == 0 )
|
||||||
{
|
{
|
||||||
curveSet->showCurves( false );
|
curveSet->showCurves( false );
|
||||||
|
@ -553,7 +553,7 @@ RimEnsembleCurveSet* RicSummaryPlotFeatureImpl::createCurveSet( RimSummaryCaseCo
|
|||||||
auto curveSet = new RimEnsembleCurveSet();
|
auto curveSet = new RimEnsembleCurveSet();
|
||||||
|
|
||||||
curveSet->setSummaryCaseCollection( ensemble );
|
curveSet->setSummaryCaseCollection( ensemble );
|
||||||
curveSet->setSummaryAddressAndStatisticsFlag( addr );
|
curveSet->setSummaryAddressYAndStatisticsFlag( addr );
|
||||||
|
|
||||||
if ( ensembleColoringStyle == EnsembleColoringType::PARAMETER || ensembleColoringStyle == EnsembleColoringType::LOG_PARAMETER )
|
if ( ensembleColoringStyle == EnsembleColoringType::PARAMETER || ensembleColoringStyle == EnsembleColoringType::LOG_PARAMETER )
|
||||||
{
|
{
|
||||||
|
@ -31,13 +31,6 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RimEnsembleCrossPlotStatisticsCase::RimEnsembleCrossPlotStatisticsCase()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -113,7 +106,7 @@ void RimEnsembleCrossPlotStatisticsCase::calculate( const std::vector<RimSummary
|
|||||||
const RifEclipseSummaryAddress& inputAddressY,
|
const RifEclipseSummaryAddress& inputAddressY,
|
||||||
bool includeIncompleteCurves,
|
bool includeIncompleteCurves,
|
||||||
int binCount,
|
int binCount,
|
||||||
int sampleCountThreshold )
|
int realizationCountThreshold )
|
||||||
{
|
{
|
||||||
if ( !inputAddressX.isValid() || !inputAddressY.isValid() ) return;
|
if ( !inputAddressX.isValid() || !inputAddressY.isValid() ) return;
|
||||||
if ( sumCases.empty() ) return;
|
if ( sumCases.empty() ) return;
|
||||||
@ -126,13 +119,22 @@ void RimEnsembleCrossPlotStatisticsCase::calculate( const std::vector<RimSummary
|
|||||||
m_adrX = inputAddressX;
|
m_adrX = inputAddressX;
|
||||||
m_adrY = inputAddressY;
|
m_adrY = inputAddressY;
|
||||||
|
|
||||||
std::vector<std::pair<double, double>> pairs;
|
struct SampleData
|
||||||
|
{
|
||||||
|
double xValue;
|
||||||
|
double yValue;
|
||||||
|
int realizationId;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<SampleData> sampleData;
|
||||||
|
|
||||||
auto [minTimeStep, maxTimeStep] = RimEnsembleStatisticsCase::findMinMaxTimeStep( sumCases, inputAddressX );
|
auto [minTimeStep, maxTimeStep] = RimEnsembleStatisticsCase::findMinMaxTimeStep( sumCases, inputAddressX );
|
||||||
RiaDefines::DateTimePeriod period = RimEnsembleStatisticsCase::findBestResamplingPeriod( minTimeStep, maxTimeStep );
|
RiaDefines::DateTimePeriod period = RimEnsembleStatisticsCase::findBestResamplingPeriod( minTimeStep, maxTimeStep );
|
||||||
|
|
||||||
for ( const auto& sumCase : sumCases )
|
for ( const auto& sumCase : sumCases )
|
||||||
{
|
{
|
||||||
|
int realizationId = sumCase->caseId();
|
||||||
|
|
||||||
const auto& reader = sumCase->summaryReader();
|
const auto& reader = sumCase->summaryReader();
|
||||||
if ( reader )
|
if ( reader )
|
||||||
{
|
{
|
||||||
@ -155,52 +157,72 @@ void RimEnsembleCrossPlotStatisticsCase::calculate( const std::vector<RimSummary
|
|||||||
auto [resampledTimeStepsY, resampledValuesY] =
|
auto [resampledTimeStepsY, resampledValuesY] =
|
||||||
RiaSummaryTools::resampledValuesForPeriod( inputAddressY, timeSteps, valuesY, period );
|
RiaSummaryTools::resampledValuesForPeriod( inputAddressY, timeSteps, valuesY, period );
|
||||||
|
|
||||||
size_t minimumCount = std::min( resampledValuesX.size(), resampledValuesY.size() );
|
size_t upperLimit = std::min( resampledValuesX.size(), resampledValuesY.size() );
|
||||||
|
|
||||||
for ( size_t i = 0; i < minimumCount; i++ )
|
for ( size_t i = 0; i < upperLimit; i++ )
|
||||||
{
|
{
|
||||||
pairs.emplace_back( std::make_pair( resampledValuesX[i], resampledValuesY[i] ) );
|
sampleData.push_back( { .xValue = resampledValuesX[i], .yValue = resampledValuesY[i], .realizationId = realizationId } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( sampleData.empty() ) return;
|
||||||
|
|
||||||
// Sort on X values
|
// Sort on X values
|
||||||
std::sort( pairs.begin(), pairs.end(), []( const auto& lhs, const auto& rhs ) { return lhs.first < rhs.first; } );
|
std::sort( sampleData.begin(), sampleData.end(), []( const auto& lhs, const auto& rhs ) { return lhs.xValue < rhs.xValue; } );
|
||||||
|
|
||||||
const auto p = std::minmax_element( pairs.begin(), pairs.end() );
|
auto minX = sampleData.front().xValue;
|
||||||
auto minX = p.first->first;
|
auto maxX = sampleData.back().xValue;
|
||||||
auto maxX = p.second->first;
|
|
||||||
auto rangeX = maxX - minX;
|
auto rangeX = maxX - minX;
|
||||||
auto deltaRangeX = rangeX / binCount;
|
auto deltaRangeX = rangeX / binCount;
|
||||||
|
|
||||||
double currentX = minX;
|
double currentX = minX;
|
||||||
|
|
||||||
std::vector<double> binnedYValues;
|
std::map<int, std::vector<double>> yValuesPerRealization;
|
||||||
for ( auto v : pairs )
|
for ( auto v : sampleData )
|
||||||
{
|
{
|
||||||
if ( v.first < currentX + deltaRangeX )
|
if ( v.xValue < currentX + deltaRangeX )
|
||||||
{
|
{
|
||||||
binnedYValues.emplace_back( v.second );
|
yValuesPerRealization[v.realizationId].emplace_back( v.yValue );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Add statistics for current bin if sample count is above threshold
|
// Add statistics for current bin if sample count is above threshold
|
||||||
// TODO: Add option to skip bin if unique realization count is below threshold
|
if ( static_cast<int>( yValuesPerRealization.size() ) > realizationCountThreshold )
|
||||||
|
|
||||||
if ( static_cast<int>( binnedYValues.size() ) > sampleCountThreshold )
|
|
||||||
{
|
{
|
||||||
|
std::vector<double> meanYPerRealization;
|
||||||
|
|
||||||
|
for ( const auto& [id, values] : yValuesPerRealization )
|
||||||
|
{
|
||||||
|
if ( values.empty() ) continue;
|
||||||
|
|
||||||
|
double sum = 0.0;
|
||||||
|
for ( double value : values )
|
||||||
|
{
|
||||||
|
sum += value;
|
||||||
|
}
|
||||||
|
|
||||||
|
meanYPerRealization.emplace_back( sum / values.size() );
|
||||||
|
}
|
||||||
|
|
||||||
double p10, p50, p90, mean;
|
double p10, p50, p90, mean;
|
||||||
RigStatisticsMath::calculateStatisticsCurves( binnedYValues, &p10, &p50, &p90, &mean, RigStatisticsMath::PercentileStyle::SWITCHED );
|
RigStatisticsMath::calculateStatisticsCurves( meanYPerRealization,
|
||||||
|
&p10,
|
||||||
|
&p50,
|
||||||
|
&p90,
|
||||||
|
&mean,
|
||||||
|
RigStatisticsMath::PercentileStyle::SWITCHED );
|
||||||
m_p10Data.push_back( p10 );
|
m_p10Data.push_back( p10 );
|
||||||
m_p50Data.push_back( p50 );
|
m_p50Data.push_back( p50 );
|
||||||
m_p90Data.push_back( p90 );
|
m_p90Data.push_back( p90 );
|
||||||
m_meanData.push_back( mean );
|
m_meanData.push_back( mean );
|
||||||
|
|
||||||
m_binnedXValues.emplace_back( currentX );
|
// Use middle of bin as X value
|
||||||
|
m_binnedXValues.emplace_back( currentX + deltaRangeX / 2.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
currentX += deltaRangeX;
|
currentX += deltaRangeX;
|
||||||
binnedYValues.clear();
|
yValuesPerRealization.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,12 @@ class RifEclipseSummaryAddress;
|
|||||||
class RimEnsembleCrossPlotStatisticsCase : public RimSummaryCase, public RifSummaryReaderInterface
|
class RimEnsembleCrossPlotStatisticsCase : public RimSummaryCase, public RifSummaryReaderInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RimEnsembleCrossPlotStatisticsCase();
|
|
||||||
|
|
||||||
void calculate( const std::vector<RimSummaryCase*>& sumCases,
|
void calculate( const std::vector<RimSummaryCase*>& sumCases,
|
||||||
const RifEclipseSummaryAddress& inputAddressX,
|
const RifEclipseSummaryAddress& inputAddressX,
|
||||||
const RifEclipseSummaryAddress& inputAddressY,
|
const RifEclipseSummaryAddress& inputAddressY,
|
||||||
bool includeIncompleteCurves,
|
bool includeIncompleteCurves,
|
||||||
int binCount,
|
int binCount,
|
||||||
int sampleCountThreshold );
|
int realizationCountThreshold );
|
||||||
|
|
||||||
bool hasP10Data() const;
|
bool hasP10Data() const;
|
||||||
bool hasP50Data() const;
|
bool hasP50Data() const;
|
||||||
|
@ -350,7 +350,7 @@ void RimEnsembleCurveFilter::fieldChangedByUi( const caf::PdmFieldHandle* change
|
|||||||
{
|
{
|
||||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||||
|
|
||||||
RifEclipseSummaryAddress candidateAdr = parentCurveSet()->summaryAddress();
|
RifEclipseSummaryAddress candidateAdr = parentCurveSet()->summaryAddressY();
|
||||||
|
|
||||||
auto nativeQuantityName = RimObjectiveFunctionTools::nativeQuantityName( candidateAdr.vectorName() );
|
auto nativeQuantityName = RimObjectiveFunctionTools::nativeQuantityName( candidateAdr.vectorName() );
|
||||||
candidateAdr.setVectorName( nativeQuantityName );
|
candidateAdr.setVectorName( nativeQuantityName );
|
||||||
|
@ -410,7 +410,7 @@ void RimEnsembleCurveSet::deleteCurve( RimSummaryCurve* curve )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEnsembleCurveSet::setSummaryAddress( RifEclipseSummaryAddress address )
|
void RimEnsembleCurveSet::setSummaryAddressY( RifEclipseSummaryAddress address )
|
||||||
{
|
{
|
||||||
m_yValuesSummaryAddress->setAddress( address );
|
m_yValuesSummaryAddress->setAddress( address );
|
||||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||||
@ -423,7 +423,7 @@ void RimEnsembleCurveSet::setSummaryAddress( RifEclipseSummaryAddress address )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEnsembleCurveSet::setCurveAddress( RiaSummaryCurveAddress address )
|
void RimEnsembleCurveSet::setCurveAddress( RiaSummaryCurveAddress address )
|
||||||
{
|
{
|
||||||
setSummaryAddress( address.summaryAddressY() );
|
setSummaryAddressY( address.summaryAddressY() );
|
||||||
setSummaryAddressX( address.summaryAddressX() );
|
setSummaryAddressX( address.summaryAddressX() );
|
||||||
|
|
||||||
if ( address.summaryAddressX().category() == SummaryCategory::SUMMARY_TIME )
|
if ( address.summaryAddressX().category() == SummaryCategory::SUMMARY_TIME )
|
||||||
@ -455,9 +455,9 @@ bool RimEnsembleCurveSet::isXAxisSummaryVector() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEnsembleCurveSet::setSummaryAddressAndStatisticsFlag( RifEclipseSummaryAddress address )
|
void RimEnsembleCurveSet::setSummaryAddressYAndStatisticsFlag( RifEclipseSummaryAddress address )
|
||||||
{
|
{
|
||||||
setSummaryAddress( address );
|
setSummaryAddressY( address );
|
||||||
m_statistics->setShowStatisticsCurves( !address.isHistoryVector() );
|
m_statistics->setShowStatisticsCurves( !address.isHistoryVector() );
|
||||||
m_statistics->updateAllRequiredEditors();
|
m_statistics->updateAllRequiredEditors();
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ void RimEnsembleCurveSet::setSummaryAddressAndStatisticsFlag( RifEclipseSummaryA
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RifEclipseSummaryAddress RimEnsembleCurveSet::summaryAddress() const
|
RifEclipseSummaryAddress RimEnsembleCurveSet::summaryAddressY() const
|
||||||
{
|
{
|
||||||
return m_yValuesSummaryAddress->address();
|
return m_yValuesSummaryAddress->address();
|
||||||
}
|
}
|
||||||
@ -477,10 +477,10 @@ RiaSummaryCurveAddress RimEnsembleCurveSet::curveAddress() const
|
|||||||
{
|
{
|
||||||
if ( m_xAxisType() == RiaDefines::HorizontalAxisType::TIME )
|
if ( m_xAxisType() == RiaDefines::HorizontalAxisType::TIME )
|
||||||
{
|
{
|
||||||
return RiaSummaryCurveAddress( RifEclipseSummaryAddress::timeAddress(), summaryAddress() );
|
return RiaSummaryCurveAddress( RifEclipseSummaryAddress::timeAddress(), summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return RiaSummaryCurveAddress( m_xAddressSelector->summaryAddress(), summaryAddress() );
|
return RiaSummaryCurveAddress( m_xAddressSelector->summaryAddress(), summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -742,7 +742,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
|||||||
if ( !m_xAddressSelector->ensemble() )
|
if ( !m_xAddressSelector->ensemble() )
|
||||||
{
|
{
|
||||||
m_xAddressSelector->setEnsemble( summaryCaseCollection() );
|
m_xAddressSelector->setEnsemble( summaryCaseCollection() );
|
||||||
m_xAddressSelector->setAddress( summaryAddress() );
|
m_xAddressSelector->setAddress( summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !m_xAddressSelector->plotAxisProperties() )
|
if ( !m_xAddressSelector->plotAxisProperties() )
|
||||||
@ -2015,14 +2015,14 @@ void RimEnsembleCurveSet::updateStatisticsCurves( const std::vector<RimSummaryCa
|
|||||||
{
|
{
|
||||||
m_ensembleStatCaseXY->calculate( statCases,
|
m_ensembleStatCaseXY->calculate( statCases,
|
||||||
m_xAddressSelector->summaryAddress(),
|
m_xAddressSelector->summaryAddress(),
|
||||||
summaryAddress(),
|
summaryAddressY(),
|
||||||
m_statistics->includeIncompleteCurves(),
|
m_statistics->includeIncompleteCurves(),
|
||||||
m_statistics->crossPlotCurvesBinCount(),
|
m_statistics->crossPlotCurvesBinCount(),
|
||||||
m_statistics->crossPlotCurvesSampleCountThresholdPerBin() );
|
m_statistics->crossPlotRealizationCountThresholdPerBin() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ensembleStatCaseY->calculate( statCases, summaryAddress(), m_statistics->includeIncompleteCurves() );
|
m_ensembleStatCaseY->calculate( statCases, summaryAddressY(), m_statistics->includeIncompleteCurves() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2203,12 +2203,12 @@ std::vector<std::pair<RigEnsembleParameter, double>> RimEnsembleCurveSet::ensemb
|
|||||||
{
|
{
|
||||||
if ( sortingMode == ParameterSorting::ABSOLUTE_VALUE )
|
if ( sortingMode == ParameterSorting::ABSOLUTE_VALUE )
|
||||||
{
|
{
|
||||||
return ensemble->correlationSortedEnsembleParameters( summaryAddress() );
|
return ensemble->correlationSortedEnsembleParameters( summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( sortingMode == ParameterSorting::ALPHABETICALLY )
|
if ( sortingMode == ParameterSorting::ALPHABETICALLY )
|
||||||
{
|
{
|
||||||
auto parameters = ensemble->parameterCorrelationsAllTimeSteps( summaryAddress() );
|
auto parameters = ensemble->parameterCorrelationsAllTimeSteps( summaryAddressY() );
|
||||||
std::sort( parameters.begin(),
|
std::sort( parameters.begin(),
|
||||||
parameters.end(),
|
parameters.end(),
|
||||||
[]( const auto& lhs, const auto& rhs ) { return lhs.first.name < rhs.first.name; } );
|
[]( const auto& lhs, const auto& rhs ) { return lhs.first.name < rhs.first.name; } );
|
||||||
|
@ -113,10 +113,10 @@ public:
|
|||||||
void addCurve( RimSummaryCurve* curve );
|
void addCurve( RimSummaryCurve* curve );
|
||||||
void deleteCurve( RimSummaryCurve* curve );
|
void deleteCurve( RimSummaryCurve* curve );
|
||||||
|
|
||||||
void setSummaryAddress( RifEclipseSummaryAddress address );
|
void setSummaryAddressY( RifEclipseSummaryAddress address );
|
||||||
void setCurveAddress( RiaSummaryCurveAddress address );
|
void setCurveAddress( RiaSummaryCurveAddress address );
|
||||||
void setSummaryAddressAndStatisticsFlag( RifEclipseSummaryAddress address );
|
void setSummaryAddressYAndStatisticsFlag( RifEclipseSummaryAddress address );
|
||||||
RifEclipseSummaryAddress summaryAddress() const;
|
RifEclipseSummaryAddress summaryAddressY() const;
|
||||||
RiaSummaryCurveAddress curveAddress() const;
|
RiaSummaryCurveAddress curveAddress() const;
|
||||||
std::vector<RimSummaryCurve*> curves() const;
|
std::vector<RimSummaryCurve*> curves() const;
|
||||||
|
|
||||||
|
@ -262,10 +262,10 @@ std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::curveSetsForSou
|
|||||||
{
|
{
|
||||||
// Add corresponding history/summary curve with or without H
|
// Add corresponding history/summary curve with or without H
|
||||||
|
|
||||||
std::string vectorName = m_curveSetForSourceStepping->summaryAddress().vectorName();
|
std::string vectorName = m_curveSetForSourceStepping->summaryAddressY().vectorName();
|
||||||
|
|
||||||
std::string candidateName;
|
std::string candidateName;
|
||||||
if ( m_curveSetForSourceStepping->summaryAddress().isHistoryVector() )
|
if ( m_curveSetForSourceStepping->summaryAddressY().isHistoryVector() )
|
||||||
{
|
{
|
||||||
candidateName = vectorName.substr( 0, vectorName.size() - 1 );
|
candidateName = vectorName.substr( 0, vectorName.size() - 1 );
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::curveSetsForSou
|
|||||||
|
|
||||||
for ( const auto& c : curveSets() )
|
for ( const auto& c : curveSets() )
|
||||||
{
|
{
|
||||||
if ( c->summaryAddress().vectorName() == candidateName )
|
if ( c->summaryAddressY().vectorName() == candidateName )
|
||||||
{
|
{
|
||||||
steppingCurveSets.push_back( c );
|
steppingCurveSets.push_back( c );
|
||||||
}
|
}
|
||||||
|
@ -47,10 +47,10 @@ RimEnsembleStatistics::RimEnsembleStatistics( RimEnsembleCurveSetInterface* pare
|
|||||||
CAF_PDM_InitField( &m_includeIncompleteCurves, "IncludeIncompleteCurves", false, "Include Incomplete Curves" );
|
CAF_PDM_InitField( &m_includeIncompleteCurves, "IncludeIncompleteCurves", false, "Include Incomplete Curves" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_crossPlotCurvesBinCount, "CrossPlotCurvesBinCount", 100, "Bin Count" );
|
CAF_PDM_InitField( &m_crossPlotCurvesBinCount, "CrossPlotCurvesBinCount", 100, "Bin Count" );
|
||||||
CAF_PDM_InitField( &m_crossPlotCurvesStatisticsSampleCountThresholdPerBin,
|
CAF_PDM_InitField( &m_crossPlotCurvesStatisticsRealizationCountThresholdPerBin,
|
||||||
"CrossPlotCurvesStatisticsSampleCountThresholdPerBin",
|
"CrossPlotCurvesStatisticsRealizationCountThresholdPerBin",
|
||||||
100,
|
10,
|
||||||
"Sample Threshold per Bin" );
|
"Realization Count Threshold per Bin" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_warningLabel, "WarningLabel", QString( "Warning: Ensemble time range mismatch" ), "" );
|
CAF_PDM_InitField( &m_warningLabel, "WarningLabel", QString( "Warning: Ensemble time range mismatch" ), "" );
|
||||||
|
|
||||||
@ -96,9 +96,9 @@ int RimEnsembleStatistics::crossPlotCurvesBinCount() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
int RimEnsembleStatistics::crossPlotCurvesSampleCountThresholdPerBin() const
|
int RimEnsembleStatistics::crossPlotRealizationCountThresholdPerBin() const
|
||||||
{
|
{
|
||||||
return m_crossPlotCurvesStatisticsSampleCountThresholdPerBin;
|
return m_crossPlotCurvesStatisticsRealizationCountThresholdPerBin;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -182,7 +182,7 @@ void RimEnsembleStatistics::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
|||||||
|
|
||||||
auto crossPlotGroup = uiOrdering.addNewGroup( "Cross Plot" );
|
auto crossPlotGroup = uiOrdering.addNewGroup( "Cross Plot" );
|
||||||
crossPlotGroup->add( &m_crossPlotCurvesBinCount );
|
crossPlotGroup->add( &m_crossPlotCurvesBinCount );
|
||||||
crossPlotGroup->add( &m_crossPlotCurvesStatisticsSampleCountThresholdPerBin );
|
crossPlotGroup->add( &m_crossPlotCurvesStatisticsRealizationCountThresholdPerBin );
|
||||||
|
|
||||||
if ( m_showColorField ) uiOrdering.add( &m_color );
|
if ( m_showColorField ) uiOrdering.add( &m_color );
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
bool includeIncompleteCurves() const { return m_includeIncompleteCurves; }
|
bool includeIncompleteCurves() const { return m_includeIncompleteCurves; }
|
||||||
|
|
||||||
int crossPlotCurvesBinCount() const;
|
int crossPlotCurvesBinCount() const;
|
||||||
int crossPlotCurvesSampleCountThresholdPerBin() const;
|
int crossPlotRealizationCountThresholdPerBin() const;
|
||||||
|
|
||||||
void disableP10Curve( bool disable );
|
void disableP10Curve( bool disable );
|
||||||
void disableP50Curve( bool disable );
|
void disableP50Curve( bool disable );
|
||||||
@ -81,7 +81,7 @@ private:
|
|||||||
|
|
||||||
// Ensemble cross plot settings
|
// Ensemble cross plot settings
|
||||||
caf::PdmField<int> m_crossPlotCurvesBinCount;
|
caf::PdmField<int> m_crossPlotCurvesBinCount;
|
||||||
caf::PdmField<int> m_crossPlotCurvesStatisticsSampleCountThresholdPerBin;
|
caf::PdmField<int> m_crossPlotCurvesStatisticsRealizationCountThresholdPerBin;
|
||||||
|
|
||||||
caf::PdmField<QString> m_warningLabel;
|
caf::PdmField<QString> m_warningLabel;
|
||||||
|
|
||||||
|
@ -30,26 +30,6 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
/// Internal constants
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
#define DOUBLE_INF std::numeric_limits<double>::infinity()
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RimEnsembleStatisticsCase::RimEnsembleStatisticsCase()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
const std::vector<time_t>& RimEnsembleStatisticsCase::timeSteps() const
|
|
||||||
{
|
|
||||||
return m_timeSteps;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -33,10 +33,6 @@ class RifEclipseSummaryAddress;
|
|||||||
class RimEnsembleStatisticsCase : public RimSummaryCase, public RifSummaryReaderInterface
|
class RimEnsembleStatisticsCase : public RimSummaryCase, public RifSummaryReaderInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RimEnsembleStatisticsCase();
|
|
||||||
|
|
||||||
const std::vector<time_t>& timeSteps() const;
|
|
||||||
|
|
||||||
bool hasP10Data() const;
|
bool hasP10Data() const;
|
||||||
bool hasP50Data() const;
|
bool hasP50Data() const;
|
||||||
bool hasP90Data() const;
|
bool hasP90Data() const;
|
||||||
|
@ -43,7 +43,7 @@ RimCustomObjectiveFunctionWeight* RimObjectiveFunctionTools::addWeight( RimCusto
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
candidateAdr = newWeight->parentCurveSet()->summaryAddress();
|
candidateAdr = newWeight->parentCurveSet()->summaryAddressY();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto nativeQuantityName = RimObjectiveFunctionTools::nativeQuantityName( candidateAdr.vectorName() );
|
auto nativeQuantityName = RimObjectiveFunctionTools::nativeQuantityName( candidateAdr.vectorName() );
|
||||||
|
@ -81,7 +81,7 @@ std::vector<RifEclipseSummaryAddress> RimSummaryAddressModifier::createEclipseSu
|
|||||||
RifEclipseSummaryAddress RimSummaryAddressModifier::address() const
|
RifEclipseSummaryAddress RimSummaryAddressModifier::address() const
|
||||||
{
|
{
|
||||||
if ( m_curve ) return m_curve->summaryAddressY();
|
if ( m_curve ) return m_curve->summaryAddressY();
|
||||||
if ( m_curveSet ) return m_curveSet->summaryAddress();
|
if ( m_curveSet ) return m_curveSet->summaryAddressY();
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ RifEclipseSummaryAddress RimSummaryAddressModifier::address() const
|
|||||||
void RimSummaryAddressModifier::setAddress( const RifEclipseSummaryAddress& address )
|
void RimSummaryAddressModifier::setAddress( const RifEclipseSummaryAddress& address )
|
||||||
{
|
{
|
||||||
if ( m_curve ) m_curve->setSummaryAddressY( address );
|
if ( m_curve ) m_curve->setSummaryAddressY( address );
|
||||||
if ( m_curveSet ) m_curveSet->setSummaryAddressAndStatisticsFlag( address );
|
if ( m_curveSet ) m_curveSet->setSummaryAddressYAndStatisticsFlag( address );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -141,6 +141,8 @@ QString RimSummaryCurvesData::createTextForExport( const std::vector<RimSummaryC
|
|||||||
RiaDefines::DateTimePeriod resamplingPeriod,
|
RiaDefines::DateTimePeriod resamplingPeriod,
|
||||||
bool showTimeAsLongString )
|
bool showTimeAsLongString )
|
||||||
{
|
{
|
||||||
|
if ( curves.empty() && asciiCurves.empty() && gridCurves.empty() ) return {};
|
||||||
|
|
||||||
QString out;
|
QString out;
|
||||||
|
|
||||||
RimSummaryCurvesData summaryCurvesGridData;
|
RimSummaryCurvesData summaryCurvesGridData;
|
||||||
@ -176,6 +178,47 @@ QString RimSummaryCurvesData::createTextForExport( const std::vector<RimSummaryC
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimSummaryCurvesData::createTextForCrossPlotCurves( const std::vector<RimSummaryCurve*>& curves )
|
||||||
|
{
|
||||||
|
QString text;
|
||||||
|
|
||||||
|
for ( const auto& curve : curves )
|
||||||
|
{
|
||||||
|
const auto curveAddress = curve->curveAddress();
|
||||||
|
const auto xAddress = curveAddress.summaryAddressX();
|
||||||
|
const auto yAddress = curveAddress.summaryAddressY();
|
||||||
|
|
||||||
|
const auto xValues = curve->valuesX();
|
||||||
|
const auto yValues = curve->valuesY();
|
||||||
|
|
||||||
|
if ( xValues.size() == yValues.size() )
|
||||||
|
{
|
||||||
|
text += curve->curveExportDescription( {} ) + "\n";
|
||||||
|
|
||||||
|
text +=
|
||||||
|
QString( "%1\t%2\n" ).arg( QString::fromStdString( xAddress.vectorName() ) ).arg( QString::fromStdString( yAddress.vectorName() ) );
|
||||||
|
|
||||||
|
for ( size_t i = 0; i < xValues.size(); i++ )
|
||||||
|
{
|
||||||
|
QString line;
|
||||||
|
line += QString::number( xValues[i], 'g', RimSummaryPlot::precision() );
|
||||||
|
line += "\t";
|
||||||
|
line += QString::number( yValues[i], 'g', RimSummaryPlot::precision() );
|
||||||
|
line += "\n";
|
||||||
|
|
||||||
|
text += line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
text += "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -66,6 +66,8 @@ public:
|
|||||||
RiaDefines::DateTimePeriod resamplingPeriod,
|
RiaDefines::DateTimePeriod resamplingPeriod,
|
||||||
bool showTimeAsLongString );
|
bool showTimeAsLongString );
|
||||||
|
|
||||||
|
static QString createTextForCrossPlotCurves( const std::vector<RimSummaryCurve*>& curves );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void populateSummaryCurvesData( std::vector<RimSummaryCurve*> curves, SummaryCurveType curveType, RimSummaryCurvesData* curvesData );
|
static void populateSummaryCurvesData( std::vector<RimSummaryCurve*> curves, SummaryCurveType curveType, RimSummaryCurvesData* curvesData );
|
||||||
static void populateTimeHistoryCurvesData( std::vector<RimGridTimeHistoryCurve*> curves, RimSummaryCurvesData* curvesData );
|
static void populateTimeHistoryCurvesData( std::vector<RimGridTimeHistoryCurve*> curves, RimSummaryCurvesData* curvesData );
|
||||||
|
@ -1591,7 +1591,7 @@ void RimSummaryMultiPlot::appendCurveByStepping( int direction )
|
|||||||
|
|
||||||
for ( auto curveSet : plot->curveSets() )
|
for ( auto curveSet : plot->curveSets() )
|
||||||
{
|
{
|
||||||
auto address = curveSet->summaryAddress();
|
auto address = curveSet->summaryAddressY();
|
||||||
auto sumEns = curveSet->summaryCaseCollection();
|
auto sumEns = curveSet->summaryCaseCollection();
|
||||||
int sumEnsId = sumEns->ensembleId();
|
int sumEnsId = sumEns->ensembleId();
|
||||||
if ( m_sourceStepping()->stepDimension() == RimSummaryDataSourceStepping::SourceSteppingDimension::ENSEMBLE )
|
if ( m_sourceStepping()->stepDimension() == RimSummaryDataSourceStepping::SourceSteppingDimension::ENSEMBLE )
|
||||||
|
@ -120,8 +120,7 @@ struct RimSummaryPlot::CurveInfo
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimSummaryPlot::RimSummaryPlot()
|
RimSummaryPlot::RimSummaryPlot()
|
||||||
: RimPlot()
|
: curvesChanged( this )
|
||||||
, curvesChanged( this )
|
|
||||||
, axisChanged( this )
|
, axisChanged( this )
|
||||||
, plotZoomedByUser( this )
|
, plotZoomedByUser( this )
|
||||||
, titleChanged( this )
|
, titleChanged( this )
|
||||||
@ -336,13 +335,29 @@ QString RimSummaryPlot::asciiDataForPlotExport() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimSummaryPlot::asciiDataForSummaryPlotExport( RiaDefines::DateTimePeriod resamplingPeriod, bool showTimeAsLongString ) const
|
QString RimSummaryPlot::asciiDataForSummaryPlotExport( RiaDefines::DateTimePeriod resamplingPeriod, bool showTimeAsLongString ) const
|
||||||
{
|
{
|
||||||
std::vector<RimSummaryCurve*> curves = descendantsIncludingThisOfType<RimSummaryCurve>();
|
std::vector<RimSummaryCurve*> allCurves = descendantsIncludingThisOfType<RimSummaryCurve>();
|
||||||
|
|
||||||
|
std::vector<RimSummaryCurve*> crossPlotCurves;
|
||||||
|
std::vector<RimSummaryCurve*> curves;
|
||||||
|
for ( auto c : allCurves )
|
||||||
|
{
|
||||||
|
if ( c->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR )
|
||||||
|
{
|
||||||
|
crossPlotCurves.push_back( c );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curves.push_back( c );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto gridCurves = m_gridTimeHistoryCurves.childrenByType();
|
auto gridCurves = m_gridTimeHistoryCurves.childrenByType();
|
||||||
auto asciiCurves = m_asciiDataCurves.childrenByType();
|
auto asciiCurves = m_asciiDataCurves.childrenByType();
|
||||||
|
|
||||||
QString text = RimSummaryCurvesData::createTextForExport( curves, asciiCurves, gridCurves, resamplingPeriod, showTimeAsLongString );
|
QString text = RimSummaryCurvesData::createTextForExport( curves, asciiCurves, gridCurves, resamplingPeriod, showTimeAsLongString );
|
||||||
|
|
||||||
|
text += RimSummaryCurvesData::createTextForCrossPlotCurves( crossPlotCurves );
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -828,7 +843,7 @@ void RimSummaryPlot::applyDefaultCurveAppearances( std::vector<RimEnsembleCurveS
|
|||||||
{
|
{
|
||||||
cvf::Color3f curveColor = cvf::Color3f::ORANGE;
|
cvf::Color3f curveColor = cvf::Color3f::ORANGE;
|
||||||
|
|
||||||
const auto adr = curveSet->summaryAddress();
|
const auto adr = curveSet->summaryAddressY();
|
||||||
if ( adr.isHistoryVector() )
|
if ( adr.isHistoryVector() )
|
||||||
{
|
{
|
||||||
curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
||||||
@ -932,9 +947,11 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis )
|
|||||||
}
|
}
|
||||||
if ( summaryCurve->axisX() == riuPlotAxis )
|
if ( summaryCurve->axisX() == riuPlotAxis )
|
||||||
{
|
{
|
||||||
curveDefs.push_back( RiaSummaryCurveDefinition( summaryCurve->summaryCaseX(),
|
RiaSummaryCurveDefinition def;
|
||||||
summaryCurve->summaryAddressX(),
|
def.setSummaryCaseX( summaryCurve->summaryCaseX() );
|
||||||
summaryCurve->isEnsembleCurve() ) );
|
def.setSummaryAddressX( summaryCurve->summaryAddressX() );
|
||||||
|
|
||||||
|
curveDefs.push_back( def );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -942,7 +959,7 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis )
|
|||||||
{
|
{
|
||||||
if ( curveSet->axisY() == riuPlotAxis )
|
if ( curveSet->axisY() == riuPlotAxis )
|
||||||
{
|
{
|
||||||
RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() );
|
RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddressY() );
|
||||||
curveDefs.push_back( def );
|
curveDefs.push_back( def );
|
||||||
}
|
}
|
||||||
if ( curveSet->axisX() == riuPlotAxis )
|
if ( curveSet->axisX() == riuPlotAxis )
|
||||||
@ -1041,15 +1058,13 @@ void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisPrope
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::updateZoomForAxis( RimPlotAxisPropertiesInterface* axisProperties )
|
void RimSummaryPlot::updateZoomForAxis( RimPlotAxisPropertiesInterface* axisProperties )
|
||||||
{
|
{
|
||||||
RimSummaryTimeAxisProperties* timeAxisProps = dynamic_cast<RimSummaryTimeAxisProperties*>( axisProperties );
|
if ( auto timeAxisProps = dynamic_cast<RimSummaryTimeAxisProperties*>( axisProperties ) )
|
||||||
if ( timeAxisProps )
|
|
||||||
{
|
{
|
||||||
updateZoomForTimeAxis( timeAxisProps );
|
updateZoomForTimeAxis( timeAxisProps );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RimPlotAxisProperties* axisProps = dynamic_cast<RimPlotAxisProperties*>( axisProperties );
|
if ( auto axisProps = dynamic_cast<RimPlotAxisProperties*>( axisProperties ) )
|
||||||
if ( axisProps )
|
|
||||||
{
|
{
|
||||||
updateZoomForNumericalAxis( axisProps );
|
updateZoomForNumericalAxis( axisProps );
|
||||||
return;
|
return;
|
||||||
@ -2503,7 +2518,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryAddressDrop( RimSummaryAd
|
|||||||
|
|
||||||
for ( auto& curve : curveSets() )
|
for ( auto& curve : curveSets() )
|
||||||
{
|
{
|
||||||
const auto addr = curve->summaryAddress();
|
const auto addr = curve->summaryAddressY();
|
||||||
dataVectorMap[addr].insert( curve->summaryCaseCollection() );
|
dataVectorMap[addr].insert( curve->summaryCaseCollection() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2651,15 +2666,15 @@ RimEnsembleCurveSet* RimSummaryPlot::addNewEnsembleCurve( const RiaSummaryCurveA
|
|||||||
auto* curveSet = new RimEnsembleCurveSet();
|
auto* curveSet = new RimEnsembleCurveSet();
|
||||||
|
|
||||||
curveSet->setSummaryCaseCollection( ensemble );
|
curveSet->setSummaryCaseCollection( ensemble );
|
||||||
curveSet->setSummaryAddressAndStatisticsFlag( address.summaryAddressY() );
|
curveSet->setSummaryAddressYAndStatisticsFlag( address.summaryAddressY() );
|
||||||
curveSet->setCurveAddress( address );
|
curveSet->setCurveAddress( address );
|
||||||
|
|
||||||
cvf::Color3f curveColor =
|
cvf::Color3f curveColor =
|
||||||
RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( curveSet->summaryAddress(),
|
RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( curveSet->summaryAddressY(),
|
||||||
static_cast<int>(
|
static_cast<int>(
|
||||||
ensembleCurveSetCollection()->curveSetCount() ) );
|
ensembleCurveSetCollection()->curveSetCount() ) );
|
||||||
|
|
||||||
auto adr = curveSet->summaryAddress();
|
auto adr = curveSet->summaryAddressY();
|
||||||
if ( adr.isHistoryVector() ) curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
if ( adr.isHistoryVector() ) curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
||||||
|
|
||||||
curveSet->setColor( curveColor );
|
curveSet->setColor( curveColor );
|
||||||
|
@ -362,17 +362,26 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
|
|
||||||
bool triggerLoadDataAndUpdate = false;
|
bool triggerLoadDataAndUpdate = false;
|
||||||
|
|
||||||
auto updateEnsembleAddresses = [&doZoomAll, &oldValue, &newValue]( const std::vector<RimEnsembleCurveSet*>& curveSets )
|
auto updateEnsembleAddresses =
|
||||||
|
[&doZoomAll, &oldValue, &newValue]( const std::vector<RimEnsembleCurveSet*>& curveSets, SummaryCategory categoryToUpdate )
|
||||||
{
|
{
|
||||||
for ( auto curveSet : curveSets )
|
for ( auto curveSet : curveSets )
|
||||||
{
|
{
|
||||||
auto curveAdr = curveSet->curveAddress();
|
auto curveAdr = curveSet->curveAddress();
|
||||||
|
|
||||||
auto yAddressToModify = curveAdr.summaryAddressY();
|
auto yAddressToModify = curveAdr.summaryAddressY();
|
||||||
RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, yAddressToModify );
|
|
||||||
|
|
||||||
auto xAddressToModify = curveAdr.summaryAddressX();
|
auto xAddressToModify = curveAdr.summaryAddressX();
|
||||||
|
|
||||||
|
if ( categoryToUpdate != SummaryCategory::SUMMARY_INVALID )
|
||||||
|
{
|
||||||
|
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, categoryToUpdate, yAddressToModify );
|
||||||
|
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, categoryToUpdate, xAddressToModify );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, yAddressToModify );
|
||||||
RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, xAddressToModify );
|
RimDataSourceSteppingTools::updateQuantityIfMatching( oldValue, newValue, xAddressToModify );
|
||||||
|
}
|
||||||
|
|
||||||
curveSet->setCurveAddress( RiaSummaryCurveAddress( xAddressToModify, yAddressToModify ) );
|
curveSet->setCurveAddress( RiaSummaryCurveAddress( xAddressToModify, yAddressToModify ) );
|
||||||
curveSet->updateConnectedEditors();
|
curveSet->updateConnectedEditors();
|
||||||
@ -451,7 +460,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
|
|
||||||
if ( dataSourceSteppingObject() )
|
if ( dataSourceSteppingObject() )
|
||||||
{
|
{
|
||||||
updateEnsembleAddresses( dataSourceSteppingObject()->curveSets() );
|
updateEnsembleAddresses( dataSourceSteppingObject()->curveSets(), SummaryCategory::SUMMARY_INVALID );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_vectorName.uiCapability()->updateConnectedEditors();
|
m_vectorName.uiCapability()->updateConnectedEditors();
|
||||||
@ -516,7 +525,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
|
|
||||||
if ( dataSourceSteppingObject() )
|
if ( dataSourceSteppingObject() )
|
||||||
{
|
{
|
||||||
updateEnsembleAddresses( dataSourceSteppingObject()->curveSets() );
|
updateEnsembleAddresses( dataSourceSteppingObject()->curveSets(), summaryCategoryToModify );
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerLoadDataAndUpdate = true;
|
triggerLoadDataAndUpdate = true;
|
||||||
@ -675,7 +684,7 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::addressesForCur
|
|||||||
{
|
{
|
||||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||||
{
|
{
|
||||||
addresses.insert( curveSet->summaryAddress() );
|
addresses.insert( curveSet->summaryAddressY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<RimSummaryCurve*> curves;
|
std::vector<RimSummaryCurve*> curves;
|
||||||
|
@ -97,7 +97,7 @@ void RiuSummaryPlot::showContextMenu( QPoint pos )
|
|||||||
ensemble = clickedEnsembleCurveSet->summaryCaseCollection();
|
ensemble = clickedEnsembleCurveSet->summaryCaseCollection();
|
||||||
if ( ensemble && ensemble->isEnsemble() )
|
if ( ensemble && ensemble->isEnsemble() )
|
||||||
{
|
{
|
||||||
clickedQuantityName = QString::fromStdString( clickedEnsembleCurveSet->summaryAddress().uiText() );
|
clickedQuantityName = QString::fromStdString( clickedEnsembleCurveSet->summaryAddressY().uiText() );
|
||||||
|
|
||||||
if ( curveClicked )
|
if ( curveClicked )
|
||||||
{
|
{
|
||||||
@ -127,7 +127,7 @@ void RiuSummaryPlot::showContextMenu( QPoint pos )
|
|||||||
std::vector<RimEnsembleCurveSet*> allCurveSetsInPlot = summaryPlot->descendantsOfType<RimEnsembleCurveSet>();
|
std::vector<RimEnsembleCurveSet*> allCurveSetsInPlot = summaryPlot->descendantsOfType<RimEnsembleCurveSet>();
|
||||||
for ( auto curveSet : allCurveSetsInPlot )
|
for ( auto curveSet : allCurveSetsInPlot )
|
||||||
{
|
{
|
||||||
allQuantityNamesInPlot.push_back( QString::fromStdString( curveSet->summaryAddress().uiText() ) );
|
allQuantityNamesInPlot.push_back( QString::fromStdString( curveSet->summaryAddressY().uiText() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -162,7 +162,7 @@ void RiuSummaryPlot::showContextMenu( QPoint pos )
|
|||||||
{
|
{
|
||||||
menuBuilder.subMenuStart( "Cross Plots", *caf::IconProvider( ":/CorrelationCrossPlot16x16.png" ).icon() );
|
menuBuilder.subMenuStart( "Cross Plots", *caf::IconProvider( ":/CorrelationCrossPlot16x16.png" ).icon() );
|
||||||
std::vector<std::pair<RigEnsembleParameter, double>> ensembleParameters =
|
std::vector<std::pair<RigEnsembleParameter, double>> ensembleParameters =
|
||||||
ensemble->parameterCorrelations( clickedEnsembleCurveSet->summaryAddress(), timeStep );
|
ensemble->parameterCorrelations( clickedEnsembleCurveSet->summaryAddressY(), timeStep );
|
||||||
std::sort( ensembleParameters.begin(),
|
std::sort( ensembleParameters.begin(),
|
||||||
ensembleParameters.end(),
|
ensembleParameters.end(),
|
||||||
[]( const std::pair<RigEnsembleParameter, double>& lhs, const std::pair<RigEnsembleParameter, double>& rhs )
|
[]( const std::pair<RigEnsembleParameter, double>& lhs, const std::pair<RigEnsembleParameter, double>& rhs )
|
||||||
|
Loading…
Reference in New Issue
Block a user