28 #ifndef IMAGES_IMAGEPOLARIMETRY_H
29 #define IMAGES_IMAGEPOLARIMETRY_H
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;
49 class LatticeExprNode;
140 return _image->coordinates();
150 return _image->isMasked();
389 static const map<StokesTypes, casacore::String>
polMap;
552 const std::vector<StokesTypes>&
stokes,
A Vector of integers, for indexing into Array<T> objects.
casacore::Bool _checkQUBeams(casacore::Bool requireChannelEquality, casacore::Bool throws=true) const
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>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.
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.
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.
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.
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
bool Bool
Define the standard types used by Casacore.
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<T*>.
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'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.
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<casacore::Float>* _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...
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
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.
casacore::Float _sigma(ImagePolarimetry::StokesTypes index, casacore::Float clip)
Find the standard deviation for the Stokes image specified by the integer index.