#12876 Include RKB distance when importing RMSwell.

Fixes #12876.
This commit is contained in:
Kristian Bendiksen authored and Magne Sjaastad committed 2025-12-15 13:56:41 +01:00
1 parent 3d2449c361
commit 8f9b416563
5 files changed
+16 -1

No files matched your search

@@ -75,6 +75,7 @@ RifWellPathImporter::WellData RifRmsWellPathReader::readWellData( const QString&
wellData.m_name = QString::fromStdString( well->GetWellName() ); wellData.m_name = QString::fromStdString( well->GetWellName() );
wellData.m_wellPathGeometry = new RigWellPath; wellData.m_wellPathGeometry = new RigWellPath;
wellData.m_wellPathGeometry->setDatumElevation( well->GetRkb() );
for ( size_t i = 0; i < x.size(); i++ ) for ( size_t i = 0; i < x.size(); i++ )
{ {
cvf::Vec3d position( x[i], y[i], -z[i] ); cvf::Vec3d position( x[i], y[i], -z[i] );
@@ -36,6 +36,8 @@ TEST( RifRmsWellPathReader, ReadFromFile )
auto wellPath = wellData.m_wellPathGeometry; auto wellPath = wellData.m_wellPathGeometry;
ASSERT_TRUE( wellPath.notNull() ); ASSERT_TRUE( wellPath.notNull() );
ASSERT_TRUE( wellPath->hasDatumElevation() );
EXPECT_DOUBLE_EQ( 25.0, wellPath->datumElevation() );
EXPECT_EQ( 4647u, wellPath->wellPathPoints().size() ); EXPECT_EQ( 4647u, wellPath->wellPathPoints().size() );
EXPECT_EQ( 4647u, wellPath->measuredDepths().size() ); EXPECT_EQ( 4647u, wellPath->measuredDepths().size() );
} }
+6 -1
View File
@@ -49,7 +49,12 @@ RMSWell::RMSWell(const std::string& filename)
SetWellName(wellName); SetWellName(wellName);
xpos0_ = ReadNext<double>(file, line); xpos0_ = ReadNext<double>(file, line);
ypos0_ = ReadNext<double>(file, line); // read wellname and positions ypos0_ = ReadNext<double>(file, line); // read wellname and positions
// getline(file,dummy);// Line may contain a dummy number try {
rkb_ = ReadNext<double>(file, line);
} catch (std::exception &) {
// Ignore errors: not guaranteed to get rkb
}
// getline(file,dummy);// Line may contain a dummy number
//-----line shift //-----line shift
DiscardRestOfLine(file, line, false); DiscardRestOfLine(file, line, false);
nlog = ReadNext<int>(file, line); // read number of logs nlog = ReadNext<int>(file, line); // read number of logs
+3
View File
@@ -40,6 +40,7 @@ Well::Well()
{ {
well_rmissing_ = -999.0; well_rmissing_ = -999.0;
well_imissing_ = -999; well_imissing_ = -999;
rkb_ = 0.0;
} }
@@ -50,6 +51,7 @@ Well::Well(const std::string & name,
well_name_ = name; well_name_ = name;
well_rmissing_ = rmissing; well_rmissing_ = rmissing;
well_imissing_ = imissing; well_imissing_ = imissing;
rkb_ = 0.0;
} }
@@ -62,6 +64,7 @@ Well::Well(const std::map<std::string,std::vector<double> > & cont_log,
well_name_ = well_name; well_name_ = well_name;
well_rmissing_ = -999.0; well_rmissing_ = -999.0;
well_imissing_ = -999; well_imissing_ = -999;
rkb_ = 0.0;
} }
Well::~Well() Well::~Well()
+4
View File
@@ -149,6 +149,7 @@ namespace NRLib {
double GetXPos0() { return x_pos0_ ;} double GetXPos0() { return x_pos0_ ;}
double GetYPos0() { return y_pos0_ ;} double GetYPos0() { return y_pos0_ ;}
double GetRkb() { return rkb_; }
/// Set number of non-missing data /// Set number of non-missing data
void SetNumberOfNonMissingData(int n_data_nonmissing) { n_data_nonmissing_ = n_data_nonmissing ;} void SetNumberOfNonMissingData(int n_data_nonmissing) { n_data_nonmissing_ = n_data_nonmissing ;}
@@ -187,6 +188,9 @@ namespace NRLib {
// Number of data excluding WELLMISSING values // Number of data excluding WELLMISSING values
unsigned int n_data_nonmissing_; unsigned int n_data_nonmissing_;
// rig-kelly-bushing
double rkb_;
private: private:
/// Continuous logs /// Continuous logs
std::map<std::string,std::vector<double> > cont_log_; std::map<std::string,std::vector<double> > cont_log_;