29 #ifndef SYNTHESIS_TRANSFORM2_VISIBILITYRESAMPLERBASE_H
30 #define SYNTHESIS_TRANSFORM2_VISIBILITYRESAMPLERBASE_H
54 runTimeG_p(0.0), runTimeDG_p(0.0),runTimeG1_p(0.0), runTimeG2_p(0.0), runTimeG3_p(0.0), runTimeG4_p(0.0), runTimeG5_p(0.0), runTimeG6_p(0.0), runTimeG7_p(0.0),
56 uvwScale_p(), offset_p(), chanMap_p(), polMap_p(), spwChanFreq_p(), spwChanConjFreq_p (), convFuncStore_p(), inc_p(),
57 cfMap_p(), conjCFMap_p(), paTolerance_p(360.0), cached_phaseGrad_p(),vb2CFBMap_p()
66 uvwScale_p(), offset_p(), chanMap_p(), polMap_p(), spwChanFreq_p(), spwChanConjFreq_p (), convFuncStore_p(), inc_p(),
67 cfMap_p(), conjCFMap_p(), paTolerance_p(360.0),vb2CFBMap_p()
85 virtual void setConvFunc(
const CFStore& cfs) = 0;
86 virtual void setPATolerance(
const double& dPA) = 0;
111 virtual void ComputeResiduals(
VBStore& vbs) = 0;
122 virtual void initializeDataBuffers(
VBStore& vbs)=0;
127 {GatherGrids(griddedData, sumwt);};
129 {GatherGrids(griddedData, sumwt);};
131 {initializePutBuffers(griddedData, sumwt);};
133 {initializePutBuffers(griddedData, sumwt);};
138 virtual void releaseBuffers() = 0;
188 return (((loc(0)-support[0]) >= 0 ) && ((loc(0)+support[0]) < nx) &&
189 ((loc(1)-support[1]) >= 0 ) && ((loc(1)+support[1]) < ny));
195 return (((loc0-support) >= 0 ) && ((loc0+support) < nx) &&
196 ((loc1-support) >= 0 ) && ((loc1+support) < ny));
218 inc_p[0]=1; inc_p[1]=inc_p[0]*n0; inc_p[2]=inc_p[1]*n1; inc_p[3]=inc_p[2]*n2;(void)n3;
220 incPtr_p = inc_p.getStorage(D);
223 {cacheAxisIncrements(n[0],n[1],n[2],n[3]);}
226 {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];}
229 {inc[0]=1; inc[1]=inc[0]*n[0]; inc[2]=inc[1]*n[1]; inc[3]=inc[2]*n[2];(void)n[3];}
235 {addTo4DArray(store, iPos, incPtr_p, nvalue, wt);}
239 {addTo4DArray(store, iPos, incPtr_p, nvalue, wt);}
245 {store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]] += (nvalue*
casacore::Complex(wt));}
249 {store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]] += (nvalue*
casacore::Complex(wt));}
256 {
return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];};
261 {
return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];};
267 {
return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];};
272 {
return store[iPos[0] + iPos[1]*inc[1] + iPos[2]*inc[2] +iPos[3]*inc[3]];};
278 {
return getFrom4DArray(store, iPos, inc_p);}
282 {
return getFrom4DArray(store, iPos, inc_p);}
VB2CFBMap & getVBRow2CFBMap()
VBRow2CFMapType& getVBRow2CFMap() {return vbRow2CFMap_p;};.
casacore::DComplex getFrom4DArray(const casacore::DComplex *__restrict__ &store, const casacore::Int *__restrict__ &iPos, const casacore::Vector< casacore::Int > &inc)
restrict
void addTo4DArray(casacore::Complex *__restrict__ &store, casacore::Int *__restrict__ &iPos, casacore::Complex &nvalue, casacore::Double &wt) __restrict__
casacore::Bool onGrid(const casacore::Int &nx, const casacore::Int &ny, const casacore::Int &loc0, const casacore::Int &loc1, const casacore::Int &support) __restrict__
void cacheAxisIncrements(const casacore::Int n[4], casacore::Int inc[4])
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
std::complex< Float > Complex
void finalizeToSky(casacore::Array< casacore::DComplex > &griddedData, casacore::Matrix< casacore::Double > &sumwt)
Aliases for more readable code at the FTMachine layer.
casacore::Complex getFrom4DArray(const casacore::Complex *__restrict__ &store, const casacore::Int *__restrict__ &iPos, const casacore::Vector< casacore::Int > &inc)
restrict
const casacore::Vector< casacore::Int > getCFMap()
void addTo4DArray(casacore::DComplex *__restrict__ &store, casacore::Int *__restrict__ &iPos, casacore::Int *__restrict__ inc, casacore::Complex &nvalue, casacore::Double &wt) __restrict__
Version where inc_p is supplied from outside.
double paTolerance_p
VBRow2CFMapType vbRow2CFMap_p;.
casacore::Bool onGrid(const casacore::Int &nx, const casacore::Int &ny, const casacore::Vector< casacore::Int > &__restrict__ loc, const casacore::Vector< casacore::Int > &__restrict__ support) __restrict__
PtrHolder< T > & operator=(const PtrHolder< T > &other)
casacore::Int *__restrict__ incPtr_p
VisibilityResamplerBase(const VisibilityResamplerBase &other)
VisibilityResamplerBase(const CFStore& cfs): uvwScale_p(), offset_p(), chanMap_p(), polMap_p(), convFuncStore_p(), inc_p(), cfMap_p(), conjCFMap_p() {setConvFunc(cfs);};.
void cacheAxisIncrements(const casacore::Int &n0, const casacore::Int &n1, const casacore::Int &n2, const casacore::Int &n3)
casacore::Array assignment operator in CASACore requires lhs.nelements() == 0 or lhs.nelements()=rhs.nelements() template <class t>=""> inline void SETVEC(casacore::Vector<T>& lhs, const casacore::Vector<T>& rhs) {lhs.resize(rhs.shape()); lhs = rhs;};
casacore::Complex getFrom4DArray(const casacore::Complex *__restrict__ &store, const casacore::Vector< casacore::Int > iPos, const casacore::Vector< casacore::Int > &inc)
restrict
const casacore::Vector< casacore::Int > getConjCFMap()
casacore::Matrix< casacore::Complex > cached_phaseGrad_p
casacore::DComplex getFrom4DArray(const casacore::DComplex *__restrict__ &store, const casacore::Vector< casacore::Int > iPos, const casacore::Vector< casacore::Int > &inc)
restrict
casacore::CountedPtr< refim::VB2CFBMap > vb2CFBMap_p
void initializeToSky(const casacore::Array< casacore::Complex > &griddedData, const casacore::Matrix< casacore::Double > &sumwt)
casacore::Vector< casacore::Double > uvwScale_p
-------------------------—Private parts----------------------------------—
void addTo4DArray(casacore::Complex *__restrict__ &store, casacore::Int *__restrict__ &iPos, casacore::Int *__restrict__ inc, casacore::Complex &nvalue, casacore::Double &wt) __restrict__
Referenced counted pointer for constant data.
casacore::Vector< casacore::Int > conjCFMap_p
void finalizeToSky(casacore::Array< casacore::Complex > &griddedData, casacore::Matrix< casacore::Double > &sumwt)
std::complex< Double > DComplex
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
void addTo4DArray(casacore::DComplex *__restrict__ &store, casacore::Int *__restrict__ &iPos, casacore::Complex &nvalue, casacore::Double &wt) __restrict__
Version that use internally cached inc_p template <class t>="">
bool Bool
Define the standard types used by Casacore.
virtual ~VisibilityResamplerBase()
void cacheAxisIncrements(const casacore::Vector< casacore::Int > &n, casacore::Vector< casacore::Int > &inc)
casacore::Complex getFrom4DArray(const casacore::Complex *__restrict__ &store, const casacore::Int *__restrict__ &iPos)
The following two methods are called in the innermost loop.
measure the time it takes to execute parts of a program
casacore::Vector< casacore::Int > polMap_p
FrequencySelection * clone() const
casacore::Double runTimeG_p
casacore::Vector< casacore::Int > inc_p
casacore::Int inc0_p, inc1_p, inc2_p, inc3_p;
void resize(size_t len, Bool copyValues=False)
void initializeToSky(const casacore::Array< casacore::DComplex > &griddedData, const casacore::Matrix< casacore::Double > &sumwt)
casacore::Matrix< casacore::Double > spwChanFreq_p
void setVB2CFMap(const casacore::CountedPtr< refim::VB2CFBMap > &thisMap)
void setFieldPhaseGrad(const casacore::Matrix< casacore::Complex > &phaseGrad)
virtual casacore::Int makeVBRow2CFBMap(CFStore2& cfs, ConvolutionFunction& cf, const VisBuffer2& vb...
void cacheAxisIncrements(const casacore::Vector< casacore::Int > &n)
casacore::DComplex getFrom4DArray(const casacore::DComplex *__restrict__ &store, const casacore::Int *__restrict__ &iPos)
restrict
VisibilityResamplerBase()