Add action for downloading and parsing well log from OSDU Wellbore DDMS.

This commit is contained in:
Kristian Bendiksen
2024-05-27 11:24:00 +02:00
parent 5be47b3d2c
commit 23d716754e
20 changed files with 1094 additions and 46 deletions

View File

@@ -99,6 +99,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RigWellResultFrame.h
${CMAKE_CURRENT_LIST_DIR}/RigReservoirBuilder.h
${CMAKE_CURRENT_LIST_DIR}/RigVfpTables.h
${CMAKE_CURRENT_LIST_DIR}/RigOsduWellLogData.h
)
set(SOURCE_GROUP_SOURCE_FILES
@@ -196,6 +197,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RigDeclineCurveCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RigReservoirBuilder.cpp
${CMAKE_CURRENT_LIST_DIR}/RigVfpTables.cpp
${CMAKE_CURRENT_LIST_DIR}/RigOsduWellLogData.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})

View File

@@ -0,0 +1,152 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024- 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 "RigOsduWellLogData.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigOsduWellLogData::RigOsduWellLogData()
: RigWellLogData()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigOsduWellLogData::~RigOsduWellLogData()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RigOsduWellLogData::wellLogChannelNames() const
{
QStringList channelNames;
for ( const auto& channelPair : m_values )
{
channelNames << channelPair.first;
}
return channelNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigOsduWellLogData::depthValues() const
{
return values( m_depthLogName );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigOsduWellLogData::tvdMslValues() const
{
return values( m_tvdMslLogName );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigOsduWellLogData::tvdRkbValues() const
{
// Not supported
return std::vector<double>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigOsduWellLogData::setValues( const QString& name, const std::vector<double>& values )
{
m_values[name] = values;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigOsduWellLogData::values( const QString& name ) const
{
if ( auto it = m_values.find( name ); it != m_values.end() ) return it->second;
return std::vector<double>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigOsduWellLogData::hasTvdMslChannel() const
{
return !m_tvdMslLogName.isEmpty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigOsduWellLogData::hasTvdRkbChannel() const
{
return !m_tvdRkbLogName.isEmpty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigOsduWellLogData::depthUnitString() const
{
return wellLogChannelUnitString( m_tvdMslLogName );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigOsduWellLogData::wellLogChannelUnitString( const QString& wellLogChannelName ) const
{
auto unit = m_units.find( wellLogChannelName );
if ( unit != m_units.end() )
return unit->second;
else
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigOsduWellLogData::getMissingValue() const
{
return std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigOsduWellLogData::finalizeData()
{
for ( auto [columnName, values] : m_values )
{
if ( columnName.toUpper() == "TVDMSL" || columnName.toUpper().contains( "TVD" ) )
{
m_tvdMslLogName = columnName;
}
else if ( columnName.toUpper() == "DEPTH" )
{
m_depthLogName = "DEPTH";
}
}
}

View File

@@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024- 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 "RigWellLogData.h"
#include "RiaDefines.h"
#include <QStringList>
#include <map>
#include <vector>
class RimWellLogCurve;
//==================================================================================================
///
//==================================================================================================
class RigOsduWellLogData : public RigWellLogData
{
public:
RigOsduWellLogData();
~RigOsduWellLogData() override;
QStringList wellLogChannelNames() const override;
std::vector<double> depthValues() const override;
std::vector<double> tvdMslValues() const override;
std::vector<double> tvdRkbValues() const override;
void setValues( const QString& name, const std::vector<double>& values );
std::vector<double> values( const QString& name ) const override;
QString wellLogChannelUnitString( const QString& wellLogChannelName ) const override;
bool hasTvdMslChannel() const override;
bool hasTvdRkbChannel() const override;
double getMissingValue() const override;
void finalizeData();
private:
QString depthUnitString() const override;
QString m_depthLogName;
QString m_tvdMslLogName;
QString m_tvdRkbLogName;
std::map<QString, std::vector<double>> m_values;
std::map<QString, QString> m_units;
};