Brief description of class still missing. More...
#include <PhaseShifter.h>
Public Member Functions | |
| virtual void | initGrid (int n) |
| virtual void | initGrid (int n) |
| virtual void | initGrid (double kx, double ky, int index) |
| virtual void | initGrid (double kx, double ky, int index) |
| double | maximumSlowness () const |
| double | maximumSlowness () const |
| PhaseShifter (ArrayStations *array) | |
| PhaseShifter (ArrayStations *array) | |
| void | setCrossSpectrum (ComplexMatrix m) |
| void | setCrossSpectrum (ComplexMatrix m) |
| void | setMaximumSlowness (double slow) |
| void | setMaximumSlowness (double slow) |
| void | setMaximumWavenumber (double k) |
| void | setMaximumWavenumber (double k) |
| void | setOmega (double omega) |
| void | setOmega (double omega) |
| virtual double | value (double kx, double ky) const |
| virtual double | value (double kx, double ky) const |
| virtual double | value (double kx, double ky, int index) const |
| virtual double | value (double kx, double ky, int index) const |
| ~PhaseShifter () | |
| ~PhaseShifter () | |
Brief description of class still missing.
Full description of class still missing
| PhaseShifter::PhaseShifter | ( | ArrayStations * | array | ) |
Description of constructor still missing
References ArrayCore::ArrayStations::relativeCoordinates(), and TRACE.
: AbstractFunction2() { TRACE; int n=array->count(); _relativeCoordinates.resize(n); for(int i=0; i<n; i++) { _relativeCoordinates[i]=array->relativeCoordinates(i); } _squaredKmaxGrid=0.0; _squaredSlowMax=1e99; _squaredKmaxTotal=1e99; }
| PhaseShifter::PhaseShifter | ( | ArrayStations * | array | ) |
| void PhaseShifter::initGrid | ( | int | n | ) | [virtual] |
Automatically called by GridSearch upon initialization
Reimplemented from QGpCoreTools::AbstractFunction2.
References TRACE.
{
TRACE;
_gridShifts.resize(n);
_gridShiftConjugates.resize(n);
int nStations=_relativeCoordinates.count();
for(int i=0; i<n;i++) {
_gridShifts[i].resize(1, nStations);
_gridShiftConjugates[i].resize(nStations, 1);
}
}
| virtual void PhaseShifter::initGrid | ( | int | n | ) | [virtual] |
Re-implemement if the computation of value(double x, double y) requires caching for gridded couples (x,y). n is the total number of grid points: nx*ny
Reimplemented from QGpCoreTools::AbstractFunction2.
| virtual void PhaseShifter::initGrid | ( | double | x, |
| double | y, | ||
| int | index | ||
| ) | [virtual] |
Re-implemement if the computation of value(double x, double y) requires caching for gridded couples (x,y). This fonction initialize the cached values for x and y aligned to a grid and corresponding to index.
Reimplemented from QGpCoreTools::AbstractFunction2.
| void PhaseShifter::initGrid | ( | double | x, |
| double | y, | ||
| int | index | ||
| ) | [virtual] |
Re-implemement if the computation of value(double x, double y) requires caching for gridded couples (x,y). This fonction initialize the cached values for x and y aligned to a grid and corresponding to index.
Reimplemented from QGpCoreTools::AbstractFunction2.
References QGpCoreTools::Matrix< T >::at(), QGpCoreTools::conjugate(), QGpCoreTools::Complex::setUnitExp(), TRACE, QGpCoreTools::Point2D::x(), and QGpCoreTools::Point2D::y().
{
TRACE;
int nStations=_relativeCoordinates.count();
ComplexMatrix& shifts=_gridShifts[index];
ComplexMatrix& shiftConjugates=_gridShiftConjugates[index];
for(int i=0;i<nStations;i++) {
const Point2D& p=_relativeCoordinates[i];
Complex& c=shifts.at(0,i);
c.setUnitExp(kx * p.x() + ky * p.y());
shiftConjugates.at(i,0)=conjugate(c);
}
double squaredK=fabs(kx)>fabs(ky) ? kx*kx : ky*ky;
if(squaredK > _squaredKmaxGrid) {
_squaredKmaxGrid=squaredK;
}
}
| double PhaseShifter::maximumSlowness | ( | ) | const [inline] |
References QGpCoreTools::sqrt().
{return sqrt(_squaredSlowMax);}
| double PhaseShifter::maximumSlowness | ( | ) | const [inline] |
References QGpCoreTools::sqrt().
{return sqrt(_squaredSlowMax);}
| void PhaseShifter::setCrossSpectrum | ( | ComplexMatrix | m | ) | [inline] |
{_crossSpectrum=m;}
| void PhaseShifter::setCrossSpectrum | ( | ComplexMatrix | m | ) | [inline] |
{_crossSpectrum=m;}
| void PhaseShifter::setMaximumSlowness | ( | double | slow | ) | [inline] |
{_squaredSlowMax=slow*slow;}
| void PhaseShifter::setMaximumSlowness | ( | double | slow | ) | [inline] |
Referenced by RealTimeArrayProcess::setMaximumSlowness().
{_squaredSlowMax=slow*slow;}
| void PhaseShifter::setMaximumWavenumber | ( | double | k | ) | [inline] |
{_squaredKmaxGrid=k*k;}
| void PhaseShifter::setMaximumWavenumber | ( | double | k | ) | [inline] |
{_squaredKmaxGrid=k*k;}
| void PhaseShifter::setOmega | ( | double | omega | ) |
{
_squaredKmaxTotal=o * o * _squaredSlowMax;
if(_squaredKmaxTotal > _squaredKmaxGrid) _squaredKmaxTotal=_squaredKmaxGrid;
}
| void PhaseShifter::setOmega | ( | double | omega | ) |
| virtual double PhaseShifter::value | ( | double | x, |
| double | y | ||
| ) | const [virtual] |
Implemement this function to calculate the 2D function at x and y.
Implements QGpCoreTools::AbstractFunction2.
| double PhaseShifter::value | ( | double | x, |
| double | y | ||
| ) | const [virtual] |
Implemement this function to calculate the 2D function at x and y.
Implements QGpCoreTools::AbstractFunction2.
References QGpCoreTools::Matrix< T >::at(), QGpCoreTools::conjugate(), QGpCoreTools::Complex::im, QGpCoreTools::Complex::re, QGpCoreTools::Complex::setUnitExp(), TRACE, QGpCoreTools::Point2D::x(), and QGpCoreTools::Point2D::y().
{
TRACE;
double k2=kx * kx + ky * ky;
if(k2 > _squaredKmaxTotal) return -1;
int nStations=_relativeCoordinates.count();
ComplexMatrix shifts(1, nStations);
ComplexMatrix shiftConjugates(nStations, 1);
for(int i=0;i<nStations;i++) {
const Point2D& p=_relativeCoordinates[i];
Complex& c=shifts.at(0,i);
c.setUnitExp(kx * p.x() + ky * p.y());
shiftConjugates.at(i,0)=conjugate(c);
}
Complex c=(shifts*_crossSpectrum*shiftConjugates).at(0,0);
ASSERT(c.im()==0.0 || c.im()<1e-10*c.re());
return c.re();
//return (shifts*_crossSpectrum*shiftConjugates).at(0,0).re();
}
| double PhaseShifter::value | ( | double | x, |
| double | y, | ||
| int | index | ||
| ) | const [virtual] |
Re-mplemement this function to calculate the 2D function for x and y aligned to a grid. x and y correspond to index in the grid: index=iy * nx + ix
If nothing is cached re-implementation of this function is useless.
Reimplemented from QGpCoreTools::AbstractFunction2.
References QGpCoreTools::Complex::im, QGpCoreTools::Complex::re, and TRACE.
{
TRACE;
double k2=kx * kx + ky * ky;
if(k2 > _squaredKmaxTotal) return -1;
Complex c=(_gridShifts[index]*_crossSpectrum*_gridShiftConjugates[index]).at(0,0);
ASSERT(c.im()==0.0 || c.im()<1e-10*c.re());
return c.re();
//return (_gridShifts[index]*_crossSpectrum*_gridShiftConjugates[index]).at(0,0).re();
}
| virtual double PhaseShifter::value | ( | double | x, |
| double | y, | ||
| int | index | ||
| ) | const [virtual] |
Re-mplemement this function to calculate the 2D function for x and y aligned to a grid. x and y correspond to index in the grid: index=iy * nx + ix
If nothing is cached re-implementation of this function is useless.
Reimplemented from QGpCoreTools::AbstractFunction2.