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 #ifndef _IMAGEPOL__H__
00028 #define _IMAGEPOL__H__
00029
00030 #include <images/Images/ImagePolarimetry.h>
00031
00032
00033
00034
00035 namespace casa {
00036
00037 class LogIO;
00038 class String;
00039 class Record;
00040 class Normal;
00041 template<class T> class ImageInterface;
00042
00043 class ImagePol
00044 {
00045
00046 public:
00047
00048 ImagePol();
00049 ImagePol(ImageInterface<Float>& im);
00050 virtual ~ImagePol();
00051
00052
00053 Bool imagepoltestimage(const String& outFile = "imagepol.iquv",
00054 const Vector<Double>& rm = Vector<Double>(1, 0.0),
00055 Bool rmDefault = True,
00056 Double pa0 = 0.0, Double sigma = 0.01,
00057 Int nx = 32, Int ny = 32, Int nf = 32,
00058 Double f0 = 1.4e9, Double df = 128.0e6);
00059
00060 Bool open(ImageInterface<Float>& im);
00061 Bool open(const String& infile);
00062
00063
00064
00065
00066 Bool depolratio(ImageInterface<Float>*& rtnim, const String& infile,
00067 const Bool debias = False,
00068 const Double clip = 10.0, const Double sigma = -1,
00069 const String& oufile="");
00070
00071
00072 Bool complexlinpol(const String& outfile);
00073
00074
00075
00076 void summary() const;
00077
00078
00079 Float sigma(Float clip = 10.0) const;
00080
00081
00082 Bool stokesI(ImageInterface<Float>*& rtnim, const String& outfile="");
00083 Float sigmaStokesI(Float clip = 10.0) const;
00084
00085
00086 Bool stokesQ(ImageInterface<Float>*& rtnim, const String& outfile="");
00087 Float sigmaStokesQ(Float clip = 10.0) const;
00088
00089
00090 Bool stokesU(ImageInterface<Float>*& rtnim, const String& outfile="");
00091 Float sigmaStokesU(Float clip = 10.0) const;
00092
00093
00094 Bool stokesV(ImageInterface<Float>*& rtnim, const String& outfile="");
00095 Float sigmaStokesV(Float clip = 10.0) const;
00096
00097
00098 Bool linPolInt(ImageInterface<Float>*& rtnim, Bool debias = False,
00099 Float clip = 10.0,
00100 Float sigma = -1, const String& outfile = "");
00101 Float sigmaLinPolInt(Float clip = 10.0, Float sigma = -1) const;
00102
00103
00104 Bool totPolInt(ImageInterface<Float>*& rtnim, Bool debias = False,
00105 Float clip = 10.0,
00106 Float sigma = -1, const String& outfile = "");
00107 Float sigmaTotPolInt(Float clip = 10.0, Float sigma = -1) const;
00108
00109
00110 void complexLinearPolarization (const String& outfile);
00111
00112
00113 void complexFractionalLinearPolarization (const String& outfile);
00114
00115
00116 Bool linPolPosAng(ImageInterface<Float>*& rtnim,
00117 const String& outfile = "");
00118 Bool sigmaLinPolPosAng(ImageInterface<Float>*& rtnim, Float clip = 10.0,
00119 Float sigma = -1, const String& outfile = "");
00120
00121
00122 Bool fracLinPol(ImageInterface<Float>*& rtnim, Bool debias = False,
00123 Float clip = 10.0,
00124 Float sigma = -1, const String& outfile = "");
00125 Bool sigmaFracLinPol(ImageInterface<Float>*& rtnim, Float clip = 10.0,
00126 Float sigma = -1, const String& outfile = "");
00127
00128
00129 Bool fracTotPol(ImageInterface<Float>*& rtnim, Bool debias = False,
00130 Float clip = 10.0,
00131 Float sigma = -1, const String& outfile = "");
00132 Bool sigmaFracTotPol(ImageInterface<Float>*& rtnim, Float clip = 10.0,
00133 Float sigma = -1, const String& outfile = "");
00134
00135
00136 Bool depolarizationRatio (ImageInterface<Float>*& rtnim,
00137 const String& infile,
00138 Bool debias = False, Float clip = 10.0,
00139 Float sigma = -1, const String& outfile = "");
00140 Bool sigmaDepolarizationRatio (ImageInterface<Float>*& rtnim,
00141 const String& infile,
00142 Bool debias = False, Float clip = 10.0,
00143 Float sigma = -1, const String& outfile = "");
00144
00145
00146 void fourierRotationMeasure(const String& outfile = "",
00147 const String& outfileAmp = "",
00148 const String& outfilePA = "",
00149 const String& outfileReal = "",
00150 const String& outfileImag = "",
00151 Bool zeroZeroLag = False);
00152
00153
00154 void rotationMeasure(const String& outRM = "", const String& outRMErr = "",
00155 const String& outPA0 = "", const String& outPA0Err = "",
00156 const String& outNTurns = "",
00157 const String& outChiSq = "",
00158 Int axis = -1, Float varQU = -1, Float rmFg = 0.0,
00159 Float rmMax = 0.0, Float maxPaErr = 1e30,
00160 const String& plotter = "",
00161 Int nx = 5, Int ny = 5);
00162
00163
00164 void makeComplex (const String& complex, const String& real = "",
00165 const String& imag = "", const String& amp = "",
00166 const String& phase = "");
00167
00168 private:
00169 LogIO *itsLog;
00170 ImagePolarimetry *itsImPol;
00171
00172 Bool copyImage(ImageInterface<Float>*& out, const ImageInterface<Float>&in,
00173 const String& outfile="", Bool overwrite=true);
00174
00175 void copyMiscellaneous (ImageInterface<Complex>& out,
00176 const ImageInterface<Float>& in);
00177 void copyMiscellaneous (ImageInterface<Float>& out,
00178 const ImageInterface<Float>& in);
00179 void fiddleStokesCoordinate(ImageInterface<Float>& ie,
00180 Stokes::StokesTypes type);
00181 void fiddleStokesCoordinate(ImageInterface<Complex>& ie,
00182 Stokes::StokesTypes type);
00183
00184 Bool makeImage (ImageInterface<Complex>*& out,
00185 const String& outfile, const CoordinateSystem& cSys,
00186 const IPosition& shape, const Bool isMasked=False,
00187 const Bool tempAllowed=True);
00188 Bool makeImage (ImageInterface<Float>*& out,
00189 const String& outfile, const CoordinateSystem& cSys,
00190 const IPosition& shape, const Bool isMasked=False,
00191 const Bool tempAllowed=True);
00192
00193 Bool makeIQUVImage (ImageInterface<Float>*& pImOut, const String& outfile,
00194 Double sigma,
00195 Double pa0, const Vector<Float>& rm,
00196 const IPosition& shape,
00197 Double f0, Double dF);
00198
00199 Bool fillIQUV (ImageInterface<Float>& im, uInt stokesAxis,
00200 uInt spectralAxis, const Vector<Float>& rm,
00201 Float pa0);
00202
00203 void addNoise (Array<Float>& slice, Normal& noiseGen);
00204
00205 void centreRefPix (CoordinateSystem& cSys, const IPosition& shape);
00206
00207 Bool makeMask(ImageInterface<Float>& out, Bool init=False);
00208 Bool makeMask(ImageInterface<Complex>& out, Bool init=False);
00209
00210 Stokes::StokesTypes stokesType(const CoordinateSystem& cSys);
00211
00212
00213 };
00214
00215 }
00216
00217 #endif