Line data Source code
1 : //# AWProjectFT.h: Definition for AWProjectFT
2 : //# Copyright (C) 1996,1997,1998,1999,2000,2002
3 : //# Associated Universities, Inc. Washington DC, USA.
4 : //#
5 : //# This library is free software; you can redistribute it and/or modify it
6 : //# under the terms of the GNU Library General Public License as published by
7 : //# the Free Software Foundation; either version 2 of the License, or (at your
8 : //# option) any later version.
9 : //#
10 : //# This library is distributed in the hope that it will be useful, but WITHOUT
11 : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 : //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 : //# License for more details.
14 : //#
15 : //# You should have received a copy of the GNU Library General Public License
16 : //# along with this library; if not, write to the Free Software Foundation,
17 : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 : //#
19 : //# Correspondence concerning AIPS++ should be adressed as follows:
20 : //# Internet email: aips2-request@nrao.edu.
21 : //# Postal address: AIPS++ Project Office
22 : //# National Radio Astronomy Observatory
23 : //# 520 Edgemont Road
24 : //# Charlottesville, VA 22903-2475 USA
25 : //#
26 : //#
27 : //# $Id$
28 :
29 : #ifndef SYNTHESIS_TRANSFORM2_AWPROJECTWBFTHPG_H
30 : #define SYNTHESIS_TRANSFORM2_AWPROJECTWBFTHPG_H
31 : #include <synthesis/TransformMachines2/FTMachine.h>
32 : #include <synthesis/TransformMachines2/AWProjectWBFT.h>
33 : #include <synthesis/TransformMachines2/AWConvFuncHolder.h>
34 :
35 : namespace casa
36 : { //# NAMESPACE CASA - BEGIN
37 : namespace refim
38 : {
39 : class AWProjectWBFTHPG : public AWProjectWBFT
40 : {
41 : public:
42 0 : AWProjectWBFTHPG(casacore::Int nFacets, casacore::Long cachesize,
43 : casacore::CountedPtr<CFCache>& cfcache,
44 : casacore::CountedPtr<ConvolutionFunction>& cf,
45 : casacore::CountedPtr<VisibilityResamplerBase>& visResampler,
46 : casacore::Bool applyPointingOffset=true,
47 : vector<float> pointingOffsetSigDev = {10,10},
48 : casacore::Bool doPBCorr=true,
49 : casacore::Int tilesize=16,
50 : casacore::Float paSteps=5.0,
51 : casacore::Float pbLimit=5e-4,
52 : casacore::Bool usezero=false,
53 : casacore::Bool conjBeams_p=true,
54 0 : casacore::Bool doublePrecGrid=false):
55 : AWProjectWBFT(nFacets, cachesize, cfcache, cf, visResampler,
56 : applyPointingOffset, pointingOffsetSigDev,
57 : doPBCorr, tilesize, paSteps, pbLimit, usezero,
58 0 : conjBeams_p, doublePrecGrid),applyFFT_p(false)
59 0 : {};
60 :
61 0 : ~AWProjectWBFTHPG(){};
62 :
63 : // Assignment operator
64 : AWProjectWBFTHPG &operator=(const AWProjectWBFTHPG &other)
65 : {
66 : if(this!=&other)
67 : {
68 : //Do the base parameters
69 : AWProjectWBFT::operator=(other);
70 :
71 : applyFFT_p=other.applyFFT_p;
72 : }
73 : return *this;
74 : };
75 :
76 : //---------------------------------------------------------------------------------------
77 : // Overloading getImage() to not do FFT here. The appropriate
78 : // FFT is applied on the GPU. Here, only conversion and copy
79 : // from DP to SP image is done.
80 : //
81 : virtual casacore::ImageInterface<casacore::Complex>&
82 : getImage(casacore::Matrix<casacore::Float>& weights,
83 : casacore::Bool normalize=false);
84 :
85 : virtual void getWeightImage(casacore::ImageInterface<casacore::Float>& weightImage, casacore::Matrix<casacore::Float>& weights);
86 :
87 0 : virtual casacore::String name() const { return "AWProjectWBFTHPG";};
88 :
89 : virtual void resampleDataToGrid(casacore::Array<casacore::Complex>& griddedData,VBStore& vbs,
90 : const VisBuffer2& vb, casacore::Bool& dopsf);
91 : virtual void resampleDataToGrid(casacore::Array<casacore::DComplex>& griddedData,VBStore& vbs,
92 : const VisBuffer2& vb, casacore::Bool& dopsf);
93 :
94 :
95 : ///re implement the initializetoVis as there is no FFT needed for model on gpu
96 : virtual void initializeToVisNew(const vi::VisBuffer2& vb,
97 : casacore::CountedPtr<SIImageStore> imstore);
98 :
99 : virtual void initializeToSky(casacore::ImageInterface<casacore::Complex>& image,
100 : casacore::Matrix<casacore::Float>& weight,
101 : const VisBuffer2& vb);
102 :
103 :
104 : protected:
105 : virtual void setupVBStore(VBStore& vbs,
106 : const vi::VisBuffer2& vb,
107 : const casacore::Matrix<casacore::Float>& imagingweight,
108 : const casacore::Cube<casacore::Complex>& visData,
109 : const casacore::Matrix<casacore::Double>& uvw,
110 : const casacore::Cube<casacore::Int>& flagCube,
111 : const casacore::Vector<casacore::Double>& dphase,
112 : const casacore::Bool& doPSF,
113 : const casacore::Vector<casacore::Int> &gridShape);
114 : virtual void findConvFunction(const casacore::ImageInterface<casacore::Complex>& image,
115 : const vi::VisBuffer2& vb);
116 : virtual void init(const vi::VisBuffer2& vb);
117 : std::shared_ptr<AWConvFuncHolder> awConvs_p;
118 : private:
119 :
120 : Bool applyFFT_p;
121 : };
122 : } //# NAMESPACE CASA - END
123 : };
124 : #endif
|