Line data Source code
1 : //# PSTerm.h: Definition for PSTerm
2 : //# Copyright (C) 2007
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: casa-feedback@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_PSTERM_H
30 : #define SYNTHESIS_TRANSFORM2_PSTERM_H
31 :
32 : #include <synthesis/TransformMachines2/Utils.h>
33 :
34 : #include <casacore/casa/Arrays/Vector.h>
35 : #include <msvis/MSVis/VisBuffer2.h>
36 : #include <casacore/images/Images/ImageInterface.h>
37 : #include <casacore/images/Images/PagedImage.h>
38 : #include <casacore/images/Images/TempImage.h>
39 : #include <casacore/scimath/Mathematics/ConvolveGridder.h>
40 : #include <synthesis/TransformMachines2/CFStore.h>
41 : #include <synthesis/TransformMachines2/CFTerms.h>
42 :
43 : namespace casa{
44 : namespace refim{
45 : // <summary> A class to apply the W-Term to the given image </summary>
46 :
47 : // <use visibility=export>
48 : // <prerequisite>
49 : // </prerequisite>
50 : // <etymology>
51 : // W-Term to account for non co-planar baselines
52 : // </etymology>
53 : //
54 : // <synopsis>
55 : //
56 : //</synopsis>
57 : class PSTerm: public CFTerms
58 : {
59 : public:
60 135 : PSTerm(): CFTerms() {};
61 : PSTerm (const casacore::IPosition shape,
62 : const casacore::Vector<casacore::Double>& uvScale,
63 : const casacore::Vector<casacore::Double>& uvOffset,
64 : const casacore::Double& psScale):psCtor_p()
65 : {init(shape,uvScale,uvOffset,psScale);};
66 :
67 270 : virtual ~PSTerm () {};
68 :
69 : void init(const casacore::IPosition shape,
70 : const casacore::Vector<casacore::Double>& uvScale,
71 : const casacore::Vector<casacore::Double>& uvOffset,
72 : const casacore::Double& psScale);
73 : void reinit(const casacore::IPosition shape,
74 : const casacore::Vector<casacore::Double>& uvScale,
75 : const casacore::Vector<casacore::Double>& uvOffset,
76 : const casacore::Double& psScale);
77 : casacore::Matrix<casacore::Complex>& operator=(casacore::Matrix<casacore::Complex>&);
78 : casacore::Matrix<casacore::Complex>& operator*=(casacore::Matrix<casacore::Complex>&);
79 :
80 : void applySky(casacore::Matrix<casacore::Complex>& screen,casacore::Bool multiply=false);
81 : void applySky(casacore::Matrix<casacore::Complex>& screen,
82 : const casacore::Vector<casacore::Double>& sampling,
83 : const casacore::Int inner);
84 : void normalizeImage(casacore::Lattice<casacore::Complex>& skyImage,
85 : const casacore::Matrix<casacore::Float>& weights);
86 0 : virtual casacore::String name() {return casacore::String("PS Term");};
87 :
88 : //----------------------------------------------------------
89 : // Implementation of pure-virtual methods of CFTerms parent class.
90 : // CFTerms (and its derived classes) ned clean-up so that this
91 : // kind of code is not required everywhere).
92 0 : int getVisParams(const VisBuffer2& vb,const casacore::CoordinateSystem& skyCoord=casacore::CoordinateSystem())
93 0 : {(void)vb;(void)skyCoord;return 0;};
94 :
95 0 : void setPolMap(const casacore::Vector<casacore::Int>& polMap) {(void)polMap;};
96 :
97 0 : virtual casacore::Float getSupportThreshold() {return 1e-3;};
98 :
99 0 : void applySky(casacore::ImageInterface<casacore::Float>&,// outputImages,
100 : const VisBuffer2&,// vb,
101 : const casacore::Bool,// doSquint=true,
102 : const casacore::Int&,// cfKey=0,
103 : const casacore::Int&,// muellerTerm=0,
104 : const casacore::Double /*freqVal=-1*/)
105 0 : {};
106 :
107 0 : void applySky(casacore::ImageInterface<casacore::Complex>&,// outputImages,
108 : const VisBuffer2&,// vb,
109 : const casacore::Bool,// doSquint=true,
110 : const casacore::Int&,// cfKey=0,
111 : const casacore::Int&,// muellerTerm=0,
112 : const casacore::Double /*freqVal= -1*/ )
113 0 : {};
114 :
115 0 : casacore::Vector<casacore::Int> vbRow2CFKeyMap(const VisBuffer2& /*vb*/, casacore::Int& /*nUnique*/)
116 0 : {casacore::Vector<casacore::Int> tt;return tt;};
117 :
118 0 : casacore::Int makePBPolnCoords(const VisBuffer2&,// vb,
119 : const casacore::Int&,// convSize,
120 : const casacore::Int&,// convSampling,
121 : const casacore::CoordinateSystem&,// skyCoord,
122 : const casacore::Int&,// skyNx,
123 : const casacore::Int&,// skyNy,
124 : casacore::CoordinateSystem&// feedCoord
125 : )
126 0 : {return 0;};
127 :
128 0 : casacore::Int getConvSize() {return 0;};
129 0 : casacore::Int getOversampling() {return 20;};
130 0 : void setConvSize(const casacore::Int) {};
131 0 : casacore::Float getConvWeightSizeFactor() {return 1.0;};
132 :
133 0 : casacore::Bool rotationallySymmetric() {return true;};
134 :
135 : private:
136 : // spheroidal function
137 : casacore::CountedPtr<casacore::ConvolveGridder<casacore::Double, casacore::Complex> > psCtor_p;
138 : casacore::Vector<casacore::Double> support_p;
139 : casacore::Vector<casacore::Int> sampling_p;
140 : casacore::Double psScale_p;
141 : casacore::IPosition shape_p;
142 : casacore::Vector<casacore::Double> uvScale_p;
143 : casacore::Vector<casacore::Double> uvOffset_p;
144 : };
145 : };
146 : };
147 :
148 : #endif
|