Public Member Functions | Static Public Member Functions
ShotRecord Class Reference

Brief description of class still missing. More...

#include <ShotRecord.h>

Inheritance diagram for ShotRecord:
GeopsyCore::SubSignalPool

List of all members.

Public Member Functions

double deltaT () const
bool isSameReceiverSet (const ShotRecord &o) const
int nReceivers () const
int nSamples () const
int receiverIndex (double distance) const
void revert ()
void setSignals (const SubSignalPool &subPool, int &index)
void setT0 (double t)
 ShotRecord ()
double t0 () const
 ~ShotRecord ()

Static Public Member Functions

static bool organizeSubPool (SubSignalPool *subPool)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description still missing

References GeopsyCore::SignalProcess::setCurrentSubPool(), and TRACE.

{
  TRACE;
  _process=new SignalProcess;
  _process->setCurrentSubPool(this);
}

Description still missing

References TRACE.

{
  TRACE;
  delete _process;
}

Member Function Documentation

double ShotRecord::deltaT ( ) const [inline]
bool ShotRecord::isSameReceiverSet ( const ShotRecord o) const

References GeopsyCore::SubSignalPool::at(), GeopsyCore::SubSignalPool::count(), GeopsyCore::Signal::receiver(), and TRACE.

Referenced by ToolNR::initStations().

{
  TRACE;
  if(count()!=o.count()) return false;
  for(int i =count()-1; i>=0; i-- ) {
    if(at(i)->receiver()!=o.at(i)->receiver()) return false;
  }
  return true;
}
int ShotRecord::nReceivers ( ) const [inline]
int ShotRecord::nSamples ( ) const [inline]
bool ShotRecord::organizeSubPool ( SubSignalPool subPool) [static]

Description still missing

References GeopsyCore::SubSignalPool::begin(), GeopsyCore::Signal::compare(), GeopsyCore::DoubleSignal::deltaT(), GeopsyCore::SubSignalPool::end(), MSG_ID, nSamples(), GeopsyCore::SignalTemplate< sampleType >::nSamples(), GeopsyCore::Signal::receiver(), GeopsyCore::SubSignalPool::sort(), GeopsyCore::Signal::source(), GeopsyCore::Signal::t0(), GeopsyCore::Signal::timeReference(), QGpCoreTools::tr(), and TRACE.

Referenced by ToolNR::initStations().

{
  TRACE;
  SortKey::clear();
  SortKey::add(MetaDataFactory::TimeReference);
  SortKey::add(MetaDataFactory::SourceReceiverRoughAzimuth);
  SortKey::add(MetaDataFactory::SourceReceiverDistance);
  subPool->sort();
  // Consistency checks : source, deltaT and T0 compatibility
  SubSignalPool::iterator itPool=subPool->begin();
  Signal * refSig=*itPool;
  QDateTime refTR=refSig->timeReference();
  Point refRec=refSig->receiver();
  Point refSrc=refSig->source();
  double refDt=refSig->deltaT();
  double refT0=refSig->t0();
  int nSamples=refSig->nSamples();
  SortKey::clear();
  SortKey::add(MetaDataFactory::SourceReceiverRoughAzimuth);
  for( ++itPool;itPool!=subPool->end();++itPool) {
    Signal * sig=*itPool;
    if(refTR!=sig->timeReference() || sig->compare(*refSig)!=0) {
      refTR=sig->timeReference();
      refT0=sig->t0();
    } else if(refRec==sig->receiver()) {
      Message::warning(MSG_ID, tr("Gathering shot records"),
                            tr("More than one signal per receiver detected. Make sure that the time reference is "
                               "different for all individual shot. Suggestion: set preferences for loading signals to \"No common "
                               " time reference\" and \"Set \"Rxxx\" as name\"." ),
                            Message::cancel());
      return false;
    }
    if(refDt!=sig->deltaT() ||
          refT0!=sig->t0() ||
          nSamples!=sig->nSamples() ||
          refSrc!=sig->source()) {
      Message::warning(MSG_ID, tr("Gathering shot records"),
                            tr("The sampling rate, the T0, the number of samples, "
                               "and the source coordinates must be the same for all signals." ),
                            Message::cancel());
      return false;
    }
    refRec=sig->receiver();
  }
  return true;
}
int ShotRecord::receiverIndex ( double  distance) const

Return the receiver index with a receiver-source distance just less than distance.

References GeopsyCore::SubSignalPool::at(), GeopsyCore::SubSignalPool::count(), and TRACE.

{
  TRACE;
  for(int i=count()-1; i>=0; i-- ) {
    if(at(i)->sourceReceiverDistance() < distance) return i;
  }
  return -1;
}
void ShotRecord::setSignals ( const SubSignalPool subPool,
int &  index 
)

References GeopsyCore::SubSignalPool::addSignal(), GeopsyCore::SubSignalPool::at(), GeopsyCore::SubSignalPool::count(), GeopsyCore::SubSignalPool::setName(), GeopsyCore::Signal::timeReference(), and TRACE.

Referenced by ToolNR::initStations().

{
  TRACE;
  Signal * sig=subPool.at(index);
  QDateTime refTR=sig->timeReference();
  for(; index<subPool.count();index++) {
    sig=subPool.at(index);
    if(sig->timeReference()!=refTR) break;
    addSignal(sig);
  }
  setName(refTR.toString("hhmmss"));
}
void ShotRecord::setT0 ( double  t)

References GeopsyCore::SignalProcess::shift(), t0(), and TRACE.

{
  TRACE;
  _process->shift(t0() - t);
}
double ShotRecord::t0 ( ) const [inline]

References GeopsyCore::SubSignalPool::first(), and GeopsyCore::Signal::t0().

Referenced by setT0().

{return first()->t0();}

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