Brief description of class still missing. More...
#include <SpectrumStationSignals.h>
Public Member Functions | |
virtual void | setProcessed (const TimeRange &tw, AbstractParameters *param) |
SpectrumStationSignals (const StationSignals *originalSignals) | |
Static Public Member Functions | |
static bool | organizeSubPool (SubSignalPool *subPool) |
Brief description of class still missing.
Full description of class still missing
MonoStation::SpectrumStationSignals::SpectrumStationSignals | ( | const StationSignals * | originalSignals | ) | [inline] |
: StationProcessSignals(originalSignals) {}
bool MonoStation::SpectrumStationSignals::organizeSubPool | ( | SubSignalPool * | subPool | ) | [static] |
The signals can be in any order on entry. First we sort the subpool by name+receiver coordinates, component, t0. We test if sampling rate and t0 are compatible internally for each station (may be different from other stations).
References GeopsyCore::SubSignalPool::begin(), GeopsyCore::Signal::component(), GeopsyCore::DoubleSignal::deltaT(), GeopsyCore::SubSignalPool::end(), QGpCoreTools::endl(), GeopsyCore::Signal::id(), MSG_ID, GeopsyCore::Signal::name(), GeopsyCore::Signal::receiver(), GeopsyCore::SubSignalPool::sort(), GeopsyCore::Signal::t0(), QGpCoreTools::tr(), and TRACE.
{ TRACE; // Sorting by name+receiver coordinates, component and t0 SortKey::clear(); SortKey::add(MetaDataFactory::Name); SortKey::add(MetaDataFactory::ReceiverX); SortKey::add(MetaDataFactory::ReceiverY); SortKey::add(MetaDataFactory::Component); SortKey::add(MetaDataFactory::T0); subPool->sort(); // Consistency checks : deltaT and T0 compatibility SubSignalPool::iterator itPool=subPool->begin(); Signal * sig=*itPool; QString refName=sig->name(); Point refRec=sig->receiver(); Signal::Components refComp=sig->component(); double refDt=sig->deltaT(); double refT0=sig->t0(); for( ++itPool;itPool!=subPool->end();++itPool) { sig=*itPool; if(refName!=sig->name() || refRec!=sig->receiver() || refComp!=sig->component()) { refName=sig->name(); refRec=sig->receiver(); refComp=sig->component(); refDt=sig->deltaT(); refT0=sig->t0(); } else { if(refDt!=sig->deltaT()) { Message::warning(MSG_ID, tr("Creating array"), tr("The samling rate must be the same for all components." ), Message::cancel()); return false; } double ndeltaT0=fabs(refT0 - sig->t0())/refDt; if(ndeltaT0 - floor(ndeltaT0 + 0.5) > 0.01 * refDt) { App::stream() << tr("The differences between t0s is not a multiple of the " "sampling period. Found with signal ID %1.").arg(sig->id()) << endl; } } } return true; }
void MonoStation::SpectrumStationSignals::setProcessed | ( | const TimeRange & | tw, |
AbstractParameters * | param | ||
) | [virtual] |
Implements GeopsyCore::StationProcessSignals.
Reimplemented in HVStationSignals, and StructureStationProcessSignals.
References GeopsyCore::DoubleSignal::copyAmplitudeFrom(), GeopsyCore::StationProcessSignals::copyOriginalSignal(), GeopsyCore::DoubleSignal::fastFourierTransform(), GeopsyCore::TimeRange::lengthSeconds(), QGpCoreTools::SamplingParameters::maximum(), QGpCoreTools::SamplingParameters::minimum(), GeopsyCore::StationProcessSignals::processed(), MonoStation::AbstractToolParameters::sampling(), GeopsyCore::DoubleSignal::smooth(), MonoStation::AbstractToolParameters::smoothing(), GeopsyCore::DoubleSignal::subtractValue(), GeopsyCore::DoubleSignal::taper(), MonoStation::AbstractToolParameters::tapering(), and TRACE.
{ TRACE; AbstractToolParameters * specParam=static_cast<AbstractToolParameters *>(param); copyOriginalSignal(0, tw); DoubleSignal *& psig=processed(0); psig->subtractValue(); double winLen=tw.lengthSeconds(); psig->taper(TimeRange(0.0, tw.lengthSeconds()), specParam->tapering()); DoubleSignal * spec=new DoubleSignal(0); psig->fastFourierTransform(DoubleSignal::Spectrum); spec->copyAmplitudeFrom(psig); delete psig; spec->smooth(specParam->smoothing(), specParam->sampling().minimum(), specParam->sampling().maximum()); psig=spec; }