mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7716 Added ensemble well log curve set
This commit is contained in:
parent
5a7b52abf6
commit
fed98a4183
@ -156,6 +156,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h
|
||||
@ -314,6 +317,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp
|
||||
|
1228
ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp
Normal file
1228
ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp
Normal file
File diff suppressed because it is too large
Load Diff
187
ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h
Normal file
187
ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h
Normal file
@ -0,0 +1,187 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RimEnsembleCurveSetColorManager.h"
|
||||
#include "RimEnsembleCurveSetInterface.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
|
||||
#include "RigEnsembleParameter.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
#include "cafPdmPtrArrayField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RimEnsembleWellLogs;
|
||||
class RimEnsembleWellLogsCollection;
|
||||
class RimEnsembleCurveFilterCollection;
|
||||
class RimEnsembleStatistics;
|
||||
class RimEnsembleStatisticsCase;
|
||||
class RimWellLogCurve;
|
||||
class RimWellLogFile;
|
||||
class RimEnsembleWellLogStatistics;
|
||||
|
||||
class RiuDraggableOverlayFrame;
|
||||
|
||||
class QwtPlot;
|
||||
class QwtPlotCurve;
|
||||
class QKeyEvent;
|
||||
class QFrame;
|
||||
class QDate;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
using ColorMode = RimEnsembleCurveSetColorManager::ColorMode;
|
||||
using ColorModeEnum = RimEnsembleCurveSetColorManager::ColorModeEnum;
|
||||
|
||||
public:
|
||||
RimEnsembleWellLogCurveSet();
|
||||
~RimEnsembleWellLogCurveSet() override;
|
||||
|
||||
caf::Signal<> filterChanged;
|
||||
|
||||
QString name() const;
|
||||
|
||||
bool isCurvesVisible();
|
||||
void setColor( cvf::Color3f color );
|
||||
|
||||
void loadDataAndUpdate( bool updateParentPlot );
|
||||
void setParentQwtPlotNoReplot( QwtPlot* plot );
|
||||
void detachQwtCurves();
|
||||
void reattachQwtCurves();
|
||||
|
||||
void addCurve( RimWellLogCurve* curve );
|
||||
void deleteCurve( RimWellLogCurve* curve );
|
||||
|
||||
std::vector<RimWellLogCurve*> curves() const;
|
||||
|
||||
void deleteEnsembleCurves();
|
||||
void deleteStatisticsCurves();
|
||||
|
||||
void onLegendDefinitionChanged();
|
||||
|
||||
void setSummaryCaseCollection( RimSummaryCaseCollection* sumCaseCollection );
|
||||
RimSummaryCaseCollection* summaryCaseCollection() const;
|
||||
|
||||
RimEnsembleCurveFilterCollection* filterCollection() const;
|
||||
|
||||
ColorMode colorMode() const;
|
||||
void setColorMode( ColorMode mode );
|
||||
void setEnsembleParameter( const QString& parameterName );
|
||||
RigEnsembleParameter::Type currentEnsembleParameterType() const;
|
||||
|
||||
RimRegularLegendConfig* legendConfig();
|
||||
|
||||
void updateEnsembleLegendItem();
|
||||
RiuDraggableOverlayFrame* legendFrame() const;
|
||||
|
||||
RimEnsembleWellLogCurveSet* clone() const;
|
||||
void showCurves( bool show );
|
||||
|
||||
void updateAllTextInPlot();
|
||||
std::vector<RigEnsembleParameter> variationSortedEnsembleParameters() const;
|
||||
|
||||
std::vector<std::pair<RigEnsembleParameter, double>> correlationSortedEnsembleParameters() const;
|
||||
|
||||
std::vector<RimWellLogFile*> filterEnsembleCases( const std::vector<RimWellLogFile*>& sumCases );
|
||||
void disableStatisticCurves();
|
||||
bool isFiltered() const;
|
||||
|
||||
void updateEditors() override;
|
||||
void updateAllCurves() override;
|
||||
void updateStatisticsCurves() override;
|
||||
bool hasP10Data() const override;
|
||||
bool hasP50Data() const override;
|
||||
bool hasP90Data() const override;
|
||||
bool hasMeanData() const override;
|
||||
|
||||
void appendColorGroup( caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
void updateFilterLegend();
|
||||
|
||||
const RimEnsembleWellLogStatistics* ensembleWellLogStatistics() const;
|
||||
|
||||
private:
|
||||
void updateEnsembleCurves( const std::vector<RimWellLogFile*>& curves );
|
||||
void updateStatisticsCurves( const std::vector<RimWellLogFile*>& curves );
|
||||
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
QString createAutoName() const;
|
||||
|
||||
void updateLegendMappingMode();
|
||||
void updateMaxMinAndDefaultValues();
|
||||
void updateCurveColors();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showCurves;
|
||||
|
||||
caf::PdmPtrArrayField<RimWellLogCurve*> m_curves;
|
||||
caf::PdmPointer<RimWellLogCurve> m_currentWellLogCurve;
|
||||
|
||||
caf::PdmField<ColorModeEnum> m_colorMode;
|
||||
caf::PdmField<cvf::Color3f> m_color;
|
||||
caf::PdmField<QString> m_ensembleParameter;
|
||||
|
||||
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
|
||||
caf::PdmChildField<RimEnsembleCurveFilterCollection*> m_curveFilters;
|
||||
caf::PdmChildField<RimEnsembleStatistics*> m_statistics;
|
||||
|
||||
caf::PdmField<bool> m_isUsingAutoName;
|
||||
caf::PdmField<QString> m_userDefinedName;
|
||||
caf::PdmProxyValueField<QString> m_autoGeneratedName;
|
||||
|
||||
caf::PdmPtrField<RimEnsembleWellLogs*> m_ensembleWellLogs;
|
||||
caf::PdmField<QString> m_wellLogChannelName;
|
||||
|
||||
QwtPlotCurve* m_qwtPlotCurveForLegendText;
|
||||
QPointer<RiuDraggableOverlayFrame> m_legendOverlayFrame;
|
||||
QPointer<RiuDraggableOverlayFrame> m_filterOverlayFrame;
|
||||
|
||||
std::unique_ptr<RimEnsembleWellLogStatistics> m_ensembleWellLogStatistics;
|
||||
|
||||
bool m_disableStatisticCurves;
|
||||
bool m_isCurveSetFiltered;
|
||||
};
|
@ -0,0 +1,197 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimEnsembleWellLogStatistics.h"
|
||||
|
||||
#include "RiaCurveMerger.h"
|
||||
#include "RiaWeightedMeanCalculator.h"
|
||||
|
||||
#include "RigStatisticsMath.h"
|
||||
#include "RigWellLogFile.h"
|
||||
|
||||
#include "RimWellLogFile.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RimEnsembleWellLogStatistics::StatisticsType>::setUp()
|
||||
{
|
||||
addItem( RimEnsembleWellLogStatistics::StatisticsType::P10, "P10", "P10" );
|
||||
addItem( RimEnsembleWellLogStatistics::StatisticsType::P50, "P50", "P50" );
|
||||
addItem( RimEnsembleWellLogStatistics::StatisticsType::P90, "P90", "P90" );
|
||||
addItem( RimEnsembleWellLogStatistics::StatisticsType::MEAN, "MEAN", "Mean" );
|
||||
|
||||
setDefault( RimEnsembleWellLogStatistics::StatisticsType::MEAN );
|
||||
}
|
||||
}; // namespace caf
|
||||
|
||||
RimEnsembleWellLogStatistics::RimEnsembleWellLogStatistics()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>& wellLogFiles,
|
||||
const QString& wellLogChannelName )
|
||||
{
|
||||
RiaCurveMerger<double> curveMerger;
|
||||
|
||||
RiaWeightedMeanCalculator<size_t> dataSetSizeCalc;
|
||||
|
||||
for ( RimWellLogFile* wellLogFile : wellLogFiles )
|
||||
{
|
||||
QString errorMessage;
|
||||
if ( wellLogFile->readFile( &errorMessage ) )
|
||||
{
|
||||
RigWellLogFile* fileData = wellLogFile->wellLogFileData();
|
||||
std::vector<double> depths = fileData->depthValues();
|
||||
std::vector<double> values = fileData->values( wellLogChannelName );
|
||||
if ( !depths.empty() && !values.empty() )
|
||||
{
|
||||
dataSetSizeCalc.addValueAndWeight( depths.size(), 1.0 );
|
||||
curveMerger.addCurveData( depths, values );
|
||||
}
|
||||
}
|
||||
}
|
||||
curveMerger.computeInterpolatedValues( false );
|
||||
|
||||
clearData();
|
||||
|
||||
const std::vector<double>& allDepths = curveMerger.allXValues();
|
||||
if ( !allDepths.empty() )
|
||||
{
|
||||
// Make sure we end up with approximately the same amount of points as originally
|
||||
// Since allDepths contain *valid* values, it can potentially be smaller than the mean.
|
||||
// Thus we need to ensure sizeMultiplier is at least 1.
|
||||
size_t sizeMultiplier = std::max( (size_t)1, allDepths.size() / dataSetSizeCalc.weightedMean() );
|
||||
for ( size_t depthIdx = 0; depthIdx < allDepths.size(); depthIdx += sizeMultiplier )
|
||||
{
|
||||
std::vector<double> valuesAtDepth;
|
||||
valuesAtDepth.reserve( curveMerger.curveCount() );
|
||||
for ( size_t curveIdx = 0; curveIdx < curveMerger.curveCount(); ++curveIdx )
|
||||
{
|
||||
const std::vector<double>& curveValues = curveMerger.interpolatedYValuesForAllXValues( curveIdx );
|
||||
valuesAtDepth.push_back( curveValues[depthIdx] );
|
||||
}
|
||||
double p10, p50, p90, mean;
|
||||
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean );
|
||||
|
||||
m_measuredDepths.push_back( allDepths[depthIdx] );
|
||||
m_p10Data.push_back( p10 );
|
||||
m_p50Data.push_back( p50 );
|
||||
m_p90Data.push_back( p90 );
|
||||
m_meanData.push_back( mean );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RimEnsembleWellLogStatistics::measuredDepths() const
|
||||
{
|
||||
return m_measuredDepths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RimEnsembleWellLogStatistics::tvDepths() const
|
||||
{
|
||||
return m_tvDepths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RimEnsembleWellLogStatistics::p10() const
|
||||
{
|
||||
return m_p10Data;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RimEnsembleWellLogStatistics::p50() const
|
||||
{
|
||||
return m_p50Data;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RimEnsembleWellLogStatistics::p90() const
|
||||
{
|
||||
return m_p90Data;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RimEnsembleWellLogStatistics::mean() const
|
||||
{
|
||||
return m_meanData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleWellLogStatistics::hasP10Data() const
|
||||
{
|
||||
return !m_p10Data.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleWellLogStatistics::hasP50Data() const
|
||||
{
|
||||
return !m_p50Data.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleWellLogStatistics::hasP90Data() const
|
||||
{
|
||||
return !m_p90Data.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleWellLogStatistics::hasMeanData() const
|
||||
{
|
||||
return !m_meanData.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleWellLogStatistics::clearData()
|
||||
{
|
||||
m_measuredDepths.clear();
|
||||
m_tvDepths.clear();
|
||||
m_p10Data.clear();
|
||||
m_p50Data.clear();
|
||||
m_p90Data.clear();
|
||||
m_meanData.clear();
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
class QString;
|
||||
|
||||
class RimWellLogFile;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimEnsembleWellLogStatistics
|
||||
{
|
||||
public:
|
||||
enum class StatisticsType
|
||||
{
|
||||
P10,
|
||||
P50,
|
||||
P90,
|
||||
MEAN
|
||||
};
|
||||
|
||||
RimEnsembleWellLogStatistics();
|
||||
|
||||
const std::vector<double>& measuredDepths() const;
|
||||
const std::vector<double>& tvDepths() const;
|
||||
const std::vector<double>& p10() const;
|
||||
const std::vector<double>& p50() const;
|
||||
const std::vector<double>& p90() const;
|
||||
const std::vector<double>& mean() const;
|
||||
|
||||
bool hasP10Data() const;
|
||||
bool hasP50Data() const;
|
||||
bool hasP90Data() const;
|
||||
bool hasMeanData() const;
|
||||
|
||||
void calculate( const std::vector<RimWellLogFile*>& sumCases, const QString& wellLogChannelName );
|
||||
|
||||
private:
|
||||
void clearData();
|
||||
|
||||
std::vector<double> m_measuredDepths;
|
||||
std::vector<double> m_tvDepths;
|
||||
std::vector<double> m_p10Data;
|
||||
std::vector<double> m_p50Data;
|
||||
std::vector<double> m_p90Data;
|
||||
std::vector<double> m_meanData;
|
||||
};
|
@ -0,0 +1,174 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimEnsembleWellLogStatisticsCurve.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaInterpolationTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimEnsembleWellLogCurveSet.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimEnsembleWellLogStatisticsCurve, "EnsembleWellLogStatisticsCurve" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEnsembleWellLogStatisticsCurve::RimEnsembleWellLogStatisticsCurve()
|
||||
{
|
||||
CAF_PDM_InitObject( "Ensemble Well Log Statistics Curve", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogCurveSet, "EnsembleWellLogCurveSet", "Ensemble Well Log Curve Set", "", "", "" );
|
||||
m_ensembleWellLogCurveSet.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_ensembleWellLogCurveSet.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_statisticsType, "StatisticsType", "Statistics Type", "", "", "" );
|
||||
m_statisticsType.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_wellPath = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEnsembleWellLogStatisticsCurve::~RimEnsembleWellLogStatisticsCurve()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleWellLogStatisticsCurve::setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* ensembleWellLogCurveSet )
|
||||
{
|
||||
m_ensembleWellLogCurveSet = ensembleWellLogCurveSet;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleWellLogStatisticsCurve::setStatisticsType( RimEnsembleWellLogStatistics::StatisticsType statisticsType )
|
||||
{
|
||||
m_statisticsType = statisticsType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEnsembleWellLogStatistics::StatisticsType RimEnsembleWellLogStatisticsCurve::statisticsType() const
|
||||
{
|
||||
return m_statisticsType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleWellLogStatisticsCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
// RimWellLogExtractionCurve::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
// RimStimPlanModelPlot* ensembleWellLogCurveSetPlot;
|
||||
// firstAncestorOrThisOfTypeAsserted( ensembleWellLogCurveSetPlot );
|
||||
|
||||
// if ( ensembleWellLogCurveSetPlot )
|
||||
// {
|
||||
// ensembleWellLogCurveSetPlot->loadDataAndUpdate();
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseudoLength )
|
||||
{
|
||||
std::vector<double> values;
|
||||
std::vector<double> measuredDepthValues;
|
||||
std::vector<double> tvDepthValues;
|
||||
double rkbDiff = 0.0;
|
||||
|
||||
// TODO: get if from the file???
|
||||
RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_FEET; // METER;
|
||||
QString xUnits = RiaWellLogUnitTools<double>::noUnitString();
|
||||
|
||||
*isUsingPseudoLength = false;
|
||||
|
||||
if ( m_ensembleWellLogCurveSet )
|
||||
{
|
||||
const RimEnsembleWellLogStatistics* ensembleWellLogStatistics =
|
||||
m_ensembleWellLogCurveSet->ensembleWellLogStatistics();
|
||||
|
||||
if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::MEAN )
|
||||
{
|
||||
values = ensembleWellLogStatistics->mean();
|
||||
measuredDepthValues = ensembleWellLogStatistics->measuredDepths();
|
||||
}
|
||||
else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P10 )
|
||||
{
|
||||
values = ensembleWellLogStatistics->mean();
|
||||
measuredDepthValues = ensembleWellLogStatistics->measuredDepths();
|
||||
}
|
||||
else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P50 )
|
||||
{
|
||||
values = ensembleWellLogStatistics->p50();
|
||||
measuredDepthValues = ensembleWellLogStatistics->measuredDepths();
|
||||
}
|
||||
else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P90 )
|
||||
{
|
||||
values = ensembleWellLogStatistics->p90();
|
||||
measuredDepthValues = ensembleWellLogStatistics->measuredDepths();
|
||||
}
|
||||
|
||||
// RiaDefines::EclipseUnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
|
||||
// if ( eclipseUnitsType == RiaDefines::EclipseUnitSystem::UNITS_FIELD )
|
||||
// {
|
||||
// // See https://github.com/OPM/ResInsight/issues/538
|
||||
|
||||
// depthUnit = RiaDefines::DepthUnitType::UNIT_FEET;
|
||||
// }
|
||||
}
|
||||
|
||||
bool performDataSmoothing = false;
|
||||
if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() )
|
||||
{
|
||||
this->setValuesAndDepths( values,
|
||||
measuredDepthValues,
|
||||
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
||||
rkbDiff,
|
||||
depthUnit,
|
||||
!performDataSmoothing,
|
||||
xUnits );
|
||||
// this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit,
|
||||
// !performDataSmoothing, xUnits );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimEnsembleWellLogStatisticsCurve::createCurveAutoName()
|
||||
{
|
||||
return caf::AppEnum<RimEnsembleWellLogStatistics::StatisticsType>::uiText( m_statisticsType() );
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimEnsembleWellLogStatistics.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimEnsembleWellLogCurveSet;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimEnsembleWellLogStatisticsCurve : public RimWellLogExtractionCurve
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimEnsembleWellLogStatisticsCurve();
|
||||
~RimEnsembleWellLogStatisticsCurve() override;
|
||||
|
||||
void setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* ensembleWellLogCurveSet );
|
||||
|
||||
void setStatisticsType( RimEnsembleWellLogStatistics::StatisticsType );
|
||||
RimEnsembleWellLogStatistics::StatisticsType statisticsType() const;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
void performDataExtraction( bool* isUsingPseudoLength ) override;
|
||||
|
||||
QString createCurveAutoName() override;
|
||||
|
||||
caf::PdmPtrField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
|
||||
caf::PdmField<caf::AppEnum<RimEnsembleWellLogStatistics::StatisticsType>> m_statisticsType;
|
||||
};
|
@ -51,3 +51,19 @@ void RimEnsembleWellLogs::addWellLogFile( RimWellLogFile* summaryCase )
|
||||
{
|
||||
m_wellLogFiles.push_back( summaryCase );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogFile*> RimEnsembleWellLogs::wellLogFiles() const
|
||||
{
|
||||
return m_wellLogFiles().childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleWellLogs::hasEnsembleParameters() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -36,6 +36,10 @@ public:
|
||||
void removeWellLogFile( RimWellLogFile* wellLogFile );
|
||||
void addWellLogFile( RimWellLogFile* wellLogFile );
|
||||
|
||||
std::vector<RimWellLogFile*> wellLogFiles() const;
|
||||
|
||||
bool hasEnsembleParameters() const;
|
||||
|
||||
protected:
|
||||
void updateReferringCurveSets();
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "RimColorLegendItem.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEnsembleWellLogCurveSet.h"
|
||||
#include "RimFishbones.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
@ -269,6 +270,14 @@ RimWellLogTrack::RimWellLogTrack()
|
||||
m_resultDefinition.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_resultDefinition = new RimEclipseResultDefinition;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogCurveSet,
|
||||
"EnsembleWellLogCurveSet",
|
||||
"Ensemble Well Logs Curve Set",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
m_ensembleWellLogCurveSet = new RimEnsembleWellLogCurveSet;
|
||||
|
||||
m_formationsForCaseWithSimWellOnly = false;
|
||||
}
|
||||
|
||||
@ -1034,6 +1043,9 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
|
||||
{
|
||||
RimTools::colorLegendOptionItems( &options );
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_ensembleWellLogCurveSet )
|
||||
{
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
@ -1799,6 +1811,8 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
||||
|
||||
componentGroup->add( &m_wellPathComponentSource );
|
||||
|
||||
uiOrdering.add( &m_ensembleWellLogCurveSet );
|
||||
|
||||
uiOrderingForXAxisSettings( uiOrdering );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
|
@ -57,6 +57,7 @@ class RigFemResultAddress;
|
||||
class RigWellLogExtractor;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimColorLegend;
|
||||
class RimEnsembleWellLogCurveSet;
|
||||
|
||||
class QwtPlotCurve;
|
||||
|
||||
@ -345,6 +346,7 @@ private:
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;
|
||||
caf::PdmField<double> m_overburdenHeight;
|
||||
caf::PdmField<double> m_underburdenHeight;
|
||||
caf::PdmChildField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
|
||||
|
||||
std::vector<std::unique_ptr<RiuWellPathComponentPlotItem>> m_wellPathAttributePlotObjects;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user