casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VPManager.h
Go to the documentation of this file.
1 //# VPManager functionality sits here;
2 //# Copyright (C) 1996-2011
3 //# Associated Universities, Inc. Washington DC, USA.
4 //# Copyright 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 //#
26 //# $Id$
27 
28 #ifndef SYNTHESIS_VPMANAGER_H
29 #define SYNTHESIS_VPMANAGER_H
30 
31 #include <map>
33 
34 namespace casacore{
35 
36  class Record;
37 }
38 
39 namespace casa {
40  //Forward declarations
41 
42  class VPManager
43  {
44 
45  public:
46  // no need of enums here use the one from PBMathInterface
47  // enum Type{NONE, COMMONPB, AIRY, GAUSS, POLY, IPOLY, COSPOLY,
48  // NUMERIC, IMAGE, ZERNIKE, MAX=ZERNIKE};
49 
50  // this is a SINGLETON class
51  static VPManager* Instance();
52 
53  void reset(casacore::Bool verbose=false);
54 
56 
58 
60 
61 
63  const casacore::String& other,
64  const casacore::Bool dopb,
65  const casacore::String& commonpb,
66  const casacore::Bool dosquint,
67  const casacore::Quantity& paincrement,
68  const casacore::Bool usesymmetricbeam,
69  casacore::Record& rec);
70 
71  casacore::Bool setpbairy(const casacore::String& telescope, const casacore::String& othertelescope,
72  const casacore::Bool dopb, const casacore::Quantity& dishdiam,
73  const casacore::Quantity& blockagediam,
74  const casacore::Quantity& maxrad,
75  const casacore::Quantity& reffreq,
76  casacore::MDirection& squintdir,
77  const casacore::Quantity& squintreffreq, const casacore::Bool dosquint,
78  const casacore::Quantity& paincrement,
79  const casacore::Bool usesymmetricbeam,
80  casacore::Record& rec);
81 
82  casacore::Bool setpbcospoly(const casacore::String& telescope, const casacore::String& othertelescope,
83  const casacore::Bool dopb, const casacore::Vector<casacore::Double>& coeff,
85  const casacore::Quantity& maxrad,
86  const casacore::Quantity& reffreq,
87  const casacore::String& isthispb,
88  casacore::MDirection& squintdir,
89  const casacore::Quantity& squintreffreq, const casacore::Bool dosquint,
90  const casacore::Quantity& paincrement,
91  const casacore::Bool usesymmetricbeam,
92  casacore::Record& rec);
93 
94  casacore::Bool setpbgauss(const casacore::String& tel, const casacore::String& other, const casacore::Bool dopb,
95  const casacore::Quantity& halfwidth, const casacore::Quantity maxrad,
96  const casacore::Quantity& reffreq, const casacore::String& isthispb,
97  casacore::MDirection& squintdir, const casacore::Quantity& squintreffreq,
98  const casacore::Bool dosquint, const casacore::Quantity& paincrement,
99  const casacore::Bool usesymmetricbeam, casacore::Record& rec);
100 
101 
102 
103 
104  casacore::Bool setpbinvpoly(const casacore::String& telescope, const casacore::String& othertelescope,
105  const casacore::Bool dopb, const casacore::Vector<casacore::Double>& coeff,
106  const casacore::Quantity& maxrad,
107  const casacore::Quantity& reffreq,
108  const casacore::String& isthispb,
109  casacore::MDirection& squintdir,
110  const casacore::Quantity& squintreffreq, const casacore::Bool dosquint,
111  const casacore::Quantity& paincrement,
112  const casacore::Bool usesymmetricbeam,
113  casacore::Record& rec);
114 
115  casacore::Bool setpbinvpoly(const casacore::String& telescope, const casacore::String& othertelescope,
116  const casacore::Bool dopb, const casacore::Matrix<casacore::Double>& coeff,
118  const casacore::Quantity& maxrad,
119  const casacore::Quantity& reffreq,
120  const casacore::String& isthispb,
121  casacore::MDirection& squintdir,
122  const casacore::Quantity& squintreffreq, const casacore::Bool dosquint,
123  const casacore::Quantity& paincrement,
124  const casacore::Bool usesymmetricbeam,
125  casacore::Record& rec);
126 
127  casacore::Bool setpbnumeric(const casacore::String& telescope, const casacore::String& othertelescope,
128  const casacore::Bool dopb, const casacore::Vector<casacore::Double>& vect,
129  const casacore::Quantity& maxrad,
130  const casacore::Quantity& reffreq,
131  const casacore::String& isthispb,
132  casacore::MDirection& squintdir,
133  const casacore::Quantity& squintreffreq, const casacore::Bool dosquint,
134  const casacore::Quantity& paincrement,
135  const casacore::Bool usesymmetricbeam,
136  casacore::Record &rec);
137 
139  casacore::Bool setpbimage(const casacore::String& telescope, const casacore::String& othertelescope,
140  const casacore::Bool dopb, const casacore::String& realimage,
141  const casacore::String& imagimage, const casacore::String& compleximage, const casacore::Vector<casacore::String>& antnames, casacore::Record& rec);
145 
146  casacore::Bool setpbpoly(const casacore::String& telescope, const casacore::String& othertelescope,
147  const casacore::Bool dopb, const casacore::Vector<casacore::Double>& coeff,
148  const casacore::Quantity& maxrad,
149  const casacore::Quantity& reffreq,
150  const casacore::String& isthispb,
151  casacore::MDirection& squintdir,
152  const casacore::Quantity& squintreffreq, const casacore::Bool dosquint,
153  const casacore::Quantity& paincrement,
154  const casacore::Bool usesymmetricbeam,
155  casacore::Record &rec);
156 
157 
158  casacore::Bool setpbantresptable(const casacore::String& telescope, const casacore::String& othertelescope,
159  const casacore::Bool dopb, const casacore::String& tablepath);
160  // no record filled, need to access via getvp()
161 
162  // set the default voltage pattern for the given telescope
163  casacore::Bool setuserdefault(const casacore::Int vplistfield,
164  const casacore::String& telescope,
165  const casacore::String& antennatype="");
166 
168  const casacore::String& telescope,
169  const casacore::String& antennatype="");
170 
172  const casacore::String& telescope,
173  const casacore::MEpoch& obstime,
174  const casacore::MFrequency& freq,
175  const casacore::MDirection& obsdirection); // default: Zenith
176 
177  // return number of voltage patterns satisfying the given constraints
178  casacore::Int numvps(const casacore::String& telescope,
179  const casacore::MEpoch& obstime,
180  const casacore::MFrequency& freq,
181  const casacore::MDirection& obsdirection=casacore::MDirection(casacore::Quantity( 0., "deg"), // default is the Zenith
182  casacore::Quantity(90., "deg"),
184  );
185 
186 
187  // get the voltage pattern satisfying the given constraints
189  const casacore::String& telescope,
190  const casacore::MEpoch& obstime,
191  const casacore::MFrequency& freq,
192  const casacore::String& antennatype="",
193  const casacore::MDirection& obsdirection=casacore::MDirection(casacore::Quantity( 0., "deg"), // default is the Zenith
194  casacore::Quantity(90., "deg"),
196  );
197 
198  // get a general voltage pattern for the given telescope and ant type if available
200  const casacore::String& telescope,
201  const casacore::String& antennatype=""
202  );
203 
204  // get a set of all necessary beams and their properties for a given antenna list
205  casacore::Bool getvps(casacore::Vector<casacore::Record> & unique_out_rec_list, // the list of unique beam records
206  casacore::Vector<casacore::Vector<casacore::uInt> >& beam_index, // indices to the above vectors in sync with AntennaNames
207  const casacore::String& telescope,
208  const casacore::Vector<casacore::MEpoch>& inpTimeRange, // only elements 0 and 1 are used; if 1 is not present it is assumed to be inf
209  const casacore::Vector<casacore::MFrequency>& inpFreqRange, // must contain at least one element; beams will be provided for each element
210  const casacore::Vector<casacore::String>& AntennaNames, // characters 0 and 1 are used for ALMA to determine the antenna type
211  const casacore::MDirection& obsdirection=casacore::MDirection(casacore::Quantity( 0., "deg"), // default is the Zenith
212  casacore::Quantity(90., "deg"),
214  );
215 
217 
218  protected:
219  VPManager(casacore::Bool verbose=false);
220 
221  private:
223 
225 
227  std::map<casacore::String, casacore::Int > vplistdefaults_p;
229 
231  const casacore::String& antennatype){
232  if(antennatype.empty()) return telescope;
233  return telescope + " " + antennatype;
234  };
235 
237  casacore::String tempstr = antDesc;
238  if(tempstr.contains(" ")) return tempstr.before(" ");
239  return tempstr;
240  };
241 
243  casacore::String tempstr = antDesc;
244  if(tempstr.contains(" ")) return tempstr.after(" ");
245  tempstr = "";
246  return tempstr;
247  };
248 
249  };
250 
251 } //# NAMESPACE CASA - END
252 #endif
A Measure: astronomical direction.
Definition: MDirection.h:174
int Int
Definition: aipstype.h:50
casacore::Bool setpbairy(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::Quantity &dishdiam, const casacore::Quantity &blockagediam, const casacore::Quantity &maxrad, const casacore::Quantity &reffreq, casacore::MDirection &squintdir, const casacore::Quantity &squintreffreq, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
casacore::Bool imagepbinfo(casacore::Vector< casacore::Vector< casacore::String > > &antnames, casacore::Vector< casacore::Record > &imagebeams)
AntennaResponses provides access to antenna response data.
SubString after(size_type pos)
Start at startpos and extract the SubString &quot;after&quot; the argument&#39;s position, exclusive, to the String&#39;s end.
casacore::Bool setpbcospoly(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::Vector< casacore::Double > &coeff, const casacore::Vector< casacore::Double > &scale, const casacore::Quantity &maxrad, const casacore::Quantity &reffreq, const casacore::String &isthispb, casacore::MDirection &squintdir, const casacore::Quantity &squintreffreq, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
casacore::Bool getvp(casacore::Record &rec, const casacore::String &telescope, const casacore::MEpoch &obstime, const casacore::MFrequency &freq, const casacore::String &antennatype="", const casacore::MDirection &obsdirection=casacore::MDirection(casacore::Quantity(0.,"deg"), casacore::Quantity(90.,"deg"), casacore::MDirection::AZEL))
get the voltage pattern satisfying the given constraints
VPManager(casacore::Bool verbose=false)
casacore::Bool setuserdefault(const casacore::Int vplistfield, const casacore::String &telescope, const casacore::String &antennatype="")
no record filled, need to access via getvp()
casacore::Bool setpbgauss(const casacore::String &tel, const casacore::String &other, const casacore::Bool dopb, const casacore::Quantity &halfwidth, const casacore::Quantity maxrad, const casacore::Quantity &reffreq, const casacore::String &isthispb, casacore::MDirection &squintdir, const casacore::Quantity &squintreffreq, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
casacore::Bool saveastable(const casacore::String &tablename)
casacore::Bool setpbimage(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::String &realimage, const casacore::String &imagimage, const casacore::String &compleximage, const casacore::Vector< casacore::String > &antnames, casacore::Record &rec)
antnames =&gt; Antenna names for which this PB image applies. &quot;*&quot; is for all
A Measure: instant in time.
Definition: MEpoch.h:104
casacore::Int numvps(const casacore::String &telescope, const casacore::MEpoch &obstime, const casacore::MFrequency &freq, const casacore::MDirection &obsdirection=casacore::MDirection(casacore::Quantity(0.,"deg"), casacore::Quantity(90.,"deg"), casacore::MDirection::AZEL))
return number of voltage patterns satisfying the given constraints
casacore::String antennaDescription(const casacore::String &telescope, const casacore::String &antennatype)
Definition: VPManager.h:230
AntennaResponses aR_p
Definition: VPManager.h:228
A Measure: wave characteristics.
Definition: MFrequency.h:161
casacore::Bool getuserdefault(casacore::Int &vplistfield, const casacore::String &telescope, const casacore::String &antennatype="")
casacore::Bool vpRecIsIdentical(const casacore::Record &rec0, const casacore::Record &rec1)
casacore::Bool setpbpoly(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::Vector< casacore::Double > &coeff, const casacore::Quantity &maxrad, const casacore::Quantity &reffreq, const casacore::String &isthispb, casacore::MDirection &squintdir, const casacore::Quantity &squintreffreq, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
std::map< casacore::String, casacore::Int > vplistdefaults_p
Definition: VPManager.h:227
casacore::Bool loadfromtable(const casacore::String &tablename)
casacore::String telFromAntDesc(const casacore::String &antDesc)
Definition: VPManager.h:236
static casacore::Mutex mutex_p
Definition: VPManager.h:224
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Bool getanttypes(casacore::Vector< casacore::String > &anttypes, const casacore::String &telescope, const casacore::MEpoch &obstime, const casacore::MFrequency &freq, const casacore::MDirection &obsdirection)
casacore::Record vplist_p
Definition: VPManager.h:226
SubString before(size_type pos) const
Start at startpos and extract the string &quot;before&quot; the argument&#39;s position, exclusive.
Wrapper around a pthreads mutex.
Definition: Mutex.h:58
casacore::Bool setpbinvpoly(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::Vector< casacore::Double > &coeff, const casacore::Quantity &maxrad, const casacore::Quantity &reffreq, const casacore::String &isthispb, casacore::MDirection &squintdir, const casacore::Quantity &squintreffreq, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
casacore::Bool getvps(casacore::Vector< casacore::Record > &unique_out_rec_list, casacore::Vector< casacore::Vector< casacore::uInt > > &beam_index, const casacore::String &telescope, const casacore::Vector< casacore::MEpoch > &inpTimeRange, const casacore::Vector< casacore::MFrequency > &inpFreqRange, const casacore::Vector< casacore::String > &AntennaNames, const casacore::MDirection &obsdirection=casacore::MDirection(casacore::Quantity(0.,"deg"), casacore::Quantity(90.,"deg"), casacore::MDirection::AZEL))
get a set of all necessary beams and their properties for a given antenna list
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void reset(casacore::Bool verbose=false)
static VPManager * instance_p
Definition: VPManager.h:222
Forward declarations.
Definition: VPManager.h:42
Bool contains(Char c) const
Containment.
Definition: String.h:699
casacore::Bool setpbnumeric(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::Vector< casacore::Double > &vect, const casacore::Quantity &maxrad, const casacore::Quantity &reffreq, const casacore::String &isthispb, casacore::MDirection &squintdir, const casacore::Quantity &squintreffreq, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
casacore::String antTypeFromAntDesc(const casacore::String &antDesc)
Definition: VPManager.h:242
casacore::Bool summarizevps(const casacore::Bool verbose)
static VPManager * Instance()
no need of enums here use the one from PBMathInterface enum Type{NONE, COMMONPB, AIRY, GAUSS, POLY, IPOLY, COSPOLY, NUMERIC, IMAGE, ZERNIKE, MAX=ZERNIKE};
casacore::Bool setpbantresptable(const casacore::String &telescope, const casacore::String &othertelescope, const casacore::Bool dopb, const casacore::String &tablepath)
casacore::Bool setcannedpb(const casacore::String &tel, const casacore::String &other, const casacore::Bool dopb, const casacore::String &commonpb, const casacore::Bool dosquint, const casacore::Quantity &paincrement, const casacore::Bool usesymmetricbeam, casacore::Record &rec)
Bool empty() const
Test for empty.
Definition: String.h:375
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42