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_PBMATHINTERFACE_H
00030 #define SYNTHESIS_PBMATHINTERFACE_H
00031
00032 #include <casa/aips.h>
00033 #include <synthesis/TransformMachines/BeamSquint.h>
00034 #include <images/Images/ImageInterface.h>
00035 #include <components/ComponentModels/Flux.h>
00036 #include <components/ComponentModels/ComponentShape.h>
00037 #include <casa/BasicSL/Complex.h>
00038 #include <synthesis/TransformMachines/SkyJones.h>
00039
00040 namespace casa {
00041
00042
00043 class Table;
00044 class MDirection;
00045 class CoordinateSystem;
00046 class SkyComponent;
00047 class ImageRegion;
00048 class String;
00049
00050
00051
00052
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 class PBMathInterface {
00111 public:
00112
00113
00114
00115
00116 friend class PBMath;
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 enum PBClass{NONE, COMMONPB, AIRY, GAUSS, POLY, IPOLY, COSPOLY,
00127 NUMERIC, IMAGE, ZERNIKE};
00128
00129
00130 enum {
00131 NumberOfPBClasses=10
00132 };
00133
00134
00135 PBMathInterface(Bool isThisVP,
00136 BeamSquint squint,
00137 Bool useSymmetricBeam);
00138
00139
00140 virtual ~PBMathInterface() = 0;
00141
00142
00143
00144
00145 ImageInterface<Complex>& applyVP(const ImageInterface<Complex>& in,
00146 ImageInterface<Complex>& out,
00147 const MDirection& sp,
00148 const Quantity parAngle = Quantity(0.0,"deg"),
00149 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00150 Bool inverse = False,
00151 Bool conjugate = False,
00152 Float cutoff = 0.01,
00153 Bool forward=True);
00154
00155 ImageInterface<Complex>& applyPB(const ImageInterface<Complex>& in,
00156 ImageInterface<Complex>& out,
00157 const MDirection& sp,
00158 const Quantity parAngle = Quantity(0.0,"deg"),
00159 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00160 Bool inverse = False,
00161 Float cutoff = 0.01,
00162 Bool forward=True);
00163
00164 ImageInterface<Float>& applyPB(const ImageInterface<Float>& in,
00165 ImageInterface<Float>& out,
00166 const MDirection& sp,
00167 const Quantity parAngle = Quantity(0.0,"deg"),
00168 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00169 Float cutoff = 0.01);
00170
00171
00172
00173 ImageInterface<Float>& applyPB2(const ImageInterface<Float>& in,
00174 ImageInterface<Float>& out,
00175 const MDirection& sp,
00176 const Quantity parAngle = Quantity(0.0,"deg"),
00177 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00178 Float cutoff=0.01);
00179
00180
00181
00182
00183 SkyComponent& applyVP(SkyComponent& in,
00184 SkyComponent& out,
00185 const MDirection& sp,
00186 const Quantity frequency,
00187 const Quantity parAngle = Quantity(0.0,"deg"),
00188 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00189 Bool inverse = False,
00190 Bool conjugate = False,
00191 Float cutoff = 0.01,
00192 Bool forward = True);
00193 SkyComponent& applyPB(SkyComponent& in,
00194 SkyComponent& out,
00195 const MDirection& sp,
00196 const Quantity frequency,
00197 const Quantity parAngle = Quantity(0.0,"deg"),
00198 const BeamSquint::SquintType doSquint = BeamSquint::NONE,
00199 Bool inverse = False,
00200 Float cutoff = 0.01,
00201 Bool forward = True);
00202 SkyComponent& applyPB2(SkyComponent& in,
00203 SkyComponent& out,
00204 const MDirection& sp,
00205 const Quantity frequency,
00206 const Quantity parAngle = Quantity(0.0,"deg"),
00207 const BeamSquint::SquintType doSquint = BeamSquint::NONE);
00208
00209
00210
00211 virtual PBClass whichPBClass() = 0;
00212
00213
00214 void namePBClass(String & name);
00215
00216
00217 static void namePBClass(const PBMathInterface::PBClass iPB, String & str);
00218
00219
00220
00221 virtual void setUseSymmetric(Bool useSym=True) { useSymmetricBeam_p = useSym; }
00222
00223
00224 virtual Bool getUseSymmetric() { return useSymmetricBeam_p; }
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235 virtual ImageRegion* extent (const ImageInterface<Complex>& im, const MDirection& pointing,
00236 const Int row, const Float fPad, const Int iChan,
00237 const SkyJones::SizeType) = 0;
00238 virtual ImageRegion* extent (const ImageInterface<Float>& im, const MDirection& pointing,
00239 const Int row, const Float fPad, const Int iChan,
00240 const SkyJones::SizeType) = 0;
00241
00242
00243
00244 virtual Int support (const CoordinateSystem& cs)=0;
00245
00246
00247
00248 virtual void summary(Int nValues=0);
00249
00250
00251 virtual Bool ok()=0;
00252
00253 protected:
00254
00255
00256 PBMathInterface();
00257
00258
00259
00260
00261 virtual
00262 ImageInterface<Complex>&
00263 apply(const ImageInterface<Complex>& in,
00264 ImageInterface<Complex>& out,
00265 const MDirection& sp,
00266 const Quantity parAngle,
00267 const BeamSquint::SquintType doSquint,
00268 Bool Inverse,
00269 Bool Conjugate,
00270 Int ipower,
00271 Float cutoff,
00272 Bool forward) =0;
00273
00274 virtual
00275 ImageInterface<Float>&
00276 apply(const ImageInterface<Float>& in,
00277 ImageInterface<Float>& out,
00278 const MDirection& sp,
00279 const Quantity parAngle,
00280 const BeamSquint::SquintType doSquint,
00281 Float cutoff, const Int ipower=4) =0;
00282
00283 virtual SkyComponent&
00284 apply(SkyComponent& in,
00285 SkyComponent& out,
00286 const MDirection& sp,
00287 const Quantity frequency,
00288 const Quantity parAngle,
00289 const BeamSquint::SquintType doSquint,
00290 Bool Inverse,
00291 Bool Conjugate,
00292 Int ipower,
00293 Float cutoff,
00294 Bool forward) =0;
00295
00296
00297
00298
00299
00300 static Float asFloat(const Complex & value) {return value.real(); }
00301 static Float asFloat(const DComplex & value){return (Float) value.real(); }
00302 static Float asFloat(const Float & value) {return value; }
00303 static Float asFloat(const Double & value) {return (Float) value; }
00304
00305
00306
00307
00308
00309
00310
00311 Bool isThisVP_p;
00312
00313
00314
00315
00316
00317 BeamSquint squint_p;
00318
00319
00320
00321 Bool useSymmetricBeam_p;
00322
00323 private:
00324
00325 };
00326
00327
00328 }
00329
00330 #endif
00331