casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImagePolProxy.h
Go to the documentation of this file.
1 //# ImagePolProxy.h: a casa namespace class for imagepol tool
2 //# Copyright (C) 2007
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: ImagePolProxy.h 20299 2008-04-03 05:56:44Z gervandiepen $
27 
28 #ifndef IMAGES_IMAGEPOL_H
29 #define IMAGES_IMAGEPOL_H
30 
32 
33 namespace casacore{
34 
35 class LogIO;
36 class String;
37 class Record;
38 class Normal;
39 template<class T> class ImageInterface;
40 }
41 
42 namespace casa {
43 
44 //# Forward declarations
45 
46 // Implementation of the image polarimetry functionality
47 // available from casapy.
48 
49 class ImagePol
50 {
51 
52  public:
53  // "imagepol" constructors
54  ImagePol();
56  virtual ~ImagePol();
57 
58  // Make test image
59  casacore::Bool imagepoltestimage(const casacore::String& outFile = "imagepol.iquv",
61  casacore::Bool rmDefault = true,
62  casacore::Double pa0 = 0.0, casacore::Double sigma = 0.01,
63  casacore::Int nx = 32, casacore::Int ny = 32, casacore::Int nf = 32,
64  casacore::Double f0 = 1.4e9, casacore::Double df = 128.0e6);
65 
67  casacore::Bool open(const casacore::String& infile);
68 
69  // Depolarization ratio
70  // The image containing the delpolratio is in the returnrec
71  // Can be recovered using casacore::ImageInterface::fromRecord
73  casacore::Bool debias = false,
74  casacore::Double clip = 10.0, casacore::Double sigma = -1,
75  const casacore::String& oufile="");
76 
77  //casacore::Complex linear polarization image is stored in outfile
79 
80 
81  // Summary
82  void summary() const;
83 
84  // sigma
85  casacore::Float sigma(casacore::Float clip = 10.0) const;
86 
87  // casacore::Stokes I
89  casacore::Float sigmaStokesI(casacore::Float clip = 10.0) const;
90 
91  // casacore::Stokes Q
93  casacore::Float sigmaStokesQ(casacore::Float clip = 10.0) const;
94 
95  // casacore::Stokes U
97  casacore::Float sigmaStokesU(casacore::Float clip = 10.0) const;
98 
99  // casacore::Stokes V
101  casacore::Float sigmaStokesV(casacore::Float clip = 10.0) const;
102  casacore::Float sigmaLinPolInt(casacore::Float clip = 10.0, casacore::Float sigma = -1) const;
103 
104  // Total polarized intensity.
105  casacore::Float sigmaTotPolInt(casacore::Float clip = 10.0, casacore::Float sigma = -1) const;
106 
107  // casacore::Complex linear polarization
108  void complexLinearPolarization (const casacore::String& outfile);
109 
110  // casacore::Complex linear polarization
112 
113  // Linearly polarized position angle
115  casacore::Float sigma = -1, const casacore::String& outfile = "");
116 
117  // Fractional linearly polarized intensity
119  casacore::Float clip = 10.0,
120  casacore::Float sigma = -1, const casacore::String& outfile = "");
122  casacore::Float sigma = -1, const casacore::String& outfile = "");
123 
124  // Fractional total polarized intensity
126  casacore::Float clip = 10.0,
127  casacore::Float sigma = -1, const casacore::String& outfile = "");
129  casacore::Float sigma = -1, const casacore::String& outfile = "");
130 
131  // Depolarization ratio
133  const casacore::String& infile,
134  casacore::Bool debias = false, casacore::Float clip = 10.0,
135  casacore::Float sigma = -1, const casacore::String& outfile = "");
137  const casacore::String& infile,
138  casacore::Bool debias = false, casacore::Float clip = 10.0,
139  casacore::Float sigma = -1, const casacore::String& outfile = "");
140 
141  // Find Rotation casacore::Measure from Fourier method
142  void fourierRotationMeasure(const casacore::String& outfile = "",
143  const casacore::String& outfileAmp = "",
144  const casacore::String& outfilePA = "",
145  const casacore::String& outfileReal = "",
146  const casacore::String& outfileImag = "",
147  casacore::Bool zeroZeroLag = false);
148 
149  // Find Rotation casacore::Measure from traditional method
150  void rotationMeasure(const casacore::String& outRM = "", const casacore::String& outRMErr = "",
151  const casacore::String& outPA0 = "", const casacore::String& outPA0Err = "",
152  const casacore::String& outNTurns = "",
153  const casacore::String& outChiSq = "",
154  casacore::Int axis = -1, casacore::Float varQU = -1, casacore::Float rmFg = 0.0,
155  casacore::Float rmMax = 0.0, casacore::Float maxPaErr = 1e30/*,
156  const casacore::String& plotter = "",
157  casacore::Int nx = 5, casacore::Int ny = 5*/);
158 
159  // Make a complex image
160  void makeComplex (const casacore::String& complex, const casacore::String& real = "",
161  const casacore::String& imag = "", const casacore::String& amp = "",
162  const casacore::String& phase = "");
163 
164  SPCIIF getImage() const { return itsImPol->imageInterface(); }
165 
166  private:
169 
171  const casacore::String& outfile="", casacore::Bool overwrite=true);
172  // Copy miscellaneous (MiscInfo, casacore::ImageInfo, history, units)
181  // Make a casacore::PagedImage or casacore::TempImage output
183  const casacore::String& outfile, const casacore::CoordinateSystem& cSys,
184  const casacore::IPosition& shape, casacore::Bool isMasked=false,
185  casacore::Bool tempAllowed=true);
187  const casacore::String& outfile, const casacore::CoordinateSystem& cSys,
188  const casacore::IPosition& shape, casacore::Bool isMasked=false,
189  casacore::Bool tempAllowed=true);
190  // Make an IQUV image with some dummy RM data
192  casacore::Double sigma,
194  const casacore::IPosition& shape,
196  // Fill IQUV image with casacore::Stokes values from RM data
198  casacore::uInt spectralAxis, const casacore::Vector<casacore::Float>& rm,
199  casacore::Float pa0);
200  // Add noise to Array
202  // Centre reference pixelin image
204  // Make and define a mask
207  // What casacore::Stokes type? Exception if more than one.
209 
210 
211 };
212 
213 } // casa namespace
214 
215 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::Bool stokesQ(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &outfile="")
casacore::Stokes Q
casacore::Bool makeMask(casacore::ImageInterface< casacore::Float > &out, casacore::Bool init=false)
Make and define a mask.
int Int
Definition: aipstype.h:50
casacore::Float sigmaStokesI(casacore::Float clip=10.0) const
casacore::Bool sigmaFracLinPol(casacore::ImageInterface< casacore::Float > *&rtnim, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
casacore::Bool depolratio(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &infile, casacore::Bool debias=false, casacore::Double clip=10.0, casacore::Double sigma=-1, const casacore::String &oufile="")
Depolarization ratio The image containing the delpolratio is in the returnrec Can be recovered using ...
casacore::Bool stokesU(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &outfile="")
casacore::Stokes U
LatticeExprNode imag(const LatticeExprNode &expr)
Polarimetric analysis of images.
void centreRefPix(casacore::CoordinateSystem &cSys, const casacore::IPosition &shape)
Centre reference pixelin image.
virtual Type type()
Return the type enum.
TableExprNode phase(const TableExprNode &node)
The phase (i.e.
Definition: ExprNode.h:1405
void fourierRotationMeasure(const casacore::String &outfile="", const casacore::String &outfileAmp="", const casacore::String &outfilePA="", const casacore::String &outfileReal="", const casacore::String &outfileImag="", casacore::Bool zeroZeroLag=false)
Find Rotation casacore::Measure from Fourier method.
void addNoise(casacore::Array< casacore::Float > &slice, casacore::Normal &noiseGen)
Add noise to Array.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
casacore::Stokes::StokesTypes stokesType(const casacore::CoordinateSystem &cSys)
What casacore::Stokes type? Exception if more than one.
casacore::Bool complexlinpol(const casacore::String &outfile)
casacore::Complex linear polarization image is stored in outfile
void summary() const
Summary.
void copyMiscellaneous(casacore::ImageInterface< casacore::Complex > &out, const casacore::ImageInterface< casacore::Float > &in)
Copy miscellaneous (MiscInfo, casacore::ImageInfo, history, units)
StokesTypes
The Stokes types are defined by this enum.
Definition: Stokes.h:66
casacore::Float sigma(casacore::Float clip=10.0) const
sigma
casacore::Bool open(casacore::ImageInterface< casacore::Float > &im)
void complexLinearPolarization(const casacore::String &outfile)
casacore::Complex linear polarization
casacore::Bool sigmaDepolarizationRatio(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &infile, casacore::Bool debias=false, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
casacore::Bool fracTotPol(casacore::ImageInterface< casacore::Float > *&rtnim, casacore::Bool debias=false, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
Fractional total polarized intensity.
casacore::Bool imagepoltestimage(const casacore::String &outFile="imagepol.iquv", const casacore::Vector< casacore::Double > &rm=casacore::Vector< casacore::Double >(1, 0.0), casacore::Bool rmDefault=true, casacore::Double pa0=0.0, casacore::Double sigma=0.01, casacore::Int nx=32, casacore::Int ny=32, casacore::Int nf=32, casacore::Double f0=1.4e9, casacore::Double df=128.0e6)
Make test image.
casacore::Bool sigmaLinPolPosAng(casacore::ImageInterface< casacore::Float > *&rtnim, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
Linearly polarized position angle.
casacore::Float sigmaStokesU(casacore::Float clip=10.0) const
casacore::Bool fillIQUV(casacore::ImageInterface< casacore::Float > &im, casacore::uInt stokesAxis, casacore::uInt spectralAxis, const casacore::Vector< casacore::Float > &rm, casacore::Float pa0)
Fill IQUV image with casacore::Stokes values from RM data.
Normal or Gaussian distribution.
Definition: Random.h:997
double Double
Definition: aipstype.h:55
LatticeExprNode amp(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds sqrt(left^2+right^2).
void rotationMeasure(const casacore::String &outRM="", const casacore::String &outRMErr="", const casacore::String &outPA0="", const casacore::String &outPA0Err="", const casacore::String &outNTurns="", const casacore::String &outChiSq="", casacore::Int axis=-1, casacore::Float varQU=-1, casacore::Float rmFg=0.0, casacore::Float rmMax=0.0, casacore::Float maxPaErr=1e30)
Find Rotation casacore::Measure from traditional method.
std::shared_ptr< const casacore::ImageInterface< casacore::Float > > SPCIIF
Definition: ImageTypedefs.h:50
casacore::Float sigmaLinPolInt(casacore::Float clip=10.0, casacore::Float sigma=-1) const
casacore::Bool stokesI(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &outfile="")
casacore::Stokes I
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
SPCIIF getImage() const
casacore::Float sigmaStokesV(casacore::Float clip=10.0) const
float Float
Definition: aipstype.h:54
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
ImagePol()
&quot;imagepol&quot; constructors
casacore::Bool fracLinPol(casacore::ImageInterface< casacore::Float > *&rtnim, casacore::Bool debias=false, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
Fractional linearly polarized intensity.
SPCIIF imageInterface() const
Get the casacore::ImageInterface pointer of the construction image Don&#39;t delete it ! ...
void complexFractionalLinearPolarization(const casacore::String &outfile)
casacore::Complex linear polarization
Implementation of the image polarimetry functionality available from casapy.
Definition: ImagePolProxy.h:49
casacore::Bool sigmaFracTotPol(casacore::ImageInterface< casacore::Float > *&rtnim, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
casacore::Bool makeIQUVImage(casacore::ImageInterface< casacore::Float > *&pImOut, const casacore::String &outfile, casacore::Double sigma, casacore::Double pa0, const casacore::Vector< casacore::Float > &rm, const casacore::IPosition &shape, casacore::Double f0, casacore::Double dF)
Make an IQUV image with some dummy RM data.
virtual ~ImagePol()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool copyImage(casacore::ImageInterface< casacore::Float > *&out, const casacore::ImageInterface< casacore::Float > &in, const casacore::String &outfile="", casacore::Bool overwrite=true)
casacore::Float sigmaStokesQ(casacore::Float clip=10.0) const
casacore::Float sigmaTotPolInt(casacore::Float clip=10.0, casacore::Float sigma=-1) const
Total polarized intensity.
void makeComplex(const casacore::String &complex, const casacore::String &real="", const casacore::String &imag="", const casacore::String &amp="", const casacore::String &phase="")
Make a complex image.
void fiddleStokesCoordinate(casacore::ImageInterface< casacore::Float > &ie, casacore::Stokes::StokesTypes type)
casacore::Bool depolarizationRatio(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &infile, casacore::Bool debias=false, casacore::Float clip=10.0, casacore::Float sigma=-1, const casacore::String &outfile="")
Depolarization ratio.
casacore::LogIO * itsLog
LatticeExprNode real(const LatticeExprNode &expr)
Interconvert pixel and world coordinates.
ImagePolarimetry * itsImPol
unsigned int uInt
Definition: aipstype.h:51
casacore::Bool stokesV(casacore::ImageInterface< casacore::Float > *&rtnim, const casacore::String &outfile="")
casacore::Stokes V
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
casacore::Bool makeImage(casacore::ImageInterface< casacore::Complex > *&out, const casacore::String &outfile, const casacore::CoordinateSystem &cSys, const casacore::IPosition &shape, casacore::Bool isMasked=false, casacore::Bool tempAllowed=true)
Make a casacore::PagedImage or casacore::TempImage output.