Array processing kernel. More...
#include <ArrayProcess.h>
Public Member Functions | |
const FrequencyBand & | frequency () const |
bool | lockTimeWindow (const TimeRange *win) |
const ArrayParameters * | parameters () 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 ArrayParameters * | takeParameters () |
TimeRangeList * | timeRangeList () |
const TimeRangeList * | timeRangeList () const |
void | unlockTimeWindow () |
virtual | ~ArrayProcess () |
Protected Member Functions | |
ArrayProcess () | |
bool | setParameters (const ArrayParameters *param, bool doNSampleWarning=true) |
Protected Attributes | |
double | _horizontalDirection |
QList< StationProcessSignals * > | _stations |
Array processing kernel.
Must be initialized with setTimeRangeList().
ArrayCore::ArrayProcess::~ArrayProcess | ( | ) | [virtual] |
Description of destructor still missing
References _stations, TRACE, and unlockTimeWindow().
{ TRACE; unlockTimeWindow(); qDeleteAll(_stations); delete _keep; _keep=0; delete _parameters; delete _timeRangeList; }
ArrayCore::ArrayProcess::ArrayProcess | ( | ) | [protected] |
const FrequencyBand& ArrayCore::ArrayProcess::frequency | ( | ) | const [inline] |
Referenced by FKTimeWindows::currentVelocitySlowness(), FKLoopTask::exportMax(), FKLoopTask::exportResults(), HRFKLoopTask::getPower(), FKLoopTask::getPower(), FKTimeWindows::on_kEdit_valueChanged(), FKTimeWindows::on_vEdit_valueChanged(), SPACLoopTask::run(), HRFKTimeWindows::setComponent(), FKTimeWindows::setComponent(), FKTimeWindows::setGrid(), and ArrayCore::SPACStationSignals::setProcessed().
{return _frequency;}
bool ArrayCore::ArrayProcess::lockTimeWindow | ( | const TimeRange * | win | ) |
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; }
const ArrayParameters* ArrayCore::ArrayProcess::parameters | ( | ) | const [inline] |
Reimplemented in ArrayCore::FKArrayProcess, ArrayCore::HRFKArrayProcess, and ArrayCore::SPACArrayProcess.
{return _parameters;}
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; }
void ArrayCore::ArrayProcess::setHorizontalDirection | ( | double | az | ) | [inline] |
Referenced by FKTimeWindows::setComponent().
{_horizontalDirection=az;}
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; }
void ArrayCore::ArrayProcess::setTimeRangeList | ( | TimeRangeList * | rl | ) | [inline] |
Referenced by HRFKTimeWindows::setArray(), FKTimeWindows::setArray(), HRFKLoopTask::setArray(), FKLoopTask::setArray(), and SPACLoopTask::setArray().
{_timeRangeList=rl;}
const QList<StationProcessSignals *>& ArrayCore::ArrayProcess::stations | ( | ) | const [inline] |
Referenced by ArrayCore::HRFKArrayProcess::function(), ArrayCore::FKArrayProcess::function(), FKLoopTask::setParameters(), and SPACLoopTask::setParameters().
{return _stations;}
References TRACE.
Referenced by FKLoopTask::~FKLoopTask(), and SPACLoopTask::~SPACLoopTask().
{ TRACE; const ArrayParameters * param=_parameters; _parameters=0; return param; }
TimeRangeList* ArrayCore::ArrayProcess::timeRangeList | ( | ) | [inline] |
Referenced by LinearFKPassiveLoopTask::run(), FKLoopTask::run(), SPACLoopTask::run(), HRFKTimeWindows::setComponent(), FKTimeWindows::setComponent(), FKTimeWindows::setCurrentWindow(), and FKTimeWindows::timeWindowList().
{return _timeRangeList;}
const TimeRangeList* ArrayCore::ArrayProcess::timeRangeList | ( | ) | const [inline] |
{return _timeRangeList;}
Can be called only after a successful lockTimeWindow().
References _stations.
Referenced by lockTimeWindow(), LinearFKPassiveLoopTask::run(), FKLoopTask::run(), SPACLoopTask::run(), and ~ArrayProcess().
double ArrayCore::ArrayProcess::_horizontalDirection [protected] |
Referenced by ArrayCore::FKArrayProcess::function().
QList<StationProcessSignals *> ArrayCore::ArrayProcess::_stations [protected] |