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

Two specialized 4-vector classes for polarization handling. More...

#include <StokesVector.h>

Inheritance diagram for casa::CStokesVector:
casacore::RigidVector< casacore::Complex, 4 >

Public Member Functions

 CStokesVector ()
 CStokesVector(casacore::Int n):RigidVector<casacore::Complex,4>(n) {} The casacore::Complex data members are automatically initialized to 0. More...
 
 CStokesVector (const casacore::Complex &c)
 Construct from scalar, setting all values to a constant. More...
 
 CStokesVector (const casacore::Complex &v0, const casacore::Complex &v1, const casacore::Complex &v2, const casacore::Complex &v3)
 Construct with four values specified. More...
 
 CStokesVector (const casacore::Complex v[4])
 Construct from c-array. More...
 
 CStokesVector (const CStokesVector &v)
 Construct from casacore::Vector (should have length 4) CStokesVector(const casacore::Vector<casacore::Complex> & v):RigidVector<casacore::Complex,4>(v) {} Copy constructor with copy semantics. More...
 
CStokesVectoroperator= (const CStokesVector &v)
 Construct from RigidVector CStokesVector(const casacore::RigidVector<casacore::Complex,4>& v):RigidVector<casacore::Complex,4>(v) {} Assignment. More...
 
CStokesVectoroperator= (const casacore::Vector< casacore::Complex > &v)
 Assign from a Vector. More...
 
CStokesVectoroperator= (const casacore::Complex &c)
 Assign from a scalar, setting all values to a constant. More...
 
CStokesVectoroperator- ()
 Negation. More...
 
CStokesVectoroperator+= (const CStokesVector &v)
 Addition. More...
 
CStokesVectoroperator-= (const CStokesVector &v)
 Subtraction. More...
 
CStokesVectoroperator*= (const CStokesVector &v)
 
CStokesVectoroperator*= (const casacore::SquareMatrix< casacore::Complex, 4 > &m)
 casacore::Matrix multiplication - v*=m is equivalent to v=m*v More...
 
CStokesVectoroperator*= (casacore::Float f)
 
casacore::Bool operator== (const CStokesVector &v) const
 Equality. More...
 
casacore::Bool operator!= (const CStokesVector &v) const
 Inequality. More...
 
CStokesVectorapplySlin ()
 Apply conversion matrix from casacore::Stokes to linear, in place. More...
 
CStokesVectorapplyScirc ()
 Apply conversion matrix from casacore::Stokes to circular, in place. More...
 
CStokesVectorapplySlinInv ()
 Apply conversion matrix from linear to casacore::Stokes, in place. More...
 
CStokesVectorapplyScircInv ()
 Apply conversion matrix from circular to casacore::Stokes, in place. More...
 
- Public Member Functions inherited from casacore::RigidVector< casacore::Complex, 4 >
RigidVector< casacore::Complex,
n > & 
operator- ()
 Negation. More...
 
 RigidVector ()
 RigidVector(Int dummy) { for (Int i=0; i<n; i++) v_p[i]=T(0); } Default constructor. More...
 
 RigidVector (const casacore::Complex &c)
 Construct from scalar, sets all elements to c. More...
 
 RigidVector (const casacore::Complex &v0, const casacore::Complex &v1)
 Construct a 2-element vector, fails for wrong size vectors. More...
 
 RigidVector (const casacore::Complex &v0, const casacore::Complex &v1, const casacore::Complex &v2)
 Construct a 3-element vector, fails for wrong size vectors. More...
 
 RigidVector (const casacore::Complex &v0, const casacore::Complex &v1, const casacore::Complex &v2, const casacore::Complex &v3)
 Construct a 4-element vector, fails for wrong size vectors. More...
 
 RigidVector (const casacore::Complex &v0, const casacore::Complex &v1, const casacore::Complex &v2, const casacore::Complex &v3, const casacore::Complex &v4)
 Construct a 5-element vector, fails for wrong size vectors. More...
 
 RigidVector (const casacore::Complex &v0, const casacore::Complex &v1, const casacore::Complex &v2, const casacore::Complex &v3, const casacore::Complex &v4, const casacore::Complex &v5)
 Construct a 6-element vector, fails for wrong size vectors. More...
 
 RigidVector (const casacore::Complexv[n])
 Construct from a c-array (copy semantics) More...
 
 RigidVector (const Vector< casacore::Complex > &v)
 Construct from a Vector. More...
 
 RigidVector (const RigidVector< casacore::Complex, n > &v)
 Copy constructor, copy semantics. More...
 
RigidVector< casacore::Complex,
n > & 
operator= (const RigidVector< casacore::Complex, n > &v)
 Assign from a RigidVector. More...
 
RigidVector< casacore::Complex,
n > & 
operator= (const Vector< casacore::Complex > &v)
 Assign from a Vector. More...
 
RigidVector< casacore::Complex,
n > & 
operator= (const casacore::Complex &c)
 Assign a scalar, sets all elements to c. More...
 
RigidVector< casacore::Complex,
n > & 
operator+= (const RigidVector< casacore::Complex, n > &v)
 Addition. More...
 
RigidVector< casacore::Complex,
n > & 
operator*= (const RigidVector< casacore::Complex, n > &v)
 
RigidVector< casacore::Complex,
n > & 
operator*= (const casacore::Complex &val)
 Multiplication by scalar. More...
 
RigidVector< casacore::Complex,
n > & 
operator*= (const SquareMatrix< casacore::Complex, n > &m)
 Multiply vector by matrix: v*=M is equivalent to v=M*v;. More...
 
RigidVector< casacore::Complex,
n > & 
operator-= (const RigidVector< casacore::Complex, n > &v)
 Subtraction. More...
 
casacore::Complex & operator() (Int i)
 Indexing by reference. More...
 
const casacore::Complex & operator() (Int i) const
 Indexing by const reference. More...
 
Vector< casacore::Complex > vector () const
 Convert to a regular Vector. More...
 
RigidVector< casacore::Complex, n > sqrt (const RigidVector< casacore::Complex, n > &v)
 Square Root. More...
 

Static Public Member Functions

static casacore::String dataTypeId ()
 

Friends

casacore::Complex innerProduct (const CStokesVector &l, const CStokesVector &r)
 Return a StokesVector with the real part. More...
 
double norm (const CStokesVector &l)
 
std::ostream & operator<< (std::ostream &os, const CStokesVector &v)
 Write out a CStokesVector using the casacore::Vector output method. More...
 

Additional Inherited Members

- Protected Attributes inherited from casacore::RigidVector< casacore::Complex, 4 >
casacore::Complex v_p [n]
 // The following are needed for Image<RigidVector> More...
 

Detailed Description

Two specialized 4-vector classes for polarization handling.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

StokesVector and CStokesVector (casacore::Complex StokesVector) are two classes designed to handle a 4-vector of polarization values (I,Q,U,V or e.g., RR,RL,LR,LL).

Synopsis

StokesVectors are RigidVectors of length 4. They have a few special member functions to do polarization conversions efficiently. CStokesVector also has a real() member function to get at the real part of the components.

Example

// Create a real valued I,Q,U,V StokesVector
StokesVector pixel(4.0,2.0,1.0,0.1);
// convert to a casacore::Complex valued vector of linear polarizations
CStokesVector cohVec=applySlin(pixel);
// convert back to I,Q,U,V
cohVec.applySlinInv();
// Write out the real part
cout<< cohVec.real() <<endl;

Motivation

Full polarization processing of interferometry data uses real and complex valued 4-vectors. The StokesVector specialization handles this more efficiently than a standard casacore::Vector of size 4.

Thrown Exceptions

To Do

Definition at line 103 of file StokesVector.h.

Constructor & Destructor Documentation

casa::CStokesVector::CStokesVector ( )
inline

CStokesVector(casacore::Int n):RigidVector<casacore::Complex,4>(n) {} The casacore::Complex data members are automatically initialized to 0.

Definition at line 109 of file StokesVector.h.

casa::CStokesVector::CStokesVector ( const casacore::Complex &  c)
inlineexplicit

Construct from scalar, setting all values to a constant.

Definition at line 111 of file StokesVector.h.

casa::CStokesVector::CStokesVector ( const casacore::Complex &  v0,
const casacore::Complex &  v1,
const casacore::Complex &  v2,
const casacore::Complex &  v3 
)
inline

Construct with four values specified.

Definition at line 113 of file StokesVector.h.

casa::CStokesVector::CStokesVector ( const casacore::Complex  v[4])
inline

Construct from c-array.

Definition at line 117 of file StokesVector.h.

casa::CStokesVector::CStokesVector ( const CStokesVector v)
inline

Construct from casacore::Vector (should have length 4) CStokesVector(const casacore::Vector<casacore::Complex> & v):RigidVector<casacore::Complex,4>(v) {} Copy constructor with copy semantics.

Definition at line 121 of file StokesVector.h.

Member Function Documentation

CStokesVector& casa::CStokesVector::applyScirc ( )
inline

Apply conversion matrix from casacore::Stokes to circular, in place.

Definition at line 177 of file StokesVector.h.

References casacore::RigidVector< casacore::Complex, 4 >::v_p.

Referenced by casa::applyScirc().

CStokesVector& casa::CStokesVector::applyScircInv ( )
inline

Apply conversion matrix from circular to casacore::Stokes, in place.

Definition at line 192 of file StokesVector.h.

References casacore, and casacore::RigidVector< casacore::Complex, 4 >::v_p.

Referenced by casa::applyScircInv().

CStokesVector& casa::CStokesVector::applySlin ( )
inline

Apply conversion matrix from casacore::Stokes to linear, in place.

Definition at line 170 of file StokesVector.h.

References casacore::RigidVector< casacore::Complex, 4 >::v_p.

Referenced by casa::applySlin().

CStokesVector& casa::CStokesVector::applySlinInv ( )
inline

Apply conversion matrix from linear to casacore::Stokes, in place.

Definition at line 184 of file StokesVector.h.

References casacore, and casacore::RigidVector< casacore::Complex, 4 >::v_p.

Referenced by casa::applySlinInv().

static casacore::String casa::CStokesVector::dataTypeId ( )
inlinestatic

Definition at line 106 of file StokesVector.h.

casacore::Bool casa::CStokesVector::operator!= ( const CStokesVector v) const
inline
CStokesVector& casa::CStokesVector::operator*= ( const CStokesVector v)
inline

Definition at line 148 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator*=().

CStokesVector& casa::CStokesVector::operator*= ( const casacore::SquareMatrix< casacore::Complex, 4 > &  m)
inline

casacore::Matrix multiplication - v*=m is equivalent to v=m*v

Definition at line 152 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator*=().

CStokesVector& casa::CStokesVector::operator*= ( casacore::Float  f)
inline
CStokesVector& casa::CStokesVector::operator+= ( const CStokesVector v)
inline

Addition.

Definition at line 141 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator+=().

CStokesVector& casa::CStokesVector::operator- ( )
inline

Negation.

Definition at line 137 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator-().

CStokesVector& casa::CStokesVector::operator-= ( const CStokesVector v)
inline

Subtraction.

Definition at line 145 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator-=().

CStokesVector& casa::CStokesVector::operator= ( const CStokesVector v)
inline

Construct from RigidVector CStokesVector(const casacore::RigidVector<casacore::Complex,4>& v):RigidVector<casacore::Complex,4>(v) {} Assignment.

Definition at line 125 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator=().

CStokesVector& casa::CStokesVector::operator= ( const casacore::Vector< casacore::Complex > &  v)
inline

Assign from a Vector.

Definition at line 129 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator=().

CStokesVector& casa::CStokesVector::operator= ( const casacore::Complex &  c)
inline

Assign from a scalar, setting all values to a constant.

Definition at line 133 of file StokesVector.h.

References casacore::RigidVector< T, n >::operator=().

casacore::Bool casa::CStokesVector::operator== ( const CStokesVector v) const
inline

Friends And Related Function Documentation

casacore::Complex innerProduct ( const CStokesVector l,
const CStokesVector r 
)
friend

Return a StokesVector with the real part.

StokesVector real(); inner product of two complex vectors

Definition at line 202 of file StokesVector.h.

double norm ( const CStokesVector l)
friend

Definition at line 207 of file StokesVector.h.

std::ostream& operator<< ( std::ostream &  os,
const CStokesVector v 
)
friend

Write out a CStokesVector using the casacore::Vector output method.

Definition at line 215 of file StokesVector.h.


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