casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::ImagePolarimetry Class Reference

Polarimetric analysis of images. More...

#include <ImagePolarimetry.h>

Public Types

enum  StokesTypes {
  I,
  Q,
  U,
  V
}
 casacore::Stokes types More...
 

Public Member Functions

 ImagePolarimetry (const casacore::ImageInterface< casacore::Float > &image)
 Constructor. More...
 
 ImagePolarimetry (const ImagePolarimetry &other)
 Copy constructor (reference semantics) More...
 
 ~ImagePolarimetry ()
 Destructor. More...
 
ImagePolarimetryoperator= (const ImagePolarimetry &other)
 Assignment operator (reference semantics) More...
 
void summary (casacore::LogIO &os) const
 Summary. More...
 
SPCIIF imageInterface () const
 Get the casacore::ImageInterface pointer of the construction image Don't delete it ! More...
 
casacore::CoordinateSystem coordinates () const
 Get the casacore::CoordinateSystem of the construction image. More...
 
casacore::IPosition shape () const
 Get the shape of the construction image. More...
 
casacore::Bool isMasked () const
 Is the construction image masked ? More...
 
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. More...
 
casacore::ImageExpr
< casacore::Complex > 
complexLinearPolarization ()
 Complex linear polarization. More...
 
casacore::ImageExpr
< casacore::Complex > 
complexFractionalLinearPolarization ()
 casacore::Complex fractional linear polarization More...
 
casacore::ImageExpr
< casacore::Float
stokesI () const
 Get the Stokes I image and the standard deviation of the I image. More...
 
casacore::Float sigmaStokesI (casacore::Float clip=10.0)
 
casacore::ImageExpr
< casacore::Float
stokesQ () const
 Get the casacore::Stokes Q image and the standard deviation of the Q image. More...
 
casacore::Float sigmaStokesQ (casacore::Float clip=10.0)
 
casacore::ImageExpr
< casacore::Float
stokesU () const
 Get the casacore::Stokes U image and the standard deviation of the U image. More...
 
casacore::Float sigmaStokesU (casacore::Float clip=10.0)
 
casacore::ImageExpr
< casacore::Float
stokesV () const
 Get the casacore::Stokes V image and the standard deviation of the V image. More...
 
casacore::Float sigmaStokesV (casacore::Float clip=10.0)
 
casacore::ImageExpr
< casacore::Float
stokes (ImagePolarimetry::StokesTypes index) const
 Get the specified casacore::Stokes image and the standard deviation of the image. More...
 
casacore::Float sigmaStokes (ImagePolarimetry::StokesTypes index, casacore::Float clip=10.0)
 
casacore::Float sigma (casacore::Float clip=10.0)
 Get the best estimate of the statistical noise. More...
 
casacore::Float sigmaLinPolInt (casacore::Float clip=10.0, casacore::Float sigma=-1.0)
 Get the linearly polarized intensity image and its standard deviation. More...
 
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 has) image and its error (standard deviation). More...
 
casacore::Float sigmaTotPolInt (casacore::Float clip=10.0, casacore::Float sigma=-1.0)
 
casacore::ImageExpr
< casacore::Float
linPolPosAng (casacore::Bool radians) const
 Get linearly polarized position angle (degrees or radians) image and error (standard deviation). More...
 
casacore::ImageExpr
< casacore::Float
sigmaLinPolPosAng (casacore::Bool radians, casacore::Float clip=10.0, casacore::Float sigma=-1.0)
 
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). More...
 
casacore::ImageExpr
< casacore::Float
sigmaFracLinPol (casacore::Float clip=10.0, casacore::Float sigma=-1.0)
 
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 thermal noise. More...
 
casacore::ImageExpr
< casacore::Float
sigmaFracTotPol (casacore::Float clip=10.0, casacore::Float sigma=-1.0)
 
void fourierRotationMeasure (casacore::ImageInterface< casacore::Complex > &pol, casacore::Bool zeroZeroLag)
 Fourier Rotation Measure. More...
 
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. More...
 
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. More...
 
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. More...
 

Static Public Member Functions

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. More...
 
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)
 

Private Member Functions

void _cleanup ()
 Delete all private pointers. More...
 
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. More...
 
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. More...
 
void _fiddleStokesCoordinate (casacore::CoordinateSystem &cSys, casacore::Stokes::StokesTypes type) const
 
void _fiddleStokesCoordinate (casacore::ImageInterface< casacore::Complex > &ie, casacore::Stokes::StokesTypes type) const
 Change the casacore::Stokes casacore::Coordinate for the given complex image to be of the specified casacore::Stokes type. More...
 
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. More...
 
casacore::Quantum
< casacore::Double
_findCentralFrequency (const casacore::Coordinate &coord, casacore::Int shape) const
 Find the central frequency from the given spectral coordinate. More...
 
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. More...
 
void _findStokes ()
 Find the casacore::Stokes in the construction image and assign pointers. More...
 
casacore::Int _findSpectralCoordinate (const casacore::CoordinateSystem &cSys, casacore::LogIO &os, casacore::Bool fail) const
 Find the spectral coordinate. More...
 
void _findFrequencyAxis (casacore::Int &spectralCoord, casacore::Int &fAxis, const casacore::CoordinateSystem &cSys, casacore::Int spectralAxis) const
 FInd frequency axis. More...
 
void _hasQU () const
 So we have Q and U ? Excpetion if not. More...
 
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. More...
 
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. More...
 
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 pixel axis. More...
 
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. More...
 
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>2) points. More...
 
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 supplementary (n==2) points. More...
 
casacore::String _stokesName (ImagePolarimetry::StokesTypes index) const
 Return I, Q, U or V for specified integer index (0-3) More...
 
casacore::Stokes::StokesTypes _stokesType (ImagePolarimetry::StokesTypes index) const
 Return I, Q, U or V for specified integer index (0-3) More...
 
casacore::Float _sigma (ImagePolarimetry::StokesTypes index, casacore::Float clip)
 Find the standard deviation for the Stokes image specified by the integer index. More...
 
void _subtractProfileMean (casacore::ImageInterface< casacore::Float > &im, casacore::uInt axis) const
 Subtract profile mean from image. More...
 
void _createBeamsEqMat ()
 
casacore::Bool _checkBeams (const std::vector< StokesTypes > &stokes, casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
 
casacore::Bool _checkIQUBeams (casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
 
casacore::Bool _checkIVBeams (casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
 
casacore::Bool _checkQUBeams (casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
 
void _setInfo (casacore::ImageInterface< casacore::Complex > &im, StokesTypes stokes) const
 
void _setInfo (casacore::ImageInterface< casacore::Float > &im, StokesTypes stokes) const
 
void _setDoLinDoCirc (casacore::Bool &doLin, casacore::Bool &doCirc) const
 

Static Private Member Functions

static void _checkBeams (const ImagePolarimetry &im1, const ImagePolarimetry &im2, const casacore::Vector< StokesTypes > &stokes)
 

Private Attributes

SPCIIF _image
 
casacore::LinearFitSVD
< casacore::Float > * 
_fitter
 const casacore::ImageInterface<casacore::Float>* _image; More...
 
casacore::Float _oldClip
 
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. More...
 
casacore::PtrBlock
< casacore::LatticeStatistics
< casacore::Float > * > 
_stokesStats
 
casacore::Matrix< casacore::Bool_beamsEqMat
 

Static Private Attributes

static const map< StokesTypes,
casacore::String
polMap
 

Detailed Description

Polarimetric analysis of images.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Polarimetric analysis of Images

Synopsis

This class provides polarimetric image analysis capability. It takes an image with a casacore::Stokes axis (some combination of IQUV is needed) as its input.

Many functions return casacore::ImageExpr objects. These are read-only images.

Sometimes the standard deviation of the noise is needed. This is for debiasing polarized intensity images or working out error images. By default it is worked out for you with a clipped mean algorithm. However, you can provide sigma if you know it accurately. It should be the standard deviation of the noise in the absence of signal. You won't measure that very well from casacore::Stokes I if it is dynamic range limited. Better to get it from V or Q or U. When this class needs the standard deviation of the noise, it will try and get it from V or Q and U and finally I.

However, note that the functions sigmaStokes{I,Q,U,V} DO return the standard deviation of the noise for that specific casacore::Stokes type.

The ImageExpr objects returned have the brightness units and ImageInfo set. The MiscInfo (a permanent record) and logSink are not set.

Motivation

Basic image analysis capability

To Do

Definition at line 109 of file ImagePolarimetry.h.

Member Enumeration Documentation

casacore::Stokes types

Enumerator
I 
Q 
U 
V 

Definition at line 113 of file ImagePolarimetry.h.

Constructor & Destructor Documentation

casa::ImagePolarimetry::ImagePolarimetry ( const casacore::ImageInterface< casacore::Float > &  image)

Constructor.

The input image must have a Stokes axis with some subset of I,Q,U, and V

casa::ImagePolarimetry::ImagePolarimetry ( const ImagePolarimetry other)

Copy constructor (reference semantics)

casa::ImagePolarimetry::~ImagePolarimetry ( )

Destructor.

Member Function Documentation

casacore::Bool casa::ImagePolarimetry::_checkBeams ( const std::vector< StokesTypes > &  stokes,
casacore::Bool  requireChannelEquality,
casacore::Bool  throws = true 
) const
private
static void casa::ImagePolarimetry::_checkBeams ( const ImagePolarimetry im1,
const ImagePolarimetry im2,
const casacore::Vector< StokesTypes > &  stokes 
)
staticprivate
casacore::Bool casa::ImagePolarimetry::_checkIQUBeams ( casacore::Bool  requireChannelEquality,
casacore::Bool  throws = true 
) const
private
casacore::Bool casa::ImagePolarimetry::_checkIVBeams ( casacore::Bool  requireChannelEquality,
casacore::Bool  throws = true 
) const
private
casacore::Bool casa::ImagePolarimetry::_checkQUBeams ( casacore::Bool  requireChannelEquality,
casacore::Bool  throws = true 
) const
private
void casa::ImagePolarimetry::_cleanup ( )
private

Delete all private pointers.

void casa::ImagePolarimetry::_createBeamsEqMat ( )
private
casacore::Bool casa::ImagePolarimetry::_dealWithMask ( casacore::Lattice< casacore::Bool > *&  pMask,
casacore::ImageInterface< casacore::Float > *&  pIm,
casacore::LogIO os,
const casacore::String type 
) const
private

For traiditional RM approach, give output a mask if possible.

void casa::ImagePolarimetry::_fiddleStokesCoordinate ( casacore::ImageInterface< casacore::Float > &  ie,
casacore::Stokes::StokesTypes  type 
) const
private

Change the Stokes Coordinate for the given float image to be of the specified Stokes type.

void casa::ImagePolarimetry::_fiddleStokesCoordinate ( casacore::CoordinateSystem cSys,
casacore::Stokes::StokesTypes  type 
) const
private
void casa::ImagePolarimetry::_fiddleStokesCoordinate ( casacore::ImageInterface< casacore::Complex > &  ie,
casacore::Stokes::StokesTypes  type 
) const
private

Change the casacore::Stokes casacore::Coordinate for the given complex image to be of the specified casacore::Stokes type.

void casa::ImagePolarimetry::_fiddleTimeCoordinate ( casacore::ImageInterface< casacore::Complex > &  ie,
const casacore::Quantum< casacore::Double > &  f,
casacore::Int  coord 
) const
private

Change the time coordinate to be rotation measure.

casacore::Quantum<casacore::Double> casa::ImagePolarimetry::_findCentralFrequency ( const casacore::Coordinate coord,
casacore::Int  shape 
) const
private

Find the central frequency from the given spectral coordinate.

void casa::ImagePolarimetry::_findFrequencyAxis ( casacore::Int spectralCoord,
casacore::Int fAxis,
const casacore::CoordinateSystem cSys,
casacore::Int  spectralAxis 
) const
private

FInd frequency axis.

casacore::Bool casa::ImagePolarimetry::_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 
)
private

Fit the spectrum of position angles to find the rotation measure via Leahy algorithm.

casacore::Int casa::ImagePolarimetry::_findSpectralCoordinate ( const casacore::CoordinateSystem cSys,
casacore::LogIO os,
casacore::Bool  fail 
) const
private

Find the spectral coordinate.

void casa::ImagePolarimetry::_findStokes ( )
private

Find the casacore::Stokes in the construction image and assign pointers.

void casa::ImagePolarimetry::_hasQU ( ) const
private

So we have Q and U ? Excpetion if not.

casacore::LatticeExprNode casa::ImagePolarimetry::_makePolIntNode ( casacore::LogIO os,
casacore::Bool  debias,
casacore::Float  clip,
casacore::Float  sigma,
casacore::Bool  doLin,
casacore::Bool  doCirc 
)
private

Make a LEN for the give types of polarized intensity.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::_makeStokesExpr ( casacore::ImageInterface< casacore::Float > *  imPtr,
casacore::Stokes::StokesTypes  type,
const casacore::String name 
) const
private

Make an IE for the specified Stokes.

casacore::ImageInterface<casacore::Float>* casa::ImagePolarimetry::_makeSubImage ( casacore::IPosition blc,
casacore::IPosition trc,
casacore::Int  axis,
casacore::Int  pix 
) const
private

Make a casacore::SubImage from the construction image for the specified pixel along the specified pixel axis.

casacore::Bool casa::ImagePolarimetry::_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
private

Least squares fit to find RM from position angles.

casacore::Bool casa::ImagePolarimetry::_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 
)
private

Fit the spectrum of position angles to find the rotation measure via Leahy algorithm for primary (n>2) points.

casacore::Bool casa::ImagePolarimetry::_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 
)
private

Fit the spectrum of position angles to find the rotation measure via Leahy algorithm for supplementary (n==2) points.

void casa::ImagePolarimetry::_setDoLinDoCirc ( casacore::Bool doLin,
casacore::Bool doCirc 
) const
private
void casa::ImagePolarimetry::_setInfo ( casacore::ImageInterface< casacore::Complex > &  im,
StokesTypes  stokes 
) const
private
void casa::ImagePolarimetry::_setInfo ( casacore::ImageInterface< casacore::Float > &  im,
StokesTypes  stokes 
) const
private
casacore::Float casa::ImagePolarimetry::_sigma ( ImagePolarimetry::StokesTypes  index,
casacore::Float  clip 
)
private

Find the standard deviation for the Stokes image specified by the integer index.

casacore::String casa::ImagePolarimetry::_stokesName ( ImagePolarimetry::StokesTypes  index) const
private

Return I, Q, U or V for specified integer index (0-3)

casacore::Stokes::StokesTypes casa::ImagePolarimetry::_stokesType ( ImagePolarimetry::StokesTypes  index) const
private

Return I, Q, U or V for specified integer index (0-3)

void casa::ImagePolarimetry::_subtractProfileMean ( casacore::ImageInterface< casacore::Float > &  im,
casacore::uInt  axis 
) const
private

Subtract profile mean from image.

casacore::ImageExpr<casacore::Complex> casa::ImagePolarimetry::complexFractionalLinearPolarization ( )

casacore::Complex fractional linear polarization

casacore::ImageExpr<casacore::Complex> casa::ImagePolarimetry::complexLinearPolarization ( )

Complex linear polarization.

casacore::CoordinateSystem casa::ImagePolarimetry::coordinates ( ) const
inline

Get the casacore::CoordinateSystem of the construction image.

Definition at line 139 of file ImagePolarimetry.h.

References _image.

static casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::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 
)
static

Depolarization ratio image and error.

Requires two images hence static functions.

void casa::ImagePolarimetry::fourierRotationMeasure ( casacore::ImageInterface< casacore::Complex > &  pol,
casacore::Bool  zeroZeroLag 
)

Fourier Rotation Measure.

The output image is the complex polarization (Q + iU) with the spectral axis replaced by a RotationMeasure axis. The appropriate shape and casacore::CoordinateSystem must be obtained with function singleStokesShape (ask for type STokes::Plinear). Howeverm this function will replace the casacore::SpectralCoordinate by a LinearCoordinate describing the Rotation Measure. casacore::ImageInfo, and Units are copied to the output. MiscInfo and history are not. If the output has a mask, and the input is masked, the mask is copied. If the output has a mask, it should already have been initialized to true

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::fracLinPol ( casacore::Bool  debias,
casacore::Float  clip = 10.0,
casacore::Float  sigma = -1.0 
)

Get fractional linear polarization image and error (standard deviation).

If wish to debias the image, you can either provide sigma (the standard deviation of the termal noise) or if sigma is non-positive, it will be worked out for you with a clipped mean algorithm.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::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 thermal noise.

If sigma is non-positive, it will be worked out for you with a clipped mean algorithm.

SPCIIF casa::ImagePolarimetry::imageInterface ( ) const
inline

Get the casacore::ImageInterface pointer of the construction image Don't delete it !

Definition at line 134 of file ImagePolarimetry.h.

References _image.

Referenced by casa::ImagePol::getImage().

casacore::Bool casa::ImagePolarimetry::isMasked ( ) const
inline

Is the construction image masked ?

Definition at line 149 of file ImagePolarimetry.h.

References _image.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::linPolPosAng ( casacore::Bool  radians) const

Get linearly polarized position angle (degrees or radians) image and error (standard deviation).

If you provide sigma it is the standard deviation of the termal noise. If sigma is non-positive, it will be worked out for you with a clipped mean algorithm.

ImagePolarimetry& casa::ImagePolarimetry::operator= ( const ImagePolarimetry other)

Assignment operator (reference semantics)

casacore::IPosition casa::ImagePolarimetry::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.

It tells you what the shape of the output Position Angle image should be, and gives you its CoordinateSystem. Because the ImagePolarimetry construction image may house the frequencies coordinate description in a Spectral, Tabular or Linear coordinate, you may explicitly specify which axis is the Spectral axis (spectralAxis). By default, it tries to find the SpectralCoordinate. If there is none, it will look for Tabular or Linear coordinates with a "FREQ" label.

void casa::ImagePolarimetry::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.

non-Fourier) Rotation Measure algorithm (Leahy et al, A&A, 156, 234) approach. For the RM images you must get the shape and CoordinateSYstem from function rotationMeasureShape. For the position angle images, use function singleStokesShape. Null pointer ImageInterface objects are not accessed so you can select which output images you want. Any output images not masked will be given a mask. The position angles are all in degrees. The RM images in rad/m/m. ImageInfo and Units, are copied to the output. MiscInfo and history are not. You specify which axis houses the frequencies, the noise level of Q and U if you know it (by default it is worked out for you) for error images, the value of the foreground RM if you know it (helps for unwinding ambiguity), the absolute maximum RM it should solve for, and the maximum error in the position angle that should be allowed. The state of the plotter should be set by the caller (e.g. character size, number of plots in x and y etc).

casacore::IPosition casa::ImagePolarimetry::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.

It tells you what the shape of the output RM image should be, and gives you its CoordinateSystem. Because the ImagePolarimetry construction image may house the frequencies coordinate description in a Spectral, Tabular or Linear coordinate, you may explicitly specify which axis is the Spectral axis (spectralAxis). By default, it tries to find the SpectralCoordinate. If there is none, it will look for Tabular or Linear coordinates with a "FREQ" label. It returns to you the frequencyAxis (i.e. the one it is concluded houses the frequency spectrum) and the stokesAxis that it finds.

casacore::IPosition casa::ImagePolarimetry::shape ( ) const
inline

Get the shape of the construction image.

Definition at line 144 of file ImagePolarimetry.h.

References _image.

casacore::Float casa::ImagePolarimetry::sigma ( casacore::Float  clip = 10.0)

Get the best estimate of the statistical noise.

This gives you the standard deviation with outliers from the mean clipped first. The idea is to not be confused by source or dynamic range issues. Generally Stokes V is empty of sources (not always), then Q and U are generally less bright than I. So this function first tries V, then Q and U and lastly I to give you its noise estimate

static casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::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 
)
static
casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::sigmaFracLinPol ( casacore::Float  clip = 10.0,
casacore::Float  sigma = -1.0 
)
casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::sigmaFracTotPol ( casacore::Float  clip = 10.0,
casacore::Float  sigma = -1.0 
)
casacore::Float casa::ImagePolarimetry::sigmaLinPolInt ( casacore::Float  clip = 10.0,
casacore::Float  sigma = -1.0 
)

Get the linearly polarized intensity image and its standard deviation.

If wish to debias the image, you can either provide sigma (the standard deviation of the termal noise) or if sigma is non-positive, it will be worked out for you with a clipped mean algorithm.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::sigmaLinPolPosAng ( casacore::Bool  radians,
casacore::Float  clip = 10.0,
casacore::Float  sigma = -1.0 
)
casacore::Float casa::ImagePolarimetry::sigmaStokes ( ImagePolarimetry::StokesTypes  index,
casacore::Float  clip = 10.0 
)
casacore::Float casa::ImagePolarimetry::sigmaStokesI ( casacore::Float  clip = 10.0)
casacore::Float casa::ImagePolarimetry::sigmaStokesQ ( casacore::Float  clip = 10.0)
casacore::Float casa::ImagePolarimetry::sigmaStokesU ( casacore::Float  clip = 10.0)
casacore::Float casa::ImagePolarimetry::sigmaStokesV ( casacore::Float  clip = 10.0)
casacore::Float casa::ImagePolarimetry::sigmaTotPolInt ( casacore::Float  clip = 10.0,
casacore::Float  sigma = -1.0 
)
casacore::IPosition casa::ImagePolarimetry::singleStokesShape ( casacore::CoordinateSystem cSys,
casacore::Stokes::StokesTypes  type 
) const

Get the shape and casacore::CoordinateSystem of an image for a single Stokes pixel.

Thus, if the construction image shape was [10,10,4,20] where axis 2 (shape 4) is the casacore::Stokes axis, this function would return [10,10,1,20] Specify the type of casacore::Stokes pixel you want.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::stokes ( ImagePolarimetry::StokesTypes  index) const

Get the specified casacore::Stokes image and the standard deviation of the image.

This is worked out by first clipping outliers from the mean at the specified level.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::stokesI ( ) const

Get the Stokes I image and the standard deviation of the I image.

This is worked out by first clipping outliers from the mean at the specified level.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::stokesQ ( ) const

Get the casacore::Stokes Q image and the standard deviation of the Q image.

This is worked out by first clipping outliers from the mean at the specified level.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::stokesU ( ) const

Get the casacore::Stokes U image and the standard deviation of the U image.

This is worked out by first clipping outliers from the mean at the specified level.

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::stokesV ( ) const

Get the casacore::Stokes V image and the standard deviation of the V image.

This is worked out by first clipping outliers from the mean at the specified level.

void casa::ImagePolarimetry::summary ( casacore::LogIO os) const

Summary.

Just invokes the casacore::ImageSummary list function to summarize the header of the construction image

casacore::ImageExpr<casacore::Float> casa::ImagePolarimetry::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 has) image and its error (standard deviation).

If wish to debias the image, you can either provide sigma (the standard deviation of the thermal noise) or if sigma is non-positive, it will be worked out for you with a clipped mean algorithm.

Member Data Documentation

casacore::Matrix<casacore::Bool> casa::ImagePolarimetry::_beamsEqMat
private

Definition at line 403 of file ImagePolarimetry.h.

casacore::LinearFitSVD<casacore::Float>* casa::ImagePolarimetry::_fitter
private

const casacore::ImageInterface<casacore::Float>* _image;

Definition at line 393 of file ImagePolarimetry.h.

SPCIIF casa::ImagePolarimetry::_image
private

Definition at line 391 of file ImagePolarimetry.h.

Referenced by coordinates(), imageInterface(), isMasked(), and shape().

casacore::Float casa::ImagePolarimetry::_oldClip
private

Definition at line 394 of file ImagePolarimetry.h.

casacore::PtrBlock<casacore::ImageInterface<casacore::Float>*> casa::ImagePolarimetry::_stokes
private

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.

Definition at line 399 of file ImagePolarimetry.h.

casacore::PtrBlock<casacore::LatticeStatistics<casacore::Float>*> casa::ImagePolarimetry::_stokesStats
private

Definition at line 401 of file ImagePolarimetry.h.

const map<StokesTypes, casacore::String> casa::ImagePolarimetry::polMap
staticprivate

Definition at line 389 of file ImagePolarimetry.h.


The documentation for this class was generated from the following file: