00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef SYNTHESIS_VPMANAGER_H
00029 #define SYNTHESIS_VPMANAGER_H
00030
00031 #include <imageanalysis/ImageAnalysis/AntennaResponses.h>
00032
00033 namespace casa {
00034
00035 class Record;
00036
00037 class VPManager
00038 {
00039
00040 public:
00041
00042
00043
00044
00045
00046 static VPManager* Instance();
00047
00048 void reset(Bool verbose=False);
00049
00050 Bool saveastable(const String& tablename);
00051
00052 Bool loadfromtable(const String& tablename);
00053
00054 Bool summarizevps(const Bool verbose);
00055
00056
00057 Bool setcannedpb(const String& tel,
00058 const String& other,
00059 const Bool dopb,
00060 const String& commonpb,
00061 const Bool dosquint,
00062 const Quantity& paincrement,
00063 const Bool usesymmetricbeam,
00064 Record& rec);
00065
00066 Bool setpbairy(const String& telescope, const String& othertelescope,
00067 const Bool dopb, const Quantity& dishdiam,
00068 const Quantity& blockagediam,
00069 const Quantity& maxrad,
00070 const Quantity& reffreq,
00071 MDirection& squintdir,
00072 const Quantity& squintreffreq, const Bool dosquint,
00073 const Quantity& paincrement,
00074 const Bool usesymmetricbeam,
00075 Record& rec);
00076
00077 Bool setpbcospoly(const String& telescope, const String& othertelescope,
00078 const Bool dopb, const Vector<Double>& coeff,
00079 const Vector<Double>& scale,
00080 const Quantity& maxrad,
00081 const Quantity& reffreq,
00082 const String& isthispb,
00083 MDirection& squintdir,
00084 const Quantity& squintreffreq, const Bool dosquint,
00085 const Quantity& paincrement,
00086 const Bool usesymmetricbeam,
00087 Record& rec);
00088
00089 Bool setpbgauss(const String& tel, const String& other, const Bool dopb,
00090 const Quantity& halfwidth, const Quantity maxrad,
00091 const Quantity& reffreq, const String& isthispb,
00092 MDirection& squintdir, const Quantity& squintreffreq,
00093 const Bool dosquint, const Quantity& paincrement,
00094 const Bool usesymmetricbeam, Record& rec);
00095
00096
00097
00098
00099 Bool setpbinvpoly(const String& telescope, const String& othertelescope,
00100 const Bool dopb, const Vector<Double>& coeff,
00101 const Quantity& maxrad,
00102 const Quantity& reffreq,
00103 const String& isthispb,
00104 MDirection& squintdir,
00105 const Quantity& squintreffreq, const Bool dosquint,
00106 const Quantity& paincrement,
00107 const Bool usesymmetricbeam,
00108 Record& rec);
00109
00110 Bool setpbinvpoly(const String& telescope, const String& othertelescope,
00111 const Bool dopb, const Matrix<Double>& coeff,
00112 const Vector<Double>& freqs,
00113 const Quantity& maxrad,
00114 const Quantity& reffreq,
00115 const String& isthispb,
00116 MDirection& squintdir,
00117 const Quantity& squintreffreq, const Bool dosquint,
00118 const Quantity& paincrement,
00119 const Bool usesymmetricbeam,
00120 Record& rec);
00121
00122 Bool setpbnumeric(const String& telescope, const String& othertelescope,
00123 const Bool dopb, const Vector<Double>& vect,
00124 const Quantity& maxrad,
00125 const Quantity& reffreq,
00126 const String& isthispb,
00127 MDirection& squintdir,
00128 const Quantity& squintreffreq, const Bool dosquint,
00129 const Quantity& paincrement,
00130 const Bool usesymmetricbeam,
00131 Record &rec);
00132
00134 Bool setpbimage(const String& telescope, const String& othertelescope,
00135 const Bool dopb, const String& realimage,
00136 const String& imagimage, const String& compleximage, const Vector<String>& antnames, Record& rec);
00139 Bool imagepbinfo(Vector<Vector<String> >& antnames, Vector<Record>& imagebeams);
00140
00141 Bool setpbpoly(const String& telescope, const String& othertelescope,
00142 const Bool dopb, const Vector<Double>& coeff,
00143 const Quantity& maxrad,
00144 const Quantity& reffreq,
00145 const String& isthispb,
00146 MDirection& squintdir,
00147 const Quantity& squintreffreq, const Bool dosquint,
00148 const Quantity& paincrement,
00149 const Bool usesymmetricbeam,
00150 Record &rec);
00151
00152
00153 Bool setpbantresptable(const String& telescope, const String& othertelescope,
00154 const Bool dopb, const String& tablepath);
00155
00156
00157
00158 Bool setuserdefault(const Int vplistfield,
00159 const String& telescope,
00160 const String& antennatype="");
00161
00162 Bool getuserdefault(Int& vplistfield,
00163 const String& telescope,
00164 const String& antennatype="");
00165
00166 Bool getanttypes(Vector<String>& anttypes,
00167 const String& telescope,
00168 const MEpoch& obstime,
00169 const MFrequency& freq,
00170 const MDirection& obsdirection);
00171
00172
00173 Int numvps(const String& telescope,
00174 const MEpoch& obstime,
00175 const MFrequency& freq,
00176 const MDirection& obsdirection=MDirection(Quantity( 0., "deg"),
00177 Quantity(90., "deg"),
00178 MDirection::AZEL)
00179 );
00180
00181
00182
00183 Bool getvp(Record &rec,
00184 const String& telescope,
00185 const MEpoch& obstime,
00186 const MFrequency& freq,
00187 const String& antennatype="",
00188 const MDirection& obsdirection=MDirection(Quantity( 0., "deg"),
00189 Quantity(90., "deg"),
00190 MDirection::AZEL)
00191 );
00192
00193
00194 Bool getvp(Record &rec,
00195 const String& telescope,
00196 const String& antennatype=""
00197 );
00198
00199
00200 Bool getvps(Vector<Record> & unique_out_rec_list,
00201 Vector<Vector<uInt> >& beam_index,
00202 const String& telescope,
00203 const Vector<MEpoch>& inpTimeRange,
00204 const Vector<MFrequency>& inpFreqRange,
00205 const Vector<String>& AntennaNames,
00206 const MDirection& obsdirection=MDirection(Quantity( 0., "deg"),
00207 Quantity(90., "deg"),
00208 MDirection::AZEL)
00209 );
00210
00211 Bool vpRecIsIdentical(const Record& rec0, const Record& rec1);
00212
00213 protected:
00214 VPManager(Bool verbose=False);
00215
00216 private:
00217 static VPManager* instance_p;
00218
00219 static Mutex mutex_p;
00220
00221 Record vplist_p;
00222 SimpleOrderedMap<String, Int > vplistdefaults_p;
00223 AntennaResponses aR_p;
00224
00225 inline String antennaDescription(const String& telescope,
00226 const String& antennatype){
00227 if(antennatype.empty()) return telescope;
00228 return telescope + " " + antennatype;
00229 };
00230
00231 inline String telFromAntDesc(const String& antDesc){
00232 String tempstr = antDesc;
00233 if(tempstr.contains(" ")) return tempstr.before(" ");
00234 return tempstr;
00235 };
00236
00237 inline String antTypeFromAntDesc(const String& antDesc){
00238 String tempstr = antDesc;
00239 if(tempstr.contains(" ")) return tempstr.after(" ");
00240 tempstr = "";
00241 return tempstr;
00242 };
00243
00244 };
00245
00246 }
00247 #endif