[OpendTect_Developers] help with StepInterval and extracting log values in msec
Bruno Chaintreuil
bruno.chaintreuil at dgbes.com
Mon Apr 11 12:59:59 CEST 2011
Dear Marcio Weck,
> I learned from Tutorial plugin how to extract well log values, but I
> need to extract the step interval in time too [...] and I tried to
> follow the same principle from uiExportLogs::writeLogs(StreamData &
> sdo). [...] Am I doing this correctly? Is there another way to extract
> the log value with time in msec?
I think you are doing it the right way. The idea is indeed to get for a
regular depth step a time and a log value. There are different ways to
set up the depth range along which you want to extract the values, but
by asking it to the well data with
FStepIntv_->setFrom(wd.logs().dahInterval() ) you make sure it will take
the depth range from the longest well log. The crucial step here is the
depth to time conversion and in any case you have to work with the
depth/time model of the well data. This is what you do with z =
wdlist_[wID]->d2TModel()->getTime( md ). This depth/time model will
interpolate (or extrapolate) within the depth/time table to provide you
the best time conversion for each desired depth.
> For some wells, the time became -inf but for the most it works. I'm
> using all the wells from F3 demo to test.
I tried the F3 demo wells with your code and I did not have any problem.
I would say either there is something wrong with the depths of your well
logs or with the depth/time model itself (undefined or descending values
which cause a bad extraction of the time in the main loop). Please check
there are no strange values in the depth/time models of your wells (you
can access these in the well manager by pushing the depth/time model
button) and in your input logs.
Please contact me directly if this does not solve your problem,
Best Regards,
Bruno
--
Bruno Chaintreuil, MSc.
Software Engineer
dGB Earth Sciences B.V.
Nijverheidstraat 11-2, 7511 JM Enschede, The Netherlands
bruno.chaintreuil at dgbes.com
Tel: +31 534315155 , Fax: +31 534315104
http://www.dgbes.com
Marcio Weck wrote:
> 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
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developers mailing list
> Developers at opendtect.org
> http://lists.opendtect.org/mailman/listinfo/developers
>
More information about the Developers
mailing list