casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
casa::AWVisResampler Class Reference

#include <AWVisResampler.h>

Inheritance diagram for casa::AWVisResampler:
casa::VisibilityResampler casa::VisibilityResamplerBase

List of all members.

Public Member Functions

 AWVisResampler ()
virtual ~AWVisResampler ()
 AWVisResampler(const CFStore& cfs): VisibilityResampler(cfs) {}.
virtual VisibilityResamplerBaseclone ()
virtual void copyMaps (const AWVisResampler &other)
 AWVisResampler(const AWVisResampler& other): VisibilityResampler(other),cfMap_p(), conjCFMap_p() {copy(other);}.
virtual void copy (const VisibilityResamplerBase &other)
 VisibilityResampler& operator=(const VisibilityResampler& other);.
virtual void copy (const AWVisResampler &other)
AWVisResampleroperator= (const AWVisResampler &other)
virtual void setCFMaps (const Vector< Int > &cfMap, const Vector< Int > &conjCFMap)
virtual void DataToGrid (Array< DComplex > &griddedData, VBStore &vbs, Matrix< Double > &sumwt, const Bool &dopsf, Bool useConjFreqCF=False)
 virtual void setConvFunc(const CFStore& cfs) {convFuncStore_p = cfs;};
virtual void DataToGrid (Array< Complex > &griddedData, VBStore &vbs, Matrix< Double > &sumwt, const Bool &dopsf, Bool useConjFreqCF=False)
virtual void GridToData (VBStore &vbs, const Array< Complex > &griddedData)
 

Protected Member Functions

virtual Complex getConvFuncVal (const Cube< Double > &convFunc, const Matrix< Double > &uvw, const Int &irow, const Vector< Int > &pixel)
 virtual void GridToData(VBStore& vbs, Array<Complex>& griddedData);
Complex getCFArea (Complex *__restrict__ &convFuncV, Double &wVal, Vector< Int > &scaledSupport, Vector< Float > &scaledSampling, Vector< Double > &off, Vector< Int > &convOrigin, Vector< Int > &cfShape, Double &sinDPA, Double &cosDPA)
template<class T >
Complex accumulateOnGrid (Array< T > &grid, Complex *__restrict__ &convFuncV, Complex &nvalue, Double &wVal, Vector< Int > &scaledSupport, Vector< Float > &scaledSampling, Vector< Double > &off, Vector< Int > &convOrigin, Vector< Int > &cfShape, Vector< Int > &loc, Vector< Int > &igrdpos, Double &sinDPA, Double &cosDPA, Bool &finitePointingOffset, Bool dopsf)
template<class T >
void XInnerLoop (const Int *scaleSupport, const Float *scaledSampling, const Double *off, const Int *loc, Complex &cfArea, const Int *__restrict__ iGrdPosPtr, Complex *__restrict__ &convFuncV, const Int *convOrigin, Complex &nvalue, Double &wVal, Bool &, Bool &, T *__restrict__ gridStore, Int *iloc, Complex &norm, Int *igrdpos)
template<class T >
void accumulateFromGrid (T &nvalue, const T *__restrict__ &grid, Vector< Int > &iGrdPos, Complex *__restrict__ &convFuncV, Double &wVal, Vector< Int > &scaledSupport, Vector< Float > &scaledSampling, Vector< Double > &off, Vector< Int > &convOrigin, Vector< Int > &cfShape, Vector< Int > &loc, Complex &phasor, Double &sinDPA, Double &cosDPA, Bool &finitePointingOffset, Matrix< Complex > &cached_phaseGrad_p)

Private Member Functions

template<class T >
void DataToGridImpl_p (Array< T > &griddedData, VBStore &vb, Matrix< Double > &sumwt, const Bool &dopsf, Bool)
 Re-sample the griddedData on the VisBuffer (a.k.a de-gridding).
void sgrid (Vector< Double > &pos, Vector< Int > &loc, Vector< Double > &off, Complex &phasor, const Int &irow, const Matrix< Double > &uvw, const Double &dphase, const Double &freq, const Vector< Double > &scale, const Vector< Double > &offset, const Vector< Float > &sampling)
Bool onGrid (const Int &nx, const Int &ny, const Int &nw, const Vector< Int > &loc, const Vector< Int > &support)
template<class T >
void SETVEC (Vector< T > &lhs, const Vector< T > &rhs)
 Array assignment operator in CASACore requires lhs.nelements() == 0 or lhs.nelements()=rhs.nelements()
Complex getFrom4DArray (const Complex *__restrict__ &store, const Int *iPos, const Int *inc)
 Internal methods to address a 4D array.
Complex getFrom4DArray (const Complex *__restrict__ &store, const Vector< Int > &iPos, const Vector< Int > &inc)
 The following two methods are called in the innermost loop.
DComplex getFrom4DArray (const DComplex *__restrict__ &store, const Vector< Int > &iPos, const Vector< Int > &inc)
template<class T >
void addTo4DArray (T *__restrict__ &store, const Int *__restrict__ &iPos, const Vector< Int > &inc, Complex &nvalue, Complex &wt) __restrict__
Bool reindex (const Vector< Int > &in, Vector< Int > &out, const Double &sinDPA, const Double &cosDPA, const Vector< Int > &Origin, const Vector< Int > &size)
 This rotates the convolution function by rotating the co-ordinate system.
Complex * getConvFunc_p (Vector< Int > &cfShape, CFBuffer &cfb, Double &wVal, Int &fndx, Int &wndx, PolMapType &mNdx, PolMapType &conjMNdx, Int &ipol, uInt &mRow)
void cachePhaseGrad_p (const Vector< Double > &pointingOffset, const Vector< Int > &cfShape, const Vector< Int > &convOrigin, const Double &cfRefFreq, const Double &imRefFreq)

Private Attributes

Vector< IntgridInc_p
 

----------------------------Private parts-------------------------------------


Vector< IntcfInc_p
Matrix< Complex > cached_phaseGrad_p
Vector< Doublecached_PointingOffset_p

Detailed Description

Definition at line 44 of file AWVisResampler.h.


Constructor & Destructor Documentation

virtual casa::AWVisResampler::~AWVisResampler ( ) [inline, virtual]

AWVisResampler(const CFStore& cfs): VisibilityResampler(cfs) {}.

Definition at line 52 of file AWVisResampler.h.


Member Function Documentation

template<class T >
void casa::AWVisResampler::accumulateFromGrid ( T &  nvalue,
const T *__restrict__ &  grid,
Vector< Int > &  iGrdPos,
Complex *__restrict__ &  convFuncV,
Double wVal,
Vector< Int > &  scaledSupport,
Vector< Float > &  scaledSampling,
Vector< Double > &  off,
Vector< Int > &  convOrigin,
Vector< Int > &  cfShape,
Vector< Int > &  loc,
Complex &  phasor,
Double sinDPA,
Double cosDPA,
Bool finitePointingOffset,
Matrix< Complex > &  cached_phaseGrad_p 
) [protected]
template<class T >
Complex casa::AWVisResampler::accumulateOnGrid ( Array< T > &  grid,
Complex *__restrict__ &  convFuncV,
Complex &  nvalue,
Double wVal,
Vector< Int > &  scaledSupport,
Vector< Float > &  scaledSampling,
Vector< Double > &  off,
Vector< Int > &  convOrigin,
Vector< Int > &  cfShape,
Vector< Int > &  loc,
Vector< Int > &  igrdpos,
Double sinDPA,
Double cosDPA,
Bool finitePointingOffset,
Bool  dopsf 
) [protected]
template<class T >
void casa::AWVisResampler::addTo4DArray ( T *__restrict__ &  store,
const Int *__restrict__ &  iPos,
const Vector< Int > &  inc,
Complex &  nvalue,
Complex &  wt 
) [inline, private]

T *tmp=store+(iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]); *tmp += nvalue*wt;

Definition at line 260 of file AWVisResampler.h.

void casa::AWVisResampler::cachePhaseGrad_p ( const Vector< Double > &  pointingOffset,
const Vector< Int > &  cfShape,
const Vector< Int > &  convOrigin,
const Double cfRefFreq,
const Double imRefFreq 
) [private]
virtual VisibilityResamplerBase* casa::AWVisResampler::clone ( ) [inline, virtual]

Reimplemented from casa::VisibilityResampler.

Definition at line 54 of file AWVisResampler.h.

References AWVisResampler().

virtual void casa::AWVisResampler::copy ( const VisibilityResamplerBase other) [inline, virtual]

VisibilityResampler& operator=(const VisibilityResampler& other);.

const Vector<Int> cfmap=other.getCFMap(); const Vector<Int> conjcfmap = other.getConjCFMap();

setCFMaps(cfmap,conjcfmap);

Reimplemented from casa::VisibilityResampler.

Definition at line 62 of file AWVisResampler.h.

Referenced by copy(), and operator=().

virtual void casa::AWVisResampler::copy ( const AWVisResampler other) [inline, virtual]

Definition at line 71 of file AWVisResampler.h.

References cached_phaseGrad_p, cached_PointingOffset_p, copy(), and SETVEC().

virtual void casa::AWVisResampler::copyMaps ( const AWVisResampler other) [inline, virtual]

AWVisResampler(const AWVisResampler& other): VisibilityResampler(other),cfMap_p(), conjCFMap_p() {copy(other);}.

Definition at line 60 of file AWVisResampler.h.

References casa::VisibilityResamplerBase::cfMap_p, casa::VisibilityResamplerBase::conjCFMap_p, and setCFMaps().

virtual void casa::AWVisResampler::DataToGrid ( Array< DComplex > &  griddedData,
VBStore vbs,
Matrix< Double > &  sumwt,
const Bool dopsf,
Bool  useConjFreqCF = False 
) [inline, virtual]

virtual void setConvFunc(const CFStore& cfs) {convFuncStore_p = cfs;};


Re-sample the griddedData on the VisBuffer (a.k.a gridding).

In this class, these just call the private templated version. The first variant grids onto a double precision grid while the second one does it on a single precision grid.

Note that the following calls allow using any CFStore object for gridding while de-gridding uses the internal convFuncStore_p object. virtual void DataToGrid(Array<DComplex>& griddedData, VBStore& vbs, Matrix<Double>& sumwt, const Bool& dopsf, CFStore& cfs) {DataToGridImpl_p(griddedData, vbs, sumwt,dopsf,cfs);}

virtual void DataToGrid(Array<Complex>& griddedData, VBStore& vbs, Matrix<Double>& sumwt, const Bool& dopsf, CFStore& cfs) {DataToGridImpl_p(griddedData, vbs, sumwt,dopsf,cfs);}

Simulating defaulting CFStore arguemnt in the above calls to convFuncStore_p

***TEMP REMOVAL OF DComplex gridder*****

Reimplemented from casa::VisibilityResampler.

Definition at line 115 of file AWVisResampler.h.

References DataToGridImpl_p().

virtual void casa::AWVisResampler::DataToGrid ( Array< Complex > &  griddedData,
VBStore vbs,
Matrix< Double > &  sumwt,
const Bool dopsf,
Bool  useConjFreqCF = False 
) [inline, virtual]

Reimplemented from casa::VisibilityResampler.

Definition at line 119 of file AWVisResampler.h.

References DataToGridImpl_p().

template<class T >
void casa::AWVisResampler::DataToGridImpl_p ( Array< T > &  griddedData,
VBStore vb,
Matrix< Double > &  sumwt,
const Bool dopsf,
Bool   
) [private]

Re-sample the griddedData on the VisBuffer (a.k.a de-gridding).

Referenced by DataToGrid().

Complex casa::AWVisResampler::getCFArea ( Complex *__restrict__ &  convFuncV,
Double wVal,
Vector< Int > &  scaledSupport,
Vector< Float > &  scaledSampling,
Vector< Double > &  off,
Vector< Int > &  convOrigin,
Vector< Int > &  cfShape,
Double sinDPA,
Double cosDPA 
) [protected]
Complex* casa::AWVisResampler::getConvFunc_p ( Vector< Int > &  cfShape,
CFBuffer cfb,
Double wVal,
Int fndx,
Int wndx,
PolMapType mNdx,
PolMapType conjMNdx,
Int ipol,
uInt mRow 
) [private]
virtual Complex casa::AWVisResampler::getConvFuncVal ( const Cube< Double > &  convFunc,
const Matrix< Double > &  uvw,
const Int irow,
const Vector< Int > &  pixel 
) [inline, protected, virtual]

virtual void GridToData(VBStore& vbs, Array<Complex>& griddedData);

Definition at line 131 of file AWVisResampler.h.

Complex casa::AWVisResampler::getFrom4DArray ( const Complex *__restrict__ &  store,
const Int iPos,
const Int inc 
) [inline, private]

Internal methods to address a 4D array.

These should ulimately moved to a Array4D class in CASACore

This is called less frequently. Currently once per VisBuffer inline void cacheAxisIncrements(const Vector<Int>& n, Vector<Int>& inc) {inc.resize(4);inc[0]=1, inc[1]=inc[0]*n[0], inc[2]=inc[1]*n[1], inc[3]=inc[2]*n[2];(void)n[3];}

The following method is also called from the inner loop, but does not use CASA Vector (which are not thread safe, I (SB) am told).

return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];

Definition at line 238 of file AWVisResampler.h.

Complex casa::AWVisResampler::getFrom4DArray ( const Complex *__restrict__ &  store,
const Vector< Int > &  iPos,
const Vector< Int > &  inc 
) [inline, private]

The following two methods are called in the innermost loop.

return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];

Definition at line 246 of file AWVisResampler.h.

DComplex casa::AWVisResampler::getFrom4DArray ( const DComplex *__restrict__ &  store,
const Vector< Int > &  iPos,
const Vector< Int > &  inc 
) [inline, private]

return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];

Definition at line 252 of file AWVisResampler.h.

virtual void casa::AWVisResampler::GridToData ( VBStore vbs,
const Array< Complex > &  griddedData 
) [virtual]


Re-sample VisBuffer to a regular grid (griddedData) (a.k.a. de-gridding)

Reimplemented from casa::VisibilityResampler.

Bool casa::AWVisResampler::onGrid ( const Int nx,
const Int ny,
const Int nw,
const Vector< Int > &  loc,
const Vector< Int > &  support 
) [inline, private]

Definition at line 209 of file AWVisResampler.h.

AWVisResampler& casa::AWVisResampler::operator= ( const AWVisResampler other) [inline]

Definition at line 78 of file AWVisResampler.h.

References cached_phaseGrad_p, cached_PointingOffset_p, copy(), and SETVEC().

Bool casa::AWVisResampler::reindex ( const Vector< Int > &  in,
Vector< Int > &  out,
const Double sinDPA,
const Double cosDPA,
const Vector< Int > &  Origin,
const Vector< Int > &  size 
) [private]

This rotates the convolution function by rotating the co-ordinate system.

For the accuracies already required for EVLA and ALMA, this is not useful. Leaving it hear for now....

virtual void casa::AWVisResampler::setCFMaps ( const Vector< Int > &  cfMap,
const Vector< Int > &  conjCFMap 
) [inline, virtual]
template<class T >
void casa::AWVisResampler::SETVEC ( Vector< T > &  lhs,
const Vector< T > &  rhs 
) [inline, private]

Array assignment operator in CASACore requires lhs.nelements() == 0 or lhs.nelements()=rhs.nelements()

Definition at line 221 of file AWVisResampler.h.

References casa::Vector< T >::resize(), and casa::Vector< T >::shape().

Referenced by copy(), operator=(), and setCFMaps().

void casa::AWVisResampler::sgrid ( Vector< Double > &  pos,
Vector< Int > &  loc,
Vector< Double > &  off,
Complex &  phasor,
const Int irow,
const Matrix< Double > &  uvw,
const Double dphase,
const Double freq,
const Vector< Double > &  scale,
const Vector< Double > &  offset,
const Vector< Float > &  sampling 
) [private]
template<class T >
void casa::AWVisResampler::XInnerLoop ( const Int scaleSupport,
const Float scaledSampling,
const Double off,
const Int loc,
Complex &  cfArea,
const Int *__restrict__  iGrdPosPtr,
Complex *__restrict__ &  convFuncV,
const Int convOrigin,
Complex &  nvalue,
Double wVal,
Bool ,
Bool ,
T *__restrict__  gridStore,
Int iloc,
Complex &  norm,
Int igrdpos 
) [protected]

Member Data Documentation

Definition at line 193 of file AWVisResampler.h.

Referenced by copy(), and operator=().

Definition at line 194 of file AWVisResampler.h.

Referenced by AWVisResampler(), copy(), and operator=().

Definition at line 192 of file AWVisResampler.h.


----------------------------Private parts-------------------------------------

Vector<Double> uvwScale_p, offset_p, dphase_p; Vector<Int> chanMap_p, polMap_p; CFStore convFuncStore_p; Int inc0_p, inc1_p, inc2_p, inc3_p; Vector<Int> inc_p; Vector<Int> cfMap_p, conjCFMap_p;

Definition at line 192 of file AWVisResampler.h.


The documentation for this class was generated from the following file: