Files
ResInsight/ApplicationLibCode/ReservoirDataModel/Well/RigImportedWellLogData.cpp
T
Kristian Bendiksen 160cb71168 Python: Update well log import API to accept measured depth and multiple channels
- Updated Python API to accept measured_depth list and channel_data dictionary
- Modified C++ GRPC implementation to handle CSV-formatted channel mappings
- Replaced single values parameter with dictionary of channels
- Added comprehensive validation for all input parameters
- Updated parameter name from channel_keys_json to channel_keys_csv
- Enhanced tests to cover 16 different scenarios including edge cases
- Updated example to demonstrate new dictionary-based API functionality
2025-09-04 09:04:56 +02:00

164 lines
6.0 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 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 "RigImportedWellLogData.h"
#include <QStringList>
#include <cmath>
const double RigImportedWellLogData::MISSING_VALUE = -9999.0;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigImportedWellLogData::RigImportedWellLogData()
: RigWellLogData()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigImportedWellLogData::~RigImportedWellLogData()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RigImportedWellLogData::wellLogChannelNames() const
{
QStringList channelNames;
for ( const auto& channelPair : m_channelData )
{
channelNames << channelPair.first;
}
return channelNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigImportedWellLogData::depthValues() const
{
return m_depthValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigImportedWellLogData::tvdMslValues() const
{
return m_tvdMslValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigImportedWellLogData::tvdRkbValues() const
{
return m_tvdRkbValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigImportedWellLogData::values( const QString& name ) const
{
auto it = m_channelData.find( name );
if ( it != m_channelData.end() )
{
return it->second;
}
return std::vector<double>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigImportedWellLogData::wellLogChannelUnitString( const QString& wellLogChannelName ) const
{
// For imported data, assume dimensionless units
Q_UNUSED( wellLogChannelName )
return QString();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigImportedWellLogData::depthUnitString() const
{
return "M";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigImportedWellLogData::hasTvdMslChannel() const
{
return !m_tvdMslValues.empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigImportedWellLogData::hasTvdRkbChannel() const
{
return !m_tvdRkbValues.empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigImportedWellLogData::getMissingValue() const
{
return MISSING_VALUE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigImportedWellLogData::setChannelData( const QString& channelName, const std::vector<double>& values )
{
m_channelData[channelName] = values;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigImportedWellLogData::setDepthValues( const std::vector<double>& depthValues )
{
m_depthValues = depthValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigImportedWellLogData::setTvdMslValues( const std::vector<double>& tvdMslValues )
{
m_tvdMslValues = tvdMslValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigImportedWellLogData::setTvdRkbValues( const std::vector<double>& tvdRkbValues )
{
m_tvdRkbValues = tvdRkbValues;
}