Line data Source code
1 : //# CFTerms.h: Definition for CFTerms 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: 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_CFTERMS_H 30 : #define SYNTHESIS_TRANSFORM2_CFTERMS_H 31 : 32 : 33 : #include <casacore/casa/Arrays/Vector.h> 34 : #include <casacore/images/Images/ImageInterface.h> 35 : #include <casacore/images/Images/PagedImage.h> 36 : #include <casacore/images/Images/TempImage.h> 37 : #include <msvis/MSVis/VisBuffer2.h> 38 : #include <casacore/casa/Containers/Block.h> 39 : 40 : namespace casa{ 41 : namespace refim{ 42 : using namespace vi; 43 : // <summary> 44 : // The base class to represent the Aperture-Term of the Measurement Equation. 45 : // </summary> 46 : 47 : // <use visibility=export> 48 : // <prerequisite> 49 : // </prerequisite> 50 : // <etymology> 51 : // A-Term to account for the effects of the antenna primary beam(s). 52 : // </etymology> 53 : // 54 : // <synopsis> 55 : // 56 : //</synopsis> 57 : class CFTerms 58 : { 59 : public: 60 : enum OpCodes {NOOP=0,NORMAL}; 61 0 : CFTerms ():opCode_p(NORMAL) {}; 62 0 : virtual ~CFTerms () {}; 63 : 64 0 : virtual void setOpCode(OpCodes code) {opCode_p = code;} 65 0 : virtual casacore::Bool isNoOp() {return opCode_p==NOOP;}; 66 : 67 : virtual casacore::String name() = 0; 68 : 69 : virtual void applySky(casacore::ImageInterface<casacore::Float>& outputImages, 70 : const VisBuffer2& vb, 71 : const casacore::Bool doSquint=true, 72 : const casacore::Int& cfKey=0, 73 : const casacore::Int& muellerTerms=0, 74 : const casacore::Double freqVal=-1) = 0; 75 : virtual void applySky(casacore::ImageInterface<casacore::Complex>& outputImages, 76 : const VisBuffer2& vb, 77 : const casacore::Bool doSquint=true, 78 : const casacore::Int& cfKey=0, 79 : const casacore::Int& muellerTerms=0, 80 : const casacore::Double freqVal=-1) = 0; 81 : // 82 : // Not sure if the following method is requried. Leaving it in 83 : // the code for now with an implementation that does nothing. 84 : // 85 : // virtual void applySky(casacore::Matrix<casacore::Complex>& screen, const casacore::Int wPixel, 86 : // const casacore::Vector<casacore::Double>& sampling, 87 : // const casacore::Int wConvSize, const casacore::Double wScale, 88 : // const casacore::Int inner) 89 : // {(void)screen; (void)wPixel; (void)sampling; (void)wConvSize; (void)wScale; (void)inner;}; 90 : 91 : // 92 : // Returns a vector of integers that map each row in the given 93 : // VisBuffer to an index that is used to pick the appropriate 94 : // convolution function plane. It also returns the number of 95 : // unique baselines in the nUnique parameter (unique baselines are 96 : // defined as the number of baselines each requiring a unique 97 : // convolution function). 98 : // 99 : // This is required for Heterogeneous antenna arrays (like ALMA) 100 : // and for all arrays where not all antenna aperture illuminations 101 : // can be treated as identical. 102 : // 103 : virtual casacore::Vector<casacore::Int> vbRow2CFKeyMap(const VisBuffer2& vb, casacore::Int& nUnique) = 0; 104 : virtual casacore::Int makePBPolnCoords(const VisBuffer2& vb, 105 : const casacore::Int& convSize, 106 : const casacore::Int& convSampling, 107 : const casacore::CoordinateSystem& skyCoord, 108 : const casacore::Int& skyNx, const casacore::Int& skyNy, 109 : casacore::CoordinateSystem& feedCoord) = 0; 110 : 111 : virtual casacore::Int getConvSize() = 0; 112 : virtual void setConvSize(const casacore::Int val) = 0; 113 : virtual casacore::Int getOversampling() = 0; 114 : 115 : virtual casacore::Float getConvWeightSizeFactor() = 0; 116 : virtual casacore::Float getSupportThreshold() = 0; 117 : 118 : virtual void normalizeImage(casacore::Lattice<casacore::Complex>& skyImage, 119 : const casacore::Matrix<casacore::Float>& weights) = 0; 120 : 121 : virtual int getVisParams(const VisBuffer2& vb, const casacore::CoordinateSystem& skyCoord=casacore::CoordinateSystem()) = 0; 122 : // 123 : // The mapping from VisBuffer polarizations map to the Image plane 124 : // polarization. The latter is determined by the user input, 125 : // which is passed to the FTMachine in Imager.cc 126 : // 127 : // The map is available in the FTMachine which uses this method to 128 : // set the map for the CFTerms object. 129 : // 130 0 : virtual void setPolMap(const casacore::Vector<casacore::Int>& polMap) {polMap_p_base.resize(0);polMap_p_base=polMap;} 131 0 : virtual void getPolMap(casacore::Vector<casacore::Int>& polMap) {polMap.resize(0); polMap = polMap_p_base;}; 132 : 133 : virtual casacore::Bool rotationallySymmetric() = 0; 134 : 135 0 : void setBandName(const casacore::String& bandName) {bandName_p = bandName;}; 136 : casacore::String& getBandName() {return bandName_p;}; 137 : 138 : protected: 139 : casacore::LogIO& logIO() {return logIO_p;} 140 : casacore::LogIO logIO_p; 141 : casacore::Vector<casacore::Int> polMap_p_base; 142 : OpCodes opCode_p; 143 : casacore::String telescopeName_p, bandName_p; 144 : }; 145 : 146 : }///refim 147 : }//casa 148 : #endif