[OpendTect_Developers] help with StepInterval and extracting log values in msec
Marcio Weck
marcio.weck at gmail.com
Fri Apr 8 00:13:33 CEST 2011
Dear all,
My question is about extrating Log values with time in msec.
I learned from Tutorial plugin how to extract well log values, but I need to
extract the step interval in time too. So, I looked for, how OpendTect
exports the Log data and I found that (quoted only the parts relative to
time values):
*uiExportLogs::writeLogs( StreamData& sdo )
{
...
float md = intv.atIndex( idx );
if ( zinft ) md *= mFromFeetFactor;
...
else if ( inmsec ) z = wd.d2TModel()->getTime( md ) * 1000;
...
}
void uiExportLogs::setDefaultRange( bool zinft )
{
StepInterval<float> dahintv;
for ( int idx=0; idx<wd.logs().size(); idx++ )
{
const Well::Log& log = wd.logs().getLog(idx);
const int logsz = log.size();
if ( !logsz ) continue;
dahintv.setFrom( wd.logs().dahInterval() );
const float width = log.dah(logsz-1) - log.dah(0);
dahintv.step = width / (logsz-1);
break;
}
if ( zinft )
{
dahintv.start *= mToFeetFactor;
dahintv.stop *= mToFeetFactor;
dahintv.step *= mToFeetFactor;
}
zrangefld->setValue( dahintv );
}
*
and I did that:
for each well::data I create and configure a StepInterval<float> using the
same code from uiExportLogs::setDefaultRange( bool zinft ), and I tried to
follow the same principle from uiExportLogs::writeLogs(StreamData & sdo).
ps: FStepIntv is a StepInterval<float> and configured using "my
setDefaultRange(bool zinft)" some steps before.
*std::cout << "handling logs" << std:: endl;
const int nsteps = FStepIntv_->nrSteps();
bool zinft = SI().depthsInFeetByDefault();
...
TypeSet<float> inplogtrc;
TypeSet<float> logtime;
float z =0.0, v =0.0;
for ( int i=0 ; i < nsteps; i++ ){
float md = FStepIntv_->atIndex( i );
if ( zinft ) md *= mFromFeetFactor;
z = wdlist_[wID]->d2TModel()->getTime( md );
v = inplog_->getValue( md );
if ( mIsUdf(v) ) continue;
logtime.add( z*1000 ); // in msec
inplogtrc.add( v );
...
// my setDefaultRange
void setDefaultRange( bool zinft )
{
delete FStepIntv_; FStepIntv_ = 0;
FStepIntv_ = new StepInterval<float>();
Well::Data& wd = *wdlist_[wID];
for ( int idx=0; idx<wd.logs().size(); idx++ )
{
const Well::Log& log = wd.logs().getLog(idx);
const int logsz = log.size();
if ( !logsz ) continue;
FStepIntv_->setFrom( wd.logs().dahInterval() );
const float width = log.dah(logsz-1) - log.dah(0);
FStepIntv_->step = width / (logsz-1);
break;
}
if ( zinft ) {
FStepIntv_->start *= mToFeetFactor;
FStepIntv_->stop *= mToFeetFactor;
FStepIntv_->step *= mToFeetFactor;
}
}
*
For some wells, the time became -inf but for the most it works. Am I doing
this correctly? Is there another way to extract the log value with time in
msec? I'm using all the wells from F3 demo to test.
Best Regards,
Márcio Weck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20110407/62a35c5a/attachment.html>
More information about the Developers
mailing list