casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImagePolarimetry.h
Go to the documentation of this file.
1 //# ImagePolarimetry.h: Polarimetric analysis of images
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002
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: ImagePolarimetry.h 19817 2006-12-22 05:24:00Z gvandiep $
27 
28 #ifndef IMAGES_IMAGEPOLARIMETRY_H
29 #define IMAGES_IMAGEPOLARIMETRY_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
33 #include <casa/Containers/Block.h>
35 #include <casa/BasicSL/Complex.h>
38 
40 
41 namespace casacore{
42 
43 template <class T> class SubImage;
44 template <class T> class ImageExpr;
45 template <class T> class Quantum;
46 template <class T> class LatticeStatistics;
47 class CoordinateSystem;
48 class IPosition;
49 class LatticeExprNode;
50 class LCBox;
51 class LogIO;
52 }
53 
54 namespace casa {
55 
56 // <summary>
57 // Polarimetric analysis of images
58 // </summary>
59 
60 // <use visibility=export>
61 
62 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
63 // </reviewed>
64 
65 // <prerequisite>
66 // <li> <linkto class=casacore::ImageExpr>ImageExpr</linkto>
67 // <li> <linkto class=casacore::ImageInterface>ImageInterface</linkto>
68 // </prerequisite>
69 
70 // <etymology>
71 // Polarimetric analysis of Images
72 // </etymology>
73 
74 // <synopsis>
75 // This class provides polarimetric image analysis capability.
76 // It takes an image with a casacore::Stokes axis (some combination
77 // of IQUV is needed) as its input.
78 //
79 // Many functions return casacore::ImageExpr objects. These are
80 // read-only images.
81 //
82 // Sometimes the standard deviation of the noise is needed.
83 // This is for debiasing polarized intensity images or working out
84 // error images. By default it is worked out for you with a
85 // clipped mean algorithm. However, you can provide sigma if you
86 // know it accurately. It should be the standard deviation of the noise in
87 // the absence of signal. You won't measure that very well from
88 // casacore::Stokes I if it is dynamic range limited. Better to get it from
89 // V or Q or U. When this class needs the standard deviation of
90 // the noise, it will try and get it from V or Q and U and finally I.
91 //
92 // However, note that the functions sigmaStokes{I,Q,U,V} DO return the standard
93 // deviation of the noise for that specific casacore::Stokes type.
94 //
95 // The ImageExpr objects returned have the brightness units and ImageInfo
96 // set. The MiscInfo (a permanent record) and logSink are not set.
97 //
98 // </synopsis>
99 //
100 // <motivation>
101 // Basic image analysis capability
102 // </motivation>
103 
104 // <todo asof="1999/11/01">
105 // <li> plotting for function rotationMeasure
106 // <li> some assessment of the curvature of pa-l**2
107 // </todo>
108 
110 public:
111 
112  // casacore::Stokes types
113  enum StokesTypes {I, Q, U, V};
114 
115  // Constructor. The input image must have a Stokes
116  // axis with some subset of I,Q,U, and V
118 
119  // Copy constructor (reference semantics)
120  ImagePolarimetry(const ImagePolarimetry& other);
121 
122  // Destructor
124 
125  // Assignment operator (reference semantics)
127 
128  // Summary. Just invokes the casacore::ImageSummary list function
129  // to summarize the header of the construction image
130  void summary(casacore::LogIO& os) const;
131 
132  // Get the casacore::ImageInterface pointer of the construction image
133  // Don't delete it !
135  return _image;
136  }
137 
138  // Get the casacore::CoordinateSystem of the construction image
140  return _image->coordinates();
141  }
142 
143  // Get the shape of the construction image
145  return _image->shape();
146  }
147 
148  // Is the construction image masked ?
150  return _image->isMasked();
151  }
152 
153  // Get the shape and casacore::CoordinateSystem of an image for a single
154  // Stokes pixel. Thus, if the construction image shape was [10,10,4,20]
155  // where axis 2 (shape 4) is the casacore::Stokes axis, this function
156  // would return [10,10,1,20] Specify the type of casacore::Stokes pixel
157  // you want.
160  ) const;
161 
162  // Complex linear polarization
164 
165  // casacore::Complex fractional linear polarization
168 
169  // Get the Stokes I image and the standard deviation of the
170  // I image. This is worked out by first clipping
171  // outliers from the mean at the specified level.
172  // <group>
175  // </group>
176 
177  // Get the casacore::Stokes Q image and the standard deviation
178  // of the Q image. This is worked out by first clipping
179  // outliers from the mean at the specified level.
180  // <group>
183  // </group>
184 
185  // Get the casacore::Stokes U image and the standard deviation
186  // of the U image. This is worked out by first clipping
187  // outliers from the mean at the specified level.
188  // <group>
191  // </group>
192 
193  // Get the casacore::Stokes V image and the standard deviation
194  // of the V image. This is worked out by first clipping
195  // outliers from the mean at the specified level.
196  // <group>
199  // </group>
200 
201  // Get the specified casacore::Stokes image and the standard deviation
202  // of the image. This is worked out by first clipping
203  // outliers from the mean at the specified level.
204  // <group>
207  ) const;
210  );
211  // </group>
212 
213  // Get the best estimate of the statistical noise. This gives you the
214  // standard deviation with outliers from the mean clipped first. The idea is
215  // to not be confused by source or dynamic range issues. Generally Stokes V
216  // is empty of sources (not always), then Q and U are generally less bright
217  // than I. So this function first tries V, then Q and U and lastly I to
218  // give you its noise estimate
220 
221  // Get the linearly polarized intensity image and its
222  // standard deviation. If wish to debias the image, you
223  // can either provide <src>sigma</src> (the standard
224  // deviation of the termal noise ) or if <src>sigma</src> is non-positive,
225  // it will be worked out for you with a clipped mean algorithm.
226  // <group>
228  casacore::Float clip=10.0, casacore::Float sigma=-1.0
229  );
230  // </group>
231 
232  // Get the total polarized intensity (from whatever combination
233  // of Q, U, and V the construction image has) image and its error
234  // (standard deviation). If wish to debias the image, you
235  // can either provide <src>sigma</src> (the standard deviation
236  // of the thermal noise) or if <src>sigma</src> is
237  // non-positive, it will be worked out for you with a
238  // clipped mean algorithm.
239  // <group>
241  casacore::Bool debias, casacore::Float clip=10.0,
243  );
244 
246  casacore::Float clip=10.0, casacore::Float sigma=-1.0
247  );
248  // </group>
249 
250  // Get linearly polarized position angle (degrees or radians) image
251  // and error (standard deviation). If you provide
252  // <src>sigma</src> it is the standard deviation of
253  // the termal noise. If <src>sigma</src> is non-positive, it will be
254  // worked out for you with a clipped mean algorithm.
255  // <group>
257  casacore::Bool radians
258  ) const;
259 
261  casacore::Bool radians, casacore::Float clip=10.0,
263  );
264  // </group>
265 
266  // Get fractional linear polarization image
267  // and error (standard deviation). If wish to debias the image, you
268  // can either provide <src>sigma</src> (the standard
269  // deviation of the termal noise) or if <src>sigma</src> is non-positive,
270  // it will be worked out for you with a clipped mean algorithm.
271  // <group>
273  casacore::Bool debias, casacore::Float clip=10.0,
275  );
276 
278  casacore::Float clip=10.0, casacore::Float sigma=-1.0
279  );
280  // </group>
281 
282  // Get Fractional total polarization and error (standard deviation)
283  // <src>var</src> is the standard deviation of the thermal noise.
284  // If <src>sigma</src> is non-positive,
285  // it will be worked out for you with a clipped mean algorithm.
286  // <group>
288  casacore::Bool debias, casacore::Float clip=10.0,
290  );
292  casacore::Float clip=10.0, casacore::Float sigma=-1.0
293  );
294  // </group>
295 
296  // Fourier Rotation Measure. The output image is the complex polarization
297  // (Q + iU) with the spectral axis replaced by a RotationMeasure axis. The
298  // appropriate shape and casacore::CoordinateSystem must be obtained with
299  // function singleStokesShape (ask for type STokes::Plinear).
300  // Howeverm this function will replace the casacore::SpectralCoordinate
301  // by a LinearCoordinate describing the Rotation Measure.
302  // casacore::ImageInfo, and Units are copied to the output. MiscInfo and
303  // history are not. If the output has a mask,
304  // and the input is masked, the mask is copied. If the output
305  // has a mask, it should already have been initialized to true
308  casacore::Bool zeroZeroLag
309  );
310 
311  // This function is used in concert with the rotationMeasure function.
312  // It tells you what the shape of the output RM image should be, and
313  // gives you its CoordinateSystem. Because the ImagePolarimetry
314  // construction image may house the frequencies coordinate description
315  // in a Spectral, Tabular or Linear coordinate, you may explicitly
316  // specify which axis is the Spectral axis (spectralAxis). By default,
317  // it tries to find the SpectralCoordinate. If there is none, it will
318  // look for Tabular or Linear coordinates with a "FREQ" label.
319  // It returns to you the frequencyAxis (i.e. the one it is concluded
320  // houses the frequency spectrum) and the stokesAxis that it
321  // finds.
323  casacore::CoordinateSystem& cSys, casacore::Int& frequencyAxis,
324  casacore::Int& stokesAxis, casacore::LogIO& os,
325  casacore::Int spectralAxis=-1
326  ) const;
327 
328  // This function is used in concert with the rotationMeasure function.
329  // It tells you what the shape of the output Position Angle image should be,
330  // and gives you its CoordinateSystem. Because the ImagePolarimetry
331  // construction image may house the frequencies coordinate description
332  // in a Spectral, Tabular or Linear coordinate, you may explicitly
333  // specify which axis is the Spectral axis (spectralAxis). By default,
334  // it tries to find the SpectralCoordinate. If there is none, it will
335  // look for Tabular or Linear coordinates with a "FREQ" label.
337  casacore::CoordinateSystem& cSys, casacore::Int& frequencyAxis,
338  casacore::Int& stokesAxis, casacore::LogIO& os,
339  casacore::Int spectralAxis=-1
340  ) const;
341 
342  // This function applies a traditional (i.e. non-Fourier) Rotation Measure
343  // algorithm (Leahy et al, A&A, 156, 234) approach. For the RM images
344  // you must get the shape and CoordinateSYstem from function
345  // rotationMeasureShape. For the position angle images, use function
346  // singleStokesShape. Null pointer ImageInterface objects are
347  // not accessed so you can select which output images you want.
348  // Any output images not masked will be given a mask.
349  // The position angles are all in degrees. The RM images in rad/m/m.
350  // ImageInfo and Units, are copied to the output. MiscInfo and history are
351  // not. You specify which axis houses the frequencies, the noise level of
352  // Q and U if you know it (by default it is worked out for you)
353  // for error images, the value of the foreground RM if you know it
354  // (helps for unwinding ambiguity), the absolute maximum RM it should
355  // solve for, and the maximum error in the position angle that should
356  // be allowed. The state of the plotter should be set by the caller
357  // (e.g. character size, number of plots in x and y etc).
358  void rotationMeasure(
365  casacore::Int spectralAxis, casacore::Float rmMax,
366  casacore::Float maxPaErr=1.0e30, casacore::Float sigma=-1.0,
367  casacore::Float rmFg=0.0, casacore::Bool showProgress=false
368  );
369 
370  // Depolarization ratio image and error. Requires two images hence static
371  // functions.
372  // <group>
376  casacore::Bool debias, casacore::Float clip=10.0,
378  );
379 
383  casacore::Bool debias, casacore::Float clip=10.0,
385  );
386  // </group>
387 
388 private:
389  static const map<StokesTypes, casacore::String> polMap;
390 
391  SPCIIF _image = nullptr;
392  // const casacore::ImageInterface<casacore::Float>* _image;
395 
396 // These blocks are always size 4, with IQUV in slots 0,1,2,3
397 // If your image is IV only, they still use slots 0 and 3
398 
402 
404 
405 
406  // Delete all private pointers
407  void _cleanup();
408 
409  // For traiditional RM approach, give output a mask if possible
413  const casacore::String& type
414  ) const;
415 
416  // Change the Stokes Coordinate for the given float image to be of the
417  // specified Stokes type
421  ) const;
422 
425  ) const;
426 
427  // Change the casacore::Stokes casacore::Coordinate for the given complex
428  // image to be of the specified casacore::Stokes type
432  ) const;
433 
434  // Change the time coordinate to be rotation measure
438  ) const;
439 
440  // Find the central frequency from the given spectral coordinate
443  ) const;
444 
445  // Fit the spectrum of position angles to find the
446  // rotation measure via Leahy algorithm
448  casacore::Float& rmFitted, casacore::Float& rmErrFitted,
449  casacore::Float& pa0Fitted, casacore::Float& pa0ErrFitted,
450  casacore::Float& rChiSqFitted, casacore::Float& nTurns,
451  const casacore::Vector<casacore::uInt>& sortidx,
454  const casacore::Array<casacore::Bool>& paMask,
456  casacore::Float rmfg, casacore::Float rmmax, casacore::Float paErrMax,
457  const casacore::String& posString
458  );
459 
460  // Find the casacore::Stokes in the construction image and assign pointers
461  void _findStokes();
462 
463  // Find the spectral coordinate.
466  casacore::Bool fail
467  ) const;
468 
469  // FInd frequency axis
470  void _findFrequencyAxis(
471  casacore::Int& spectralCoord, casacore::Int& fAxis,
472  const casacore::CoordinateSystem& cSys, casacore::Int spectralAxis
473  ) const;
474 
475  // So we have Q and U ? Excpetion if not
476  void _hasQU () const;
477 
478  // Make a LEN for the give types of polarized intensity
482  );
483 
484  // Make an IE for the specified Stokes
488  ) const;
489 
490  // Make a casacore::SubImage from the construction image for the specified
491  // pixel along the specified pixel axis
494  casacore::Int axis, casacore::Int pix
495  ) const;
496 
497  // Least squares fit to find RM from position angles
503  ) const;
504 
505  // Fit the spectrum of position angles to find the rotation measure
506  // via Leahy algorithm for primary (n>2) points
508  casacore::Float& nTurns, casacore::Float& rmFitted,
509  casacore::Float& rmErrFitted, casacore::Float& pa0Fitted,
510  casacore::Float& pa0ErrFitted, casacore::Float& rChiSqFitted,
514  casacore::Float rmmax, const casacore::String& posString
515  );
516 
517  // Fit the spectrum of position angles to find the rotation measure
518  // via Leahy algorithm for supplementary (n==2) points
520  casacore::Float& nTurns, casacore::Float& rmFitted,
521  casacore::Float& rmErrFitted, casacore::Float& pa0Fitted,
522  casacore::Float& pa0ErrFitted, casacore::Float& rChiSqFitted,
526  );
527 
528  // Return I, Q, U or V for specified integer index (0-3)
531  ) const;
532 
533  // Return I, Q, U or V for specified integer index (0-3)
536  ) const;
537 
538  // Find the standard deviation for the Stokes image
539  // specified by the integer index
542  );
543 
544  // Subtract profile mean from image
547  ) const;
548 
549  void _createBeamsEqMat();
550 
552  const std::vector<StokesTypes>& stokes,
553  casacore::Bool requireChannelEquality, casacore::Bool throws=true
554  ) const;
555 
557  casacore::Bool requireChannelEquality, casacore::Bool throws=true
558  ) const ;
559 
561  casacore::Bool requireChannelEquality, casacore::Bool throws=true
562  ) const;
563 
565  casacore::Bool requireChannelEquality, casacore::Bool throws=true
566  ) const;
567 
568  static void _checkBeams(
569  const ImagePolarimetry& im1, const ImagePolarimetry& im2,
571  );
572 
573  void _setInfo(
575  ) const;
576 
577  void _setInfo(
579  ) const;
580 
581  void _setDoLinDoCirc(casacore::Bool& doLin, casacore::Bool& doCirc) const;
582 
583 };
584 
585 }
586 
587 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::Bool _checkQUBeams(casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
casacore::Float _oldClip
int Int
Definition: aipstype.h:50
void _fiddleTimeCoordinate(casacore::ImageInterface< casacore::Complex > &ie, const casacore::Quantum< casacore::Double > &f, casacore::Int coord) const
Change the time coordinate to be rotation measure.
void _setInfo(casacore::ImageInterface< casacore::Complex > &im, StokesTypes stokes) const
casacore::Float sigmaStokesI(casacore::Float clip=10.0)
static casacore::ImageExpr< casacore::Float > sigmaDepolarizationRatio(const casacore::ImageInterface< casacore::Float > &im1, const casacore::ImageInterface< casacore::Float > &im2, casacore::Bool debias, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
casacore::Bool _rmPrimaryFit(casacore::Float &nTurns, casacore::Float &rmFitted, casacore::Float &rmErrFitted, casacore::Float &pa0Fitted, casacore::Float &pa0ErrFitted, casacore::Float &rChiSqFitted, const casacore::Vector< casacore::Float > &wsq, const casacore::Vector< casacore::Float > &pa, const casacore::Vector< casacore::Float > &paerr, casacore::Float rmmax, const casacore::String &posString)
Fit the spectrum of position angles to find the rotation measure via Leahy algorithm for primary (n&gt;2...
static casacore::ImageExpr< casacore::Float > depolarizationRatio(const casacore::ImageInterface< casacore::Float > &im1, const casacore::ImageInterface< casacore::Float > &im2, casacore::Bool debias, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
Depolarization ratio image and error.
casacore::Float sigmaTotPolInt(casacore::Float clip=10.0, casacore::Float sigma=-1.0)
casacore::CoordinateSystem coordinates() const
Get the casacore::CoordinateSystem of the construction image.
Polarimetric analysis of images.
casacore::ImageExpr< casacore::Float > fracLinPol(casacore::Bool debias, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
Get fractional linear polarization image and error (standard deviation).
casacore::Float sigmaStokesV(casacore::Float clip=10.0)
casacore::Float sigmaLinPolInt(casacore::Float clip=10.0, casacore::Float sigma=-1.0)
Get the linearly polarized intensity image and its standard deviation.
virtual Type type()
Return the type enum.
casacore::ImageExpr< casacore::Float > sigmaFracTotPol(casacore::Float clip=10.0, casacore::Float sigma=-1.0)
casacore::PtrBlock< casacore::ImageInterface< casacore::Float > * > _stokes
These blocks are always size 4, with IQUV in slots 0,1,2,3 If your image is IV only, they still use slots 0 and 3.
void _hasQU() const
So we have Q and U ? Excpetion if not.
casacore::Bool _rmSupplementaryFit(casacore::Float &nTurns, casacore::Float &rmFitted, casacore::Float &rmErrFitted, casacore::Float &pa0Fitted, casacore::Float &pa0ErrFitted, casacore::Float &rChiSqFitted, const casacore::Vector< casacore::Float > &wsq, const casacore::Vector< casacore::Float > &pa, const casacore::Vector< casacore::Float > &paerr)
Fit the spectrum of position angles to find the rotation measure via Leahy algorithm for supplementar...
casacore::Bool _dealWithMask(casacore::Lattice< casacore::Bool > *&pMask, casacore::ImageInterface< casacore::Float > *&pIm, casacore::LogIO &os, const casacore::String &type) const
For traiditional RM approach, give output a mask if possible.
void _cleanup()
Delete all private pointers.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void fourierRotationMeasure(casacore::ImageInterface< casacore::Complex > &pol, casacore::Bool zeroZeroLag)
Fourier Rotation Measure.
void summary(casacore::LogIO &os) const
Summary.
casacore::LatticeExprNode _makePolIntNode(casacore::LogIO &os, casacore::Bool debias, casacore::Float clip, casacore::Float sigma, casacore::Bool doLin, casacore::Bool doCirc)
Make a LEN for the give types of polarized intensity.
casacore::ImageExpr< casacore::Float > _makeStokesExpr(casacore::ImageInterface< casacore::Float > *imPtr, casacore::Stokes::StokesTypes type, const casacore::String &name) const
Make an IE for the specified Stokes.
void _subtractProfileMean(casacore::ImageInterface< casacore::Float > &im, casacore::uInt axis) const
Subtract profile mean from image.
StokesTypes
The Stokes types are defined by this enum.
Definition: Stokes.h:66
casacore::ImageExpr< casacore::Complex > complexFractionalLinearPolarization()
casacore::Complex fractional linear polarization
casacore::Quantum< casacore::Double > _findCentralFrequency(const casacore::Coordinate &coord, casacore::Int shape) const
Find the central frequency from the given spectral coordinate.
ImagePolarimetry & operator=(const ImagePolarimetry &other)
Assignment operator (reference semantics)
casacore::IPosition rotationMeasureShape(casacore::CoordinateSystem &cSys, casacore::Int &frequencyAxis, casacore::Int &stokesAxis, casacore::LogIO &os, casacore::Int spectralAxis=-1) const
This function is used in concert with the rotationMeasure function.
Hold mathematical expressions involving ImageInterface objects.
Definition: WCLELMask.h:46
void _setDoLinDoCirc(casacore::Bool &doLin, casacore::Bool &doCirc) const
A templated, abstract base class for array-like objects.
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
casacore::ImageExpr< casacore::Float > sigmaFracLinPol(casacore::Float clip=10.0, casacore::Float sigma=-1.0)
ImagePolarimetry(const casacore::ImageInterface< casacore::Float > &image)
Constructor.
Interface for converting between world and pixel coordinates.
Definition: Coordinate.h:139
casacore::Float sigmaStokes(ImagePolarimetry::StokesTypes index, casacore::Float clip=10.0)
void rotationMeasure(casacore::ImageInterface< casacore::Float > *&rmPtr, casacore::ImageInterface< casacore::Float > *&rmErrPtr, casacore::ImageInterface< casacore::Float > *&pa0Ptr, casacore::ImageInterface< casacore::Float > *&pa0ErrPtr, casacore::ImageInterface< casacore::Float > *&nTurns, casacore::ImageInterface< casacore::Float > *&rChiSqPtr, casacore::Int spectralAxis, casacore::Float rmMax, casacore::Float maxPaErr=1.0e30, casacore::Float sigma=-1.0, casacore::Float rmFg=0.0, casacore::Bool showProgress=false)
This function applies a traditional (i.e.
casacore::Bool _rmLsqFit(casacore::Vector< casacore::Float > &pars, const casacore::Vector< casacore::Float > &wsq, const casacore::Vector< casacore::Float > pa, const casacore::Vector< casacore::Float > &paerr) const
Least squares fit to find RM from position angles.
casacore::String _stokesName(ImagePolarimetry::StokesTypes index) const
Return I, Q, U or V for specified integer index (0-3)
casacore::ImageExpr< casacore::Float > linPolPosAng(casacore::Bool radians) const
Get linearly polarized position angle (degrees or radians) image and error (standard deviation)...
~ImagePolarimetry()
Destructor.
std::shared_ptr< const casacore::ImageInterface< casacore::Float > > SPCIIF
Definition: ImageTypedefs.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
casacore::IPosition shape() const
Get the shape of the construction image.
void _findStokes()
Find the casacore::Stokes in the construction image and assign pointers.
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
casacore::Bool isMasked() const
Is the construction image masked ?
static const map< StokesTypes, casacore::String > polMap
casacore::Bool _checkBeams(const std::vector< StokesTypes > &stokes, casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
casacore::IPosition positionAngleShape(casacore::CoordinateSystem &cSys, casacore::Int &frequencyAxis, casacore::Int &stokesAxis, casacore::LogIO &os, casacore::Int spectralAxis=-1) const
This function is used in concert with the rotationMeasure function.
SPCIIF imageInterface() const
Get the casacore::ImageInterface pointer of the construction image Don&#39;t delete it ! ...
StokesTypes
casacore::Stokes types
casacore::ImageInterface< casacore::Float > * _makeSubImage(casacore::IPosition &blc, casacore::IPosition &trc, casacore::Int axis, casacore::Int pix) const
Make a casacore::SubImage from the construction image for the specified pixel along the specified pix...
void _fiddleStokesCoordinate(casacore::ImageInterface< casacore::Float > &ie, casacore::Stokes::StokesTypes type) const
Change the Stokes Coordinate for the given float image to be of the specified Stokes type...
Bridging class to allow C++ expressions involving lattices.
void _findFrequencyAxis(casacore::Int &spectralCoord, casacore::Int &fAxis, const casacore::CoordinateSystem &cSys, casacore::Int spectralAxis) const
FInd frequency axis.
casacore::ImageExpr< casacore::Float > sigmaLinPolPosAng(casacore::Bool radians, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
casacore::Bool _checkIQUBeams(casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
casacore::Float sigma(casacore::Float clip=10.0)
Get the best estimate of the statistical noise.
casacore::IPosition singleStokesShape(casacore::CoordinateSystem &cSys, casacore::Stokes::StokesTypes type) const
Get the shape and casacore::CoordinateSystem of an image for a single Stokes pixel.
casacore::ImageExpr< casacore::Float > stokes(ImagePolarimetry::StokesTypes index) const
Get the specified casacore::Stokes image and the standard deviation of the image. ...
casacore::PtrBlock< casacore::LatticeStatistics< casacore::Float > * > _stokesStats
casacore::ImageExpr< casacore::Float > stokesQ() const
Get the casacore::Stokes Q image and the standard deviation of the Q image.
casacore::Bool _checkIVBeams(casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Float sigmaStokesQ(casacore::Float clip=10.0)
casacore::Float sigmaStokesU(casacore::Float clip=10.0)
casacore::ImageExpr< casacore::Complex > complexLinearPolarization()
Complex linear polarization.
casacore::ImageExpr< casacore::Float > stokesV() const
Get the casacore::Stokes V image and the standard deviation of the V image.
casacore::ImageExpr< casacore::Float > stokesI() const
Get the Stokes I image and the standard deviation of the I image.
casacore::ImageExpr< casacore::Float > stokesU() const
Get the casacore::Stokes U image and the standard deviation of the U image.
casacore::ImageExpr< casacore::Float > fracTotPol(casacore::Bool debias, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
Get Fractional total polarization and error (standard deviation) var is the standard deviation of the...
Interconvert pixel and world coordinates.
casacore::LinearFitSVD< casacore::Float > * _fitter
const casacore::ImageInterface&lt;casacore::Float&gt;* _image;
casacore::Matrix< casacore::Bool > _beamsEqMat
casacore::ImageExpr< casacore::Float > totPolInt(casacore::Bool debias, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
Get the total polarized intensity (from whatever combination of Q, U, and V the construction image ha...
unsigned int uInt
Definition: aipstype.h:51
casacore::Int _findSpectralCoordinate(const casacore::CoordinateSystem &cSys, casacore::LogIO &os, casacore::Bool fail) const
Find the spectral coordinate.
casacore::Bool _findRotationMeasure(casacore::Float &rmFitted, casacore::Float &rmErrFitted, casacore::Float &pa0Fitted, casacore::Float &pa0ErrFitted, casacore::Float &rChiSqFitted, casacore::Float &nTurns, const casacore::Vector< casacore::uInt > &sortidx, const casacore::Vector< casacore::Float > &wsq, const casacore::Vector< casacore::Float > &pa, const casacore::Array< casacore::Bool > &paMask, const casacore::Array< casacore::Float > &paerr, casacore::Float rmfg, casacore::Float rmmax, casacore::Float paErrMax, const casacore::String &posString)
Fit the spectrum of position angles to find the rotation measure via Leahy algorithm.
casacore::Stokes::StokesTypes _stokesType(ImagePolarimetry::StokesTypes index) const
Return I, Q, U or V for specified integer index (0-3)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
casacore::Float _sigma(ImagePolarimetry::StokesTypes index, casacore::Float clip)
Find the standard deviation for the Stokes image specified by the integer index.