All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
ArrayCore::ArrayProcess Class Reference

Array processing kernel. More...

#include <ArrayProcess.h>

Inheritance diagram for ArrayCore::ArrayProcess:
QGpCoreTools::AbstractParameters ArrayCore::FKArrayProcess ArrayCore::SPACArrayProcess ArrayCore::HRFKArrayProcess

List of all members.

Public Member Functions

const FrequencyBandfrequency () const
bool lockTimeWindow (const TimeRange *win)
const ArrayParametersparameters () const
bool setFrequency (double f, QString *log=0)
bool setFrequency (int iOmega, QString *log=0, QString *status=0)
void setHorizontalDirection (double az)
void setTimeRangeList (TimeRangeList *rl)
const QList
< StationProcessSignals * > & 
stations () const
const ArrayParameterstakeParameters ()
TimeRangeListtimeRangeList ()
const TimeRangeListtimeRangeList () const
void unlockTimeWindow ()
virtual ~ArrayProcess ()

Protected Member Functions

 ArrayProcess ()
bool setParameters (const ArrayParameters *param, bool doNSampleWarning=true)

Protected Attributes

double _horizontalDirection
QList< StationProcessSignals * > _stations

Detailed Description

Array processing kernel.

Must be initialized with setTimeRangeList().


Constructor & Destructor Documentation

Description of destructor still missing

References _stations, TRACE, and unlockTimeWindow().

{
  TRACE;
  unlockTimeWindow();
  qDeleteAll(_stations);
  delete _keep;
  _keep=0;
  delete _parameters;
  delete _timeRangeList;
}

Description of constructor still missing

References TRACE.

{
  TRACE;
  _keep=0;
  _parameters=0;
  _signalsLocked=false;
  _timeRangeList=0;
}

Member Function Documentation

Calculate processed signals (filter, fft, offset removal, taper,...) on time window win and lock this signals for all stations of the array. If successful, you must call unlockTimeWindow() to release the memory. Calling unlockTimeWindow() is not mandatory even between two successive calls.

References _stations, GeopsyCore::StationProcessSignals::lockSamples(), GeopsyCore::StationProcessSignals::setProcessed(), and unlockTimeWindow().

Referenced by LinearFKPassiveLoopTask::run(), FKLoopTask::run(), SPACLoopTask::run(), and FKTimeWindows::setCurrentWindow().

{
  // Make sure nothing is currently locked
  unlockTimeWindow();
  StationProcessSignals * stat;
  int n=_stations.count();
  for(int i=0; i<n; i++ ) {
    stat=_stations.at(i);
    stat->setProcessed( *win, this);
    if( !stat->lockSamples()) {
      for(i--;i>=0;i--) _stations.at(i)->unlockSamples();
      return false;
    }
  }
  _signalsLocked=true;
  return true;
}
bool ArrayCore::ArrayProcess::setFrequency ( double  f,
QString *  log = 0 
)

Calculate the list of time windows for a given frequency f.

References GeopsyCore::TimeRangeList::add(), GeopsyCore::TimeRangeList::clear(), QGpCoreTools::endl(), QGpCoreTools::log(), GeopsyCore::WindowingParameters::maximumLength(), GeopsyCore::SparseTimeRange::range(), ArrayCore::FrequencyBand::setCenter(), GeopsyCore::SparseKeepSignal::timeRange(), QGpCoreTools::tr(), and ArrayCore::ArrayParameters::windowing().

Referenced by LinearFKPassiveLoopTask::run(), FKLoopTask::run(), SPACLoopTask::run(), setFrequency(), and FKTimeWindows::setParameters().

{
  ASSERT(_keep);
  _frequency.setCenter(f);
  _timeRangeList->clear();
  if(_parameters->windowing().maximumLength(f)==0.0) {
    if(log) {
      (*log) += tr("Null time window length at %1 Hz\n").arg(f);
    } else {
      App::stream() << tr("Null time window length at %1 Hz").arg(f) << endl;
    }
    return false;
  }
  _timeRangeList->add(f, _parameters->windowing(), *_keep, _keep->timeRange().range(), log);
  return true;
}
bool ArrayCore::ArrayProcess::setFrequency ( int  iOmega,
QString *  log = 0,
QString *  status = 0 
)

Calculate the list of time windows. Frequency is set from the frequency sampling at index iOmega.

References QGpCoreTools::SamplingParameters::count(), GeopsyCore::TimeRangeList::count(), ArrayCore::ArrayParameters::frequencySampling(), GeopsyCore::WindowingParameters::maximumLength(), GeopsyCore::WindowingParameters::minimumLength(), setFrequency(), QGpCoreTools::tr(), TRACE, QGpCoreTools::SamplingParameters::value(), and ArrayCore::ArrayParameters::windowing().

{
  TRACE;
  double f=_parameters->frequencySampling().value(iOmega);
  if(!setFrequency(f, log)) return false;
  const WindowingParameters& winParam=_parameters->windowing();
  int nWin=_timeRangeList->count();
  if(log) {
    (*log) += tr("Frequency %1/%2 %3\n")
              .arg(_parameters->frequencySampling().count()-iOmega)
              .arg(_parameters->frequencySampling().count())
              .arg(f);
    (*log) += tr("Min Window length %1 seconds\n").arg(winParam.minimumLength(f));
    (*log) += tr("Max Window length %1 seconds\n").arg(winParam.maximumLength(f));
    (*log) += tr(" %1 Time windows\n").arg(nWin);
  }
  if(status) {
    (*status)=tr("%1/%2 %3 Hz, %4 windows")
                   .arg(_parameters->frequencySampling().count()-iOmega)
                   .arg(_parameters->frequencySampling().count())
                   .arg(f)
                   .arg(nWin);
  }
  return true;
}
bool ArrayCore::ArrayProcess::setParameters ( const ArrayParameters param,
bool  doNSampleWarning = true 
) [protected]

References ArrayCore::ArrayParameters::frequencyBandWidth(), ArrayCore::FrequencyBand::setRelativeWidth(), and TRACE.

{
  TRACE;
  delete _parameters;
  _parameters=param;
  _frequency.setRelativeWidth(_parameters->frequencyBandWidth());
  if(!setTimeLimits(doNSampleWarning)) return false;
  setGlobalKeep();
  return true;
}
const QList<StationProcessSignals *>& ArrayCore::ArrayProcess::stations ( ) const [inline]

References TRACE.

Referenced by FKLoopTask::~FKLoopTask(), and SPACLoopTask::~SPACLoopTask().

{
  TRACE;
  const ArrayParameters * param=_parameters;
  _parameters=0;
  return param;
}
{return _timeRangeList;}

Can be called only after a successful lockTimeWindow().

References _stations.

Referenced by lockTimeWindow(), LinearFKPassiveLoopTask::run(), FKLoopTask::run(), SPACLoopTask::run(), and ~ArrayProcess().

{
  if(_signalsLocked) {
    QList<StationProcessSignals *>::iterator it;
    for(it=_stations.begin();it!=_stations.end();++it) (*it)->unlockSamples();
    _signalsLocked=false;
  }
}

Member Data Documentation


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