Public Member Functions | Protected Member Functions
T0Correlation Class Reference

Brief description of class still missing. More...

#include <T0Correlation.h>

Inheritance diagram for T0Correlation:
QGpCoreTools::AbstractFunction2

List of all members.

Public Member Functions

void setReceiverRange (int minRecIndex, int maxRecIndex)
void setTimeLimits (const TimeRangeParameters &timeLimits)
 T0Correlation (ShotRecord *refShot, ShotRecord *shot)
virtual double value (double x, double, int) const
virtual double value (double x, double) const

Protected Member Functions

double correlationInterpolate (double t0)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

T0Correlation::T0Correlation ( ShotRecord refShot,
ShotRecord shot 
)

Description of constructor still missing

References ShotRecord::nReceivers(), and TRACE.

{
  TRACE;
  _refShot=refShot;
  _shot=shot;
  _minRecIndex=0;
  _maxRecIndex=_refShot->nReceivers()-1;
}

Member Function Documentation

double T0Correlation::correlationInterpolate ( double  t0) [protected]
void T0Correlation::setReceiverRange ( int  minRecIndex,
int  maxRecIndex 
)

References ShotRecord::nReceivers(), and TRACE.

Referenced by ToolNR::t0Apply().

{
  TRACE;
  int nReceivers=_refShot->nReceivers();
  _minRecIndex=minRecIndex;
  if(_minRecIndex<0) _minRecIndex=0;
  else if(_minRecIndex>=nReceivers) _minRecIndex=nReceivers-1;
  _maxRecIndex=maxRecIndex;
  if(_maxRecIndex<0) _maxRecIndex=0;
  else if(_maxRecIndex>=nReceivers) _maxRecIndex=nReceivers-1;
  if(_minRecIndex > _maxRecIndex) {
    int tmp=_minRecIndex;
    _minRecIndex=_maxRecIndex;
    _maxRecIndex=tmp;
  }
}
void T0Correlation::setTimeLimits ( const TimeRangeParameters timeLimits) [inline]

Referenced by ToolNR::t0Apply().

{_timeLimits=timeLimits;}
double T0Correlation::value ( double  x,
double  ,
int   
) const [virtual]

Fast but imprecise shift: shift only multiples of deltaT

Reimplemented from QGpCoreTools::AbstractFunction2.

References GeopsyCore::TimeRangeParameters::absoluteRange(), GeopsyCore::SubSignalPool::at(), GeopsyCore::Signal::correlation(), GeopsyCore::Signal::maximumAmplitude(), GeopsyCore::Signal::setT0(), GeopsyCore::Signal::t0(), and TRACE.

{
  TRACE;
  double globalCorr=0.0;
  for(int i=_minRecIndex; i<=_maxRecIndex; i++) {
    Signal * shotSig=_shot->at(i);
    const Signal * refShotSig=_refShot->at(i);
    double saveT0=shotSig->t0();
    shotSig->setT0(x);
    TimeRange tw=_timeLimits.absoluteRange(shotSig);
    double norm=1.0/refShotSig->maximumAmplitude();
    globalCorr += shotSig->correlation(refShotSig, tw)*norm*norm;
    shotSig->setT0(saveT0);
  }
  return globalCorr;
}
double T0Correlation::value ( double  x,
double   
) const [virtual]

Slow but precise shift: shift by arbitrary time

Implements QGpCoreTools::AbstractFunction2.

References GeopsyCore::TimeRangeParameters::absoluteRange(), GeopsyCore::SubSignalPool::at(), GeopsyCore::DoubleSignal::copySamplesFrom(), GeopsyCore::DoubleSignal::correlation(), GeopsyCore::TimeRange::lengthSeconds(), GeopsyCore::Signal::maximumAmplitude(), GeopsyCore::DoubleSignal::shift(), GeopsyCore::TimeRange::start(), GeopsyCore::Signal::t0(), and TRACE.

{
  TRACE;
  double globalCorr=0.0;
  for(int i=_minRecIndex; i<=_maxRecIndex; i++) {
    const Signal * refShotSig=_refShot->at(i);
    const Signal * shotSig=_shot->at(i);
    DoubleSignal * shiftShotSig=new DoubleSignal(*shotSig);
    shiftShotSig->copySamplesFrom(shotSig);
    shiftShotSig->shift(shotSig->t0() - x);
    TimeRange tw=_timeLimits.absoluteRange(shotSig);
    double norm=1.0/refShotSig->maximumAmplitude();
    globalCorr += shiftShotSig->correlation(refShotSig, tw.start()-refShotSig->t0(),
                                                         tw.start()-shotSig->t0(),
                                                         tw.lengthSeconds())*norm*norm;
    delete shiftShotSig;
  }
  return globalCorr;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines