Brief description of class still missing. More...
#include <StationCoupleProcess.h>
Public Member Functions | |
void | horizontalAutocorr () |
double | radialAutocorr () const |
double | radialPower () const |
void | setAzimuth (const Angle &a) |
void | setStations (const StationCouple *cp, QList< StationProcessSignals * > stations) |
void | setWeight (double w) |
StationCoupleProcess () | |
double | transverseAutocorr () const |
double | transversePower () const |
double | verticalAutocorr () const |
Brief description of class still missing.
Full description of class still missing
Create an invalid couple.
{ _s1=0; _s2=0; _weight=0; }
For horizontal components:
Decomposition into radial and transverse. Then, computation of radial and transverse correlation functions. The geometrical average power is computed and stored for radial and transverse. The normalization is performed only at the ring level (not for each couple as for vertical components, see Andreas' note)
10% ends of time window are not included in computation. Hence a 10% overlap of time window should be a default.
This function does not return anything, the results can be accessed with raidalAutocorr() and transverseAutocorr().
References CONST_LOCK_SAMPLES, QGpCoreTools::Angle::cos(), GeopsyCore::SignalTemplate< sampleType >::nSamples(), GeopsyCore::StationProcessSignals::processed(), QGpCoreTools::Angle::sin(), QGpCoreTools::sqrt(), TRACE, and UNLOCK_SAMPLES.
{ TRACE; _radialAutocorr=0.0; _transverseAutocorr=0.0; double powerR1=0.0; // Power for radial and transverse double powerR2=0.0; double powerT1=0.0; double powerT2=0.0; double r1, r2, t1, t2; // radial and transverse components DoubleSignal * sN1=_s1->processed(1); DoubleSignal * sE1=_s1->processed(2); DoubleSignal * sN2=_s2->processed(1); DoubleSignal * sE2=_s2->processed(2); CacheProcess cp; cp << sN1 << sE1 << sN2 << sE2; CONST_LOCK_SAMPLES(double, samplesN1, sN1) CONST_LOCK_SAMPLES(double, samplesE1, sE1) CONST_LOCK_SAMPLES(double, samplesN2, sN2) CONST_LOCK_SAMPLES(double, samplesE2, sE2) int n=(int)round(sN1->nSamples() * 0.9); for(int i=(int) round(sN1->nSamples() * 0.1);i < n;i++ ) { r1=samplesN1[i]*_azimuth.sin()+samplesE1[i]*_azimuth.cos(); r2=samplesN2[i]*_azimuth.sin()+samplesE2[i]*_azimuth.cos(); t1=samplesN1[i]*_azimuth.cos()-samplesE1[i]*_azimuth.sin(); t2=samplesN2[i]*_azimuth.cos()-samplesE2[i]*_azimuth.sin(); powerR1 += r1 * r1; powerR2 += r2 * r2; powerT1 += t1 * t1; powerT2 += t2* t2; _radialAutocorr += r1 * r2; _transverseAutocorr += t1 * t2; } UNLOCK_SAMPLES(sE2) UNLOCK_SAMPLES(sN2) UNLOCK_SAMPLES(sE1) UNLOCK_SAMPLES(sN1) _radialPower=sqrt(powerR1 * powerR2); // geometrical average of the powers _transversePower=sqrt(powerT1 * powerT2); }
double ArrayCore::StationCoupleProcess::radialAutocorr | ( | ) | const [inline] |
{return _radialAutocorr*_weight;}
double ArrayCore::StationCoupleProcess::radialPower | ( | ) | const [inline] |
{return _radialPower*_weight;}
void ArrayCore::StationCoupleProcess::setAzimuth | ( | const Angle & | a | ) | [inline] |
{_azimuth=a;}
void ArrayCore::StationCoupleProcess::setStations | ( | const StationCouple * | cp, |
QList< StationProcessSignals * > | stations | ||
) |
Identify the process stations corresponding to couple cp into stations list.
References GeopsyCore::StationProcessSignals::originalSignals(), ArrayCore::StationCouple::station1(), and ArrayCore::StationCouple::station2().
{ for(QList<StationProcessSignals *>::const_iterator it=stations.begin(); it!=stations.end(); it++) { StationProcessSignals * stat=*it; if(stat->originalSignals()==cp->station1()) { ASSERT(!_s1); _s1=stat; } else if(stat->originalSignals()==cp->station2()) { ASSERT(!_s2); _s2=stat; } } ASSERT(_s1); ASSERT(_s2); }
void ArrayCore::StationCoupleProcess::setWeight | ( | double | w | ) | [inline] |
{_weight=w;}
double ArrayCore::StationCoupleProcess::transverseAutocorr | ( | ) | const [inline] |
{return _transverseAutocorr*_weight;}
double ArrayCore::StationCoupleProcess::transversePower | ( | ) | const [inline] |
{return _transversePower*_weight;}
double ArrayCore::StationCoupleProcess::verticalAutocorr | ( | ) | const |
For Vertical components:
The result is the spatial autocorrelation ratio rho as defined by Bettig et al. (equation (3)). This function makes use of autocorr for stations 1 and 2 previously calculated by SpacStationSignals::calculateVerticalPower(). This later functions does not correct for the number of sample, as the ratio are computed, it simplifies.
An average autocorr is computed with geometrical mean from autocorr of stations 1 and 2.
10% ends of time window are not included in computation. Hence a 10% overlap of time window should be a default.
References CONST_LOCK_SAMPLES, GeopsyCore::SignalTemplate< sampleType >::nSamples(), GeopsyCore::StationProcessSignals::processed(), QGpCoreTools::sqrt(), TRACE, and UNLOCK_SAMPLES.
{ TRACE; double res=0; const DoubleSignal * s1=_s1->processed(0); const DoubleSignal * s2=_s2->processed(0); CacheProcess cp; cp << s1 << s2; CONST_LOCK_SAMPLES(double, samples1, s1) CONST_LOCK_SAMPLES(double, samples2, s2) int n=(int)floor(s1->nSamples() * 0.9+0.5); for(int i=(int) floor(s1->nSamples() * 0.1 +0.5);i < n;i++ ) { res += samples1[ i ] * samples2[ i ]; //printf(" %i %lg %lg\n",i,samples1[i],samples2[i]); } res /= sqrt(static_cast<const SPACStationSignals *>(_s1)->verticalPower() * static_cast<const SPACStationSignals *>(_s2)->verticalPower()); UNLOCK_SAMPLES(s2) UNLOCK_SAMPLES(s1) return res*_weight; }