casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ALMAAperture.h
Go to the documentation of this file.
1 //# ALMAAperture.h: Definition of the ALMAAperture class
2 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //# Copyright (C) 2011 by ESO (in the framework of the ALMA collaboration)
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 //
29 #ifndef SYNTHESIS_ALMAAPERTURE_H
30 #define SYNTHESIS_ALMAAPERTURE_H
31 
39 
40 //
41 //---------------------------------------------------------------------
42 //---------------------------------------------------------------------
43 // TEMPS The following #defines should REALLY GO!
44 //---------------------------------------------------------------------
45 //---------------------------------------------------------------------
46 //
47 // #define CONVSIZE (1024*2)
48 // #define CONVWTSIZEFACTOR sqrt(2.0)
49 // #define OVERSAMPLING 10
50 // #define THRESHOLD 1E-3
51 
52 namespace casacore{
53 
54  template<class T> class ImageInterface;
55  template<class T> class Matrix;
56 }
57 
58 namespace casa { //# NAMESPACE CASA - BEGIN
59  class VisBuffer;
60 
63  ALMA_DA = 1,
68  };
69 
70  // class ALMAAperture : public ATerm
71  class ALMAAperture : public AzElAperture
72  {
73  public:
74  ALMAAperture();
75 
76  ~ALMAAperture();
77 
78  ALMAAperture& operator=(const ALMAAperture& other);
79  //
80  // Overload these functions. They are pure virtual in the base class (ATerm).
81  //
83  const VisBuffer& vb,
84  casacore::Bool doSquint, casacore::Int& bandID, casacore::Double freqVal);
85 
86  virtual casacore::String name() {return casacore::String("ALMA Aperture");};
87 
89  const VisBuffer& vb,
90  const casacore::Bool doSquint=true,
91  const casacore::Int& cfKey=0,
92  const casacore::Double freqVal=-1.0)
93  {
94  (void)freqVal;applySky(outputImage, vb, doSquint, cfKey, false);
95  };
97  const VisBuffer& vb,
98  const casacore::Bool doSquint=true,
99  const casacore::Int& cfKey=0,
100  const casacore::Double freqVal=-1.0)
101  {(void)freqVal;applySky(outputImage, vb, doSquint, cfKey, false);};
102 
104  const VisBuffer& vb,
105  const casacore::Bool doSquint,
106  const casacore::Int& cfKey,
107  const casacore::Bool raytrace); // if true, use raytracing even if canned responses exist
109  const VisBuffer& vb,
110  const casacore::Bool doSquint,
111  const casacore::Int& cfKey,
112  const casacore::Bool raytrace); // if true, use raytracing even if canned responses exist
113 
115 
116  void cacheVBInfo(const casacore::String& telescopeName, const casacore::Float& diameter);
117  void cacheVBInfo(const VisBuffer& vb);
118  casacore::Int getBandID(const casacore::Double& freq, const casacore::String& telescopeName);
119 
120  virtual void setPolMap(const casacore::Vector<casacore::Int>& polMap) {polMap_p.resize(0);polMap_p=polMap;};
121  virtual void getPolMap(casacore::Vector<casacore::Int>& polMap) {polMap.resize(0);polMap=polMap_p;};
122  // virtual casacore::Int getConvSize() {return CONVSIZE;};
123  // virtual casacore::Int getOversampling() {return OVERSAMPLING;}
124  // virtual casacore::Float getConvWeightSizeFactor() {return CONVWTSIZEFACTOR;};
125  // virtual casacore::Float getSupportThreshold() {return THRESHOLD;};
126 
127  // tell the antenna type number for each antenna in the antenna table
129 
130  // call this before reusing the same ALMAAperture object on a different MS
132 
133  // derive type number from first two characters in antenna name,
134  // return -1 if not recognised
137 
140 
141  // generate the lists of antenna types for the whole vb
143 
146  const casacore::Int& convSize,
147  const casacore::Int& convSampling,
148  const casacore::CoordinateSystem& skyCoord,
149  const casacore::Int& skyNx, const casacore::Int& skyNy,
150  casacore::CoordinateSystem& feedCoord);
151 
152  void destroyAntResp(){ delete aR_p; aR_p=0;};
153 
154 
155  private:
156  static AntennaResponses* aR_p; // shared between all instances of this class
159  casacore::Bool haveCannedResponses_p; // true if there are precalculated response images available
160  casacore::Vector<ALMAAntennaType> antTypeMap_p; // maps antenna id to antenna type
162  };
163 };
164 #endif
casacore::Vector< casacore::Int > polMap_p
Definition: ALMAAperture.h:158
int Int
Definition: aipstype.h:50
static casacore::String antTypeStrFromType(const ALMAAntennaType &aType)
virtual void applySky(casacore::ImageInterface< casacore::Complex > &outputImage, const VisBuffer &vb, const casacore::Bool doSquint=true, const casacore::Int &cfKey=0, const casacore::Double freqVal=-1.0)
Definition: ALMAAperture.h:96
virtual void applySky(casacore::ImageInterface< casacore::Float > &outputImage, const VisBuffer &vb, const casacore::Bool doSquint=true, const casacore::Int &cfKey=0, const casacore::Double freqVal=-1.0)
Definition: ALMAAperture.h:88
static casacore::Vector< ALMAAntennaType > antennaTypesFromCFKey(const casacore::Int &cFKey)
static casacore::Bool orderMattersInCFKey
Definition: ALMAAperture.h:157
casacore::Int getVisParams(const VisBuffer &vb, const casacore::CoordinateSystem &skyCoord=casacore::CoordinateSystem())
casacore::Vector< ALMAAntennaType > antTypeList(const VisBuffer &vb)
generate the lists of antenna types for the whole vb
AntennaResponses provides access to antenna response data.
casacore::Int getBandID(const casacore::Double &freq, const casacore::String &telescopeName)
A 2-D Specialization of the Array class.
void resetAntTypeMap()
call this before reusing the same ALMAAperture object on a different MS
Definition: ALMAAperture.h:131
casacore::Vector< casacore::PagedImage< casacore::Complex > * > respImage_p
Definition: ALMAAperture.h:161
static AntennaResponses * aR_p
Definition: ALMAAperture.h:152
ALMAAperture & operator=(const ALMAAperture &other)
virtual casacore::Vector< casacore::Int > vbRow2CFKeyMap(const VisBuffer &vb, casacore::Int &nUnique)
Not sure if the following method is requried.
ALMAAntennaType
Definition: ALMAAperture.h:61
A base class for astronomical images.
double Double
Definition: aipstype.h:55
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Int makePBPolnCoords(const VisBuffer &vb, const casacore::Int &convSize, const casacore::Int &convSampling, const casacore::CoordinateSystem &skyCoord, const casacore::Int &skyNx, const casacore::Int &skyNy, casacore::CoordinateSystem &feedCoord)
Not sure if the following method is requried.
float Float
Definition: aipstype.h:54
casacore::Bool haveCannedResponses_p
Definition: ALMAAperture.h:159
static casacore::Int cFKeyFromAntennaTypes(const ALMAAntennaType aT1, const ALMAAntennaType aT2)
class ALMAAperture : public ATerm
Definition: ALMAAperture.h:71
virtual void makeFullJones(casacore::ImageInterface< casacore::Complex > &pbImage, const VisBuffer &vb, casacore::Bool doSquint, casacore::Int &bandID, casacore::Double freqVal)
Overload these functions.
casacore::Vector< ALMAAntennaType > antTypeMap_p
Definition: ALMAAperture.h:160
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
void resize(size_t len, Bool copyValues=False)
Definition: Vector.h:167
static ALMAAntennaType antTypeFromName(const casacore::String &name)
derive type number from first two characters in antenna name, return -1 if not recognised ...
virtual void setPolMap(const casacore::Vector< casacore::Int > &polMap)
The mapping from VisBuffer polarizations map to the Image plane polarization.
Definition: ALMAAperture.h:120
casacore::Vector< ALMAAntennaType > antTypeMap(const VisBuffer &vb)
virtual casacore::Int getConvSize() {return CONVSIZE;}; virtual casacore::Int getOversampling() {retu...
Interconvert pixel and world coordinates.
virtual void getPolMap(casacore::Vector< casacore::Int > &polMap)
Definition: ALMAAperture.h:121
virtual casacore::String name()
Definition: ALMAAperture.h:86
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
void cacheVBInfo(const casacore::String &telescopeName, const casacore::Float &diameter)