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
00029 #ifndef SYNTHESIS_PBMATH_H
00030 #define SYNTHESIS_PBMATH_H
00031
00032 #include <casa/aips.h>
00033 #include <synthesis/TransformMachines/PBMathInterface.h>
00034 #include <synthesis/TransformMachines/PBMath1DGauss.h>
00035 #include <synthesis/TransformMachines/PBMath1DNumeric.h>
00036 #include <synthesis/TransformMachines/PBMath1DAiry.h>
00037 #include <synthesis/TransformMachines/PBMath1DPoly.h>
00038 #include <synthesis/TransformMachines/PBMath1DIPoly.h>
00039 #include <synthesis/TransformMachines/PBMath1DCosPoly.h>
00040 #include <synthesis/TransformMachines/PBMath2DImage.h>
00041 #include <synthesis/TransformMachines/BeamSquint.h>
00042 #include <images/Images/ImageInterface.h>
00043 #include <measures/Measures.h>
00044 #include <casa/Utilities/CountedPtr.h>
00045
00046 namespace casa {
00047
00048
00049 class Table;
00050 class ImageRegion;
00051 class RecordInterface;
00052 class CoordinateSystem;
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 class PBMath {
00123 public:
00124
00125
00126
00127
00128
00129
00130 enum CommonPB {UNKNOWN, DEFAULT,
00131 ATCA_L1, ATCA_L2, ATCA_L3, ATCA_S, ATCA_C, ATCA_X,
00132 GBT,
00133 GMRT,
00134 HATCREEK,
00135 NRAO12M,
00136 NRAO140FT,
00137 OVRO,
00138 VLA, VLA_INVERSE, VLA_NVSS, VLA_2NULL,
00139 VLA_4, VLA_P, VLA_L, VLA_C, VLA_X, VLA_U, VLA_K, VLA_Q,
00140 WSRT, WSRT_LOW, ALMA, ALMASD, ACA, IRAMPDB, IRAM30M, SMA,
00141 ATA, ATCA_C_RI, ATCA, ATCA_16, ATCA_K, ATCA_Q, ATCA_W, EVLA, NONE
00142 };
00143
00144 enum {
00145 NumberOfCommonPB=43 };
00146
00147
00148 PBMath();
00149
00150
00151 explicit PBMath(PBMath::CommonPB myPBType, Bool useSymmetricBeam=False);
00152
00153
00154
00155 PBMath(String& telescopeName, Bool useSymmetricBeam=False,
00156 Quantity freq=Quantity(0.0, "Hz"));
00157
00158
00159 PBMath(Double dishDiam, Bool useSymmetricBeam, Quantity freq);
00160
00161
00162 explicit PBMath(const RecordInterface& myrec);
00163
00164
00165 PBMath(PBMathInterface::PBClass theclass, Quantity halfWidth,
00166 Quantity maxRad, Quantity refFreq,
00167 Bool isThisVP=False,
00168 BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00169 Quantity(0.0, "deg"),
00170 MDirection::Ref(MDirection::AZEL)),
00171 Quantity(1.0, "GHz")),
00172 Bool useSymmetricBeam=False);
00173
00174
00175
00176
00177
00178 PBMath(PBMathInterface::PBClass theclass, const Vector<Double>& coeff,
00179 Quantity maxRad, Quantity refFreq,
00180 Bool isThisVP=False,
00181 BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00182 Quantity(0.0, "deg"),
00183 MDirection::Ref(MDirection::AZEL)),
00184 Quantity(1.0, "GHz")),
00185 Bool useSymmetricBeam=False);
00186
00187
00188
00189
00190 PBMath(PBMathInterface::PBClass theclass, const Vector<Float>& coeff,
00191 Quantity maxRad, Quantity refFreq,
00192 Bool isThisVP=False,
00193 BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00194 Quantity(0.0, "deg"),
00195 MDirection::Ref(MDirection::AZEL)),
00196 Quantity(1.0, "GHz")),
00197 Bool useSymmetricBeam=False);
00198
00199
00200
00201 PBMath(PBMathInterface::PBClass theclass, const Vector<Double>& coeff,
00202 const Vector<Double>& scale,
00203 Quantity maxRad, Quantity refFreq,
00204 Bool isThisVP=False,
00205 BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00206 Quantity(0.0, "deg"),
00207 MDirection::Ref(MDirection::AZEL)),
00208 Quantity(1.0, "GHz")),
00209 Bool useSymmetricBeam=False);
00210
00211
00212 PBMath(PBMathInterface::PBClass theclass, Quantity dishDiam, Quantity blockageDiam,
00213 Quantity maxRad, Quantity refFreq,
00214 BeamSquint squint=BeamSquint(MDirection(Quantity(0.0, "deg"),
00215 Quantity(0.0, "deg"),
00216 MDirection::Ref(MDirection::AZEL)),
00217 Quantity(1.0, "GHz")),
00218 Bool useSymmetricBeam=False);
00219
00220
00221 PBMath(PBMathInterface::PBClass theclass,
00222 ImageInterface<Float>& reJones);
00223 PBMath(PBMathInterface::PBClass theclass,
00224 ImageInterface<Float>& reJones,
00225 ImageInterface<Float>& imJones);
00226
00227
00228
00229
00230
00231
00232 PBMath(const PBMath &other);
00233
00234
00235 ~PBMath();
00236
00237
00238 PBMath& operator=(const PBMath& other);
00239
00240
00241
00242
00243 Bool operator==(const PBMath& other) const;
00244
00245
00246
00247
00248 Bool operator!=(const PBMath& other) const;
00249
00250
00251
00252
00253
00254
00255
00256
00257 ImageInterface<Complex>& applyVP(const ImageInterface<Complex>& in,
00258 ImageInterface<Complex>& out,
00259 const MDirection& sp,
00260 const Quantity parAngle = Quantity(0.0,"deg"),
00261 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00262 Bool inverse = False,
00263 Bool conjugate = False,
00264 Float cutoff = 0.01,
00265 Bool forward=True);
00266
00267 ImageInterface<Complex>& applyPB(const ImageInterface<Complex>& in,
00268 ImageInterface<Complex>& out,
00269 const MDirection& sp,
00270 const Quantity parAngle = Quantity(0.0,"deg"),
00271 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00272 Bool inverse = False,
00273 Float cutoff = 0.01,
00274 Bool forward = True);
00275
00276 ImageInterface<Float>& applyPB(const ImageInterface<Float>& in,
00277 ImageInterface<Float>& out,
00278 const MDirection& sp,
00279 const Quantity parAngle = Quantity(0.0,"deg"),
00280 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00281 Float cutoff = 0.01);
00282
00283
00284 ImageInterface<Float>& applyPB2(const ImageInterface<Float>& in,
00285 ImageInterface<Float>& out,
00286 const MDirection& sp,
00287 const Quantity parAngle = Quantity(0.0,"deg"),
00288 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00289 Float cutoff=0.01);
00290
00291
00292
00293
00294 SkyComponent& applyVP(SkyComponent& in,
00295 SkyComponent& out,
00296 const MDirection& sp,
00297 const Quantity frequency,
00298 const Quantity parAngle = Quantity(0.0,"deg"),
00299 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00300 Bool inverse = False,
00301 Bool conjugate = False,
00302 Float cutoff = 0.01,
00303 Bool forward = True);
00304
00305 SkyComponent& applyPB(SkyComponent& in,
00306 SkyComponent& out,
00307 const MDirection& sp,
00308 const Quantity frequency,
00309 const Quantity parAngle = Quantity(0.0,"deg"),
00310 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00311 Bool inverse = False,
00312 Float cutoff = 0.01,
00313 Bool forward = True);
00314
00315 SkyComponent& applyPB2(SkyComponent& in,
00316 SkyComponent& out,
00317 const MDirection& sp,
00318 const Quantity frequency,
00319 const Quantity parAngle = Quantity(0.0,"deg"),
00320 const BeamSquint::SquintType doSquint = BeamSquint::NONE);
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330 void setUseSymmetric(Bool useSym=True) { pb_pointer_p->setUseSymmetric(useSym); }
00331
00332
00333 Bool getUseSymmetric() { return pb_pointer_p->getUseSymmetric(); }
00334
00335
00336 PBMathInterface::PBClass whichPBClass() { return pb_pointer_p->whichPBClass(); }
00337
00338
00339 void summary(Int nValues=0);
00340
00341
00342 Bool ok() const;
00343
00344
00345
00346
00347
00348
00349
00350 ImageRegion* extent (const ImageInterface<Complex>& im,
00351 const MDirection& pointing,
00352 const Int row,
00353 const Float fPad,
00354 const Int iChan,
00355 const SkyJones::SizeType);
00356 ImageRegion* extent (const ImageInterface<Float>& im,
00357 const MDirection& pointing,
00358 const Int row,
00359 const Float fPad,
00360 const Int iChan,
00361 const SkyJones::SizeType);
00362
00363 Int support (const CoordinateSystem& cs);
00364
00365
00366
00367 static void whichCommonPBtoUse (String &telescope, Quantity &freq,
00368 String &band, PBMath::CommonPB &whichPB,
00369 String &pbName);
00370
00371
00372 static void nameCommonPB(const PBMath::CommonPB iPB, String & str);
00373
00374
00375 static void enumerateCommonPB(const String & str, PBMath::CommonPB &ipb);
00376
00377
00378
00379 static PBMathInterface* pbMathInterfaceForCommonPB(const PBMath::CommonPB ipb, Bool useSymmetricBeam);
00380
00381
00382 void namePBClass(String & name) { pb_pointer_p->namePBClass(name); }
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399 protected:
00400
00401
00402
00403 ImageInterface<Complex>& apply(const ImageInterface<Complex>& in,
00404 ImageInterface<Complex>& out,
00405 const MDirection& sp,
00406 const Quantity parAngle,
00407 const BeamSquint::SquintType doSquint,
00408 Bool inverse,
00409 Bool conjugate,
00410 Int ipower,
00411 Float cutoff=0.01,
00412 Bool forward=True);
00413
00414 SkyComponent& apply(SkyComponent& in,
00415 SkyComponent& out,
00416 const MDirection& sp,
00417 const Quantity frequency,
00418 const Quantity parAngle,
00419 const BeamSquint::SquintType doSquint,
00420 Bool inverse,
00421 Bool conjugate,
00422 Int ipower,
00423 Float cutoff=0.01,
00424 Bool forward=True);
00425
00426
00427
00428 private:
00429
00430 CountedPtr<PBMathInterface> pb_pointer_p;
00431
00432
00433
00434
00435
00436 Bool getQuantity(const RecordInterface& rec, const String& item,
00437 Quantity& returnedQuantity) const;
00438 Bool getMDirection(const RecordInterface& rec, const String& item,
00439 MDirection& returnedMDirection) const;
00440
00441 void initByTelescope(PBMath::CommonPB myPBType, Bool useSymmetricBeam=False,
00442 Double frequency=0.0);
00443
00444
00445 void initByDiameter(Double diam, Bool useSymmetricBeam, Double freq);
00446
00447
00448
00449 };
00450
00451
00452
00453 }
00454
00455 #endif