#7834 Ensemble Well Logs: add depth equalization (#7914)

This commit is contained in:
Kristian Bendiksen
2021-08-30 09:18:34 +02:00
committed by GitHub
parent 2f580a0c52
commit 414ee77aa8
11 changed files with 473 additions and 10 deletions

View File

@@ -89,7 +89,8 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.h
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h)
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h
${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.h)
set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.cpp
@@ -175,7 +176,8 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.cpp
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp)
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.cpp)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})

View File

@@ -0,0 +1,72 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RigWellLogIndexDepthOffset.h"
#include <algorithm>
#include <limits>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth )
{
m_depthOffsets[kIndex] = std::pair<double, double>( topDepth, bottomDepth );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellLogIndexDepthOffset::getTopDepth( int kIndex ) const
{
auto hit = m_depthOffsets.find( kIndex );
if ( hit != m_depthOffsets.end() )
{
return hit->second.first;
}
return std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellLogIndexDepthOffset::getBottomDepth( int kIndex ) const
{
auto hit = m_depthOffsets.find( kIndex );
if ( hit != m_depthOffsets.end() )
{
return hit->second.second;
}
return std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<int> RigWellLogIndexDepthOffset::sortedIndexes() const
{
std::vector<int> indexes;
for ( auto m : m_depthOffsets )
{
indexes.push_back( m.first );
}
std::sort( indexes.begin(), indexes.end() );
return indexes;
}

View File

@@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cvfObject.h"
#include <map>
#include <vector>
class RigWellLogIndexDepthOffset : public cvf::Object
{
public:
RigWellLogIndexDepthOffset() = default;
~RigWellLogIndexDepthOffset() override = default;
void setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth );
double getTopDepth( int kIndex ) const;
double getBottomDepth( int kIndex ) const;
std::vector<int> sortedIndexes() const;
private:
std::map<int, std::pair<double, double>> m_depthOffsets;
};