Brief description of class still missing. More...
#include <StationProcessSignals.h>
Classes | |
class | ComponentSignals |
Public Member Functions | |
bool | lockSamples () |
int | nComponents () const |
const StationSignals * | originalSignals () const |
DoubleSignal * | processed (int iComp) const |
DoubleSignal *& | processed (int iComp) |
const double * | processedSamples (int iComp) |
void | setHighPassFilter (double frequency) |
virtual void | setProcessed (const TimeRange &tw, AbstractParameters *param)=0 |
StationProcessSignals (const StationSignals *originalSignals) | |
void | unlockSamples () |
virtual | ~StationProcessSignals () |
Protected Member Functions | |
void | copyOriginalSignal (int iComp, const TimeRange &tw) |
Brief description of class still missing.
Full description of class still missing
GeopsyCore::StationProcessSignals::StationProcessSignals | ( | const StationSignals * | originalSignals | ) |
Never take ownership of originalSignals
References nComponents(), and originalSignals().
{ _originals=originalSignals; _signals=new ComponentSignals[nComponents()]; }
Description of destructor still missing
References nComponents().
{ int nComp=nComponents(); for(int iComp=0; iComp<nComp; iComp++) { ComponentSignals& cs=_signals[iComp]; if(cs.merged) { qDeleteAll(*cs.merged); delete cs.merged; } if(cs.filtered) { qDeleteAll(*cs.filtered); delete cs.filtered; } delete cs.processed; } delete [] _signals; }
void GeopsyCore::StationProcessSignals::copyOriginalSignal | ( | int | iComp, |
const TimeRange & | tw | ||
) | [protected] |
Extracts a copy of original signals for component comp and for time window tw
References GeopsyCore::SubSignalPool::at(), GeopsyCore::DoubleSignal::copySamplesFrom(), GeopsyCore::Signal::copySamplesFrom(), GeopsyCore::SubSignalPool::count(), GeopsyCore::StationSignals::deltaT(), GeopsyCore::TimeRange::end(), GeopsyCore::TimeRange::lengthSeconds(), GeopsyCore::StationSignals::originals(), GeopsyCore::TimeRange::start(), GeopsyCore::Signal::t0(), TRACE, and GeopsyCore::DoubleSignal::Waveform.
Referenced by LinearFKActiveStationSignals::beginPreprocess(), StructureStationProcessSignals::setProcessed(), RealTimeStationSignals::setProcessed(), ArrayCore::SPACStationSignals::setProcessed(), MonoStation::SpectrumStationSignals::setProcessed(), ArrayCore::FKStationSignals::setProcessed(), and AcquisitionSignals::setProcessed().
{ TRACE; ComponentSignals& cs=_signals[iComp]; const SubSignalPool& originals=_originals->originals(iComp); int n=originals.count(); double dt=_originals->deltaT(); int nSamples=(int)round((tw.end()-tw.start())/dt); if(cs.processed) { cs.processed->freeSamples(); cs.processed->setNSamples(nSamples); cs.processed->setType(DoubleSignal::Waveform); cs.processed->setDeltaT(dt); } else { cs.processed=new DoubleSignal(nSamples); cs.processed->setDeltaT(dt); } // Set NULL signal cs.processed->setValue(0.0); if(cs.filtered) { for(int i=0; i<n; i++) { Signal * origSig=originals.at(i); DoubleSignal * sig=cs.filtered->at(i); cs.processed->copySamplesFrom(sig, tw.start()-origSig->t0(), 0.0, tw.lengthSeconds()); } } else { for(int i=0; i<n; i++) { Signal * sig=originals.at(i); cs.processed->copySamplesFrom(sig, tw.start()-sig->t0(), 0.0, tw.lengthSeconds()); } } }
Lock all processed signals. If successful, the samples of processed signals can be used and UNLOCK_SAMPLES must be called when signal samples are no longer necessary.
References nComponents(), processed(), TRACE, and GeopsyCore::SignalTemplate< sampleType >::unlockSamples().
Referenced by LinearFKActiveArrayStations::lockSamples(), and ArrayCore::ArrayProcess::lockTimeWindow().
{ TRACE; int nComp=nComponents(); for(int iComp=0; iComp<nComp; iComp++) { ComponentSignals& cs=_signals[iComp]; cs.processedSamples=cs.processed->constLockSamples(); if(!cs.processedSamples) { for(iComp--; iComp>=0; iComp--) _signals[iComp].processed->unlockSamples(); return false; } } return true; }
int GeopsyCore::StationProcessSignals::nComponents | ( | ) | const [inline] |
Referenced by lockSamples(), setHighPassFilter(), RealTimeStationSignals::setProcessed(), ArrayCore::SPACStationSignals::setProcessed(), ArrayCore::FKStationSignals::setProcessed(), AcquisitionSignals::setProcessed(), StationProcessSignals(), unlockSamples(), and ~StationProcessSignals().
{return _originals->nComponents();}
const StationSignals* GeopsyCore::StationProcessSignals::originalSignals | ( | ) | const [inline] |
Referenced by HVStationSignals::horizontal(), SpectrumStation::name(), HVStation::name(), StructureStation::name(), LinearFKActiveStationSignals::normalize(), SpectrumStation::save(), HVStation::save(), StructureStation::save(), ArrayCore::StationCoupleProcess::setStations(), MonoStation::AbstractStation::shortFileName(), SpectrumStation::start(), Acquisition::startStations(), StationProcessSignals(), Acquisition::stopStations(), and LinearFKActiveStationSignals::taper().
{return _originals;}
DoubleSignal* GeopsyCore::StationProcessSignals::processed | ( | int | iComp | ) | const [inline] |
Referenced by ArrayCore::FKStationSignals::absolutePower(), LinearFKActiveStationSignals::beginPreprocess(), LinearFKActiveStationSignals::endPreprocess(), ArrayCore::FKStationSignals::getShiftedSignal(), RealTimeStationSignals::getSignalSpectrum(), ArrayCore::FKStationSignals::getSignalSpectrum(), HVStationSignals::horizontal(), ArrayCore::StationCoupleProcess::horizontalAutocorr(), lockSamples(), LinearFKActiveStationSignals::normalize(), StructureStationProcessSignals::setProcessed(), RealTimeStationSignals::setProcessed(), HVStationSignals::setProcessed(), ArrayCore::SPACStationSignals::setProcessed(), MonoStation::SpectrumStationSignals::setProcessed(), ArrayCore::FKStationSignals::setProcessed(), SpectrumStation::start(), LinearFKActiveStationSignals::taper(), HVStationSignals::vertical(), and ArrayCore::StationCoupleProcess::verticalAutocorr().
{return _signals[iComp].processed;}
DoubleSignal*& GeopsyCore::StationProcessSignals::processed | ( | int | iComp | ) | [inline] |
{return _signals[iComp].processed;}
const double* GeopsyCore::StationProcessSignals::processedSamples | ( | int | iComp | ) | [inline] |
Referenced by ArrayCore::FKStationSignals::absolutePower(), ArrayCore::FKStationSignals::getShiftedSignal(), RealTimeStationSignals::getSignalSpectrum(), and ArrayCore::FKStationSignals::getSignalSpectrum().
{return _signals[iComp].processedSamples;}
void GeopsyCore::StationProcessSignals::setHighPassFilter | ( | double | frequency | ) |
If frequency is 0, no filter is performed
References GeopsyCore::SubSignalPool::at(), GeopsyCore::SubSignalPool::begin(), GeopsyCore::FilterParameters::Convolution, GeopsyCore::FilterParameters::convolutionWindow(), GeopsyCore::SubSignalPool::count(), GeopsyCore::StationSignals::deltaT(), GeopsyCore::SubSignalPool::end(), filter(), GeopsyCore::FilterParameters::HighPass, nComponents(), GeopsyCore::SignalTemplate< sampleType >::nSamples(), GeopsyCore::StationSignals::originals(), GeopsyCore::FilterParameters::setBand(), GeopsyCore::DoubleSignal::setDeltaT(), GeopsyCore::FilterParameters::setMaximumFrequency(), GeopsyCore::FilterParameters::setMethod(), GeopsyCore::FilterParameters::setMinimumFrequency(), GeopsyCore::FilterParameters::setWidth(), GeopsyCore::TaperParameters::setWindow(), TRACE, and GeopsyCore::TaperParameters::Tukey.
{ TRACE; int nComp=nComponents(); if(nComp<=0) return; if(frequency <= 0.0) { for(int iComp=0; iComp<nComp; iComp++) { ComponentSignals& cs=_signals[iComp]; if(cs.filtered) { qDeleteAll(*cs.filtered); delete cs.filtered; cs.filtered=0; } } } else { double dt=_originals->deltaT(); if(!_signals[0].merged) { // TODO merge original signals } if(!_signals[0].filtered) { // Allocate filtered signals for(int iComp=0; iComp<nComp; iComp++) { const SubSignalPool& originals=_originals->originals(iComp); ComponentSignals& cs=_signals[iComp]; cs.filtered=new QList<DoubleSignal *>; DoubleSignal * sig; for(SubSignalPool::const_iterator it=originals.begin(); it!=originals.end();it++) { Signal * origSig=*it; sig=new DoubleSignal (origSig->nSamples()); sig->setDeltaT(dt); cs.filtered->append(sig); } } } // Copy and filter, normally should be based on merged signals TODO for(int iComp=0; iComp<nComp; iComp++) { const SubSignalPool& originals=_originals->originals(iComp); ComponentSignals& cs=_signals[iComp]; FilterParameters fparam; fparam.setMinimumFrequency(frequency); fparam.setMaximumFrequency(0.0); fparam.setWidth(0.1); fparam.setBand(FilterParameters::HighPass); fparam.setMethod(FilterParameters::Convolution); fparam.convolutionWindow().setWindow(TaperParameters::Tukey); int n=originals.count(); for(int i=0; i<n; i++) { Signal * origSig=originals.at(i); (*cs.filtered)[i]->copySamplesFrom(origSig); (*cs.filtered)[i]->filter(fparam); } } } }
virtual void GeopsyCore::StationProcessSignals::setProcessed | ( | const TimeRange & | tw, |
AbstractParameters * | param | ||
) | [pure virtual] |
Implemented in AcquisitionSignals, ArrayCore::FKStationSignals, MonoStation::SpectrumStationSignals, ArrayCore::SPACStationSignals, HVStationSignals, StructureStationProcessSignals, RealTimeStationSignals, and RealTimeStationSignals.
Referenced by ArrayCore::ArrayProcess::lockTimeWindow(), SpectrumStation::start(), and StructureStation::start().
Unlock all processed signals. Can be called only after a successful LOCK_SAMPLES
References nComponents(), and TRACE.
Referenced by LinearFKActiveArrayStations::unlockSamples().
{ TRACE; int nComp=nComponents(); for(int iComp=0; iComp<nComp; iComp++) { _signals[iComp].processed->unlockSamples(); } }