mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2659 Ensemble statistics. Use resampling during statistics calculations
This commit is contained in:
@@ -478,14 +478,24 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress(const std::st
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress(const std::string& quantityName)
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress(const std::string& quantityName,
|
||||
const std::string& dataQuantityName)
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_ENSEMBLE_STATISTICS;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_quantityName = quantityName + ":" + dataQuantityName;
|
||||
return addr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::string RifEclipseSummaryAddress::ensembleStatisticsQuantityName() const
|
||||
{
|
||||
QString qName = QString::fromStdString(m_quantityName);
|
||||
return qName.split(":")[0].toStdString();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -657,6 +667,14 @@ bool RifEclipseSummaryAddress::isValid() const
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEclipseSummaryAddress::hasAccumulatedData() const
|
||||
{
|
||||
return QString::fromStdString(m_quantityName).endsWith("T");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
static RifEclipseSummaryAddress blockLgrAddress(const std::string& quantityName, const std::string& lgrName, int i, int j, int k);
|
||||
static RifEclipseSummaryAddress calculatedAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress importedAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress ensembleStatisticsAddress(const std::string& quantityName);
|
||||
static RifEclipseSummaryAddress ensembleStatisticsAddress(const std::string& quantityName, const std::string& dataQuantityName);
|
||||
|
||||
// Access methods
|
||||
|
||||
@@ -160,6 +160,8 @@ public:
|
||||
int cellK() const { return m_cellK; }
|
||||
int aquiferNumber() const { return m_aquiferNumber; }
|
||||
|
||||
const std::string ensembleStatisticsQuantityName() const;
|
||||
|
||||
// Derived properties
|
||||
|
||||
std::string uiText() const;
|
||||
@@ -174,6 +176,7 @@ public:
|
||||
|
||||
void setAsErrorResult() { m_isErrorResult = true; }
|
||||
bool isErrorResult() const { return m_isErrorResult; }
|
||||
bool hasAccumulatedData() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ RifEnsembleStatisticsReader::RifEnsembleStatisticsReader(RimEnsembleStatisticsCa
|
||||
|
||||
m_allResultAddresses = std::vector<RifEclipseSummaryAddress>(
|
||||
{
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P10_QUANTITY_NAME),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P50_QUANTITY_NAME),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P90_QUANTITY_NAME),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_MEAN_QUANTITY_NAME)
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P10_QUANTITY_NAME, ""),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P50_QUANTITY_NAME, ""),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P90_QUANTITY_NAME, ""),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_MEAN_QUANTITY_NAME, "")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,10 +55,12 @@ bool RifEnsembleStatisticsReader::values(const RifEclipseSummaryAddress& resultA
|
||||
if (!validateAddress(resultAddress)) return false;
|
||||
|
||||
const std::vector<double>* sourceData = nullptr;
|
||||
if (resultAddress.quantityName() == ENSEMBLE_STAT_P10_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p10();
|
||||
else if (resultAddress.quantityName() == ENSEMBLE_STAT_P50_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p50();
|
||||
else if (resultAddress.quantityName() == ENSEMBLE_STAT_P90_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p90();
|
||||
else if (resultAddress.quantityName() == ENSEMBLE_STAT_MEAN_QUANTITY_NAME) sourceData = &m_ensembleStatCase->mean();
|
||||
auto quantityName = resultAddress.ensembleStatisticsQuantityName();
|
||||
|
||||
if (quantityName == ENSEMBLE_STAT_P10_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p10();
|
||||
else if (quantityName == ENSEMBLE_STAT_P50_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p50();
|
||||
else if (quantityName == ENSEMBLE_STAT_P90_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p90();
|
||||
else if (quantityName == ENSEMBLE_STAT_MEAN_QUANTITY_NAME) sourceData = &m_ensembleStatCase->mean();
|
||||
|
||||
if (!sourceData) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user