StokesVector.h

Classes

CStokesVector -- Two specialized 4-vector classes for polarization handling (full description)
StokesVector -- (full description)

class CStokesVector:public RigidVector<Complex,4>

Interface

Public Members
static String dataTypeId()
CStokesVector():RigidVector<Complex,4>()
CStokesVector(const Complex& c):RigidVector<Complex,4>(c)
CStokesVector(const Complex& v0, const Complex& v1, const Complex& v2, const Complex& v3): RigidVector<Complex,4>(v0,v1,v2,v3)
CStokesVector(const Complex v[4]):RigidVector<Complex,4>(v)
CStokesVector(const CStokesVector& v):RigidVector<Complex,4>(v)
CStokesVector& operator=(const CStokesVector& v)
CStokesVector& operator=(const Vector<Complex>& v)
CStokesVector& operator=(const Complex& c)
CStokesVector& operator-()
CStokesVector& operator+=(const CStokesVector& v)
CStokesVector& operator-=(const CStokesVector& v)
CStokesVector& operator*=(const CStokesVector& v)
CStokesVector& operator*=(const SquareMatrix<Complex,4>& m)
CStokesVector& operator*=(Float f)
Bool operator==(const CStokesVector& v) const
Bool operator!=(const CStokesVector& v) const
CStokesVector& applySlin()
CStokesVector& applyScirc()
CStokesVector& applySlinInv()
CStokesVector& applyScircInv()
friend Complex innerProduct(const CStokesVector& l, const CStokesVector& r)
friend double norm(const CStokesVector& l)
friend ostream& operator<<(ostream& os, const CStokesVector& v)
See Also
StokesVector ancillary functions -- Ancillary functions used to manipulate StokesVector and related classes

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

StokesVector and CStokesVector (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 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 Vector of size 4.

Thrown Exceptions

To Do

Member Description

static String dataTypeId()

CStokesVector():RigidVector<Complex,4>()

CStokesVector(Int n):RigidVector(n) {} The Complex data members are automatically initialized to 0.

CStokesVector(const Complex& c):RigidVector<Complex,4>(c)

Construct from scalar, setting all values to a constant.

CStokesVector(const Complex& v0, const Complex& v1, const Complex& v2, const Complex& v3): RigidVector<Complex,4>(v0,v1,v2,v3)

Construct with four values specified.

CStokesVector(const Complex v[4]):RigidVector<Complex,4>(v)

Construct from c-array

CStokesVector(const CStokesVector& v):RigidVector<Complex,4>(v)

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

CStokesVector& operator=(const CStokesVector& v)

Construct from RigidVector CStokesVector(const RigidVector& v):RigidVector(v) {} Assignment

CStokesVector& operator=(const Vector<Complex>& v)

Assign from a Vector

CStokesVector& operator=(const Complex& c)

Assign from a scalar, setting all values to a constant

CStokesVector& operator-()

Negation

CStokesVector& operator+=(const CStokesVector& v)

Addition

CStokesVector& operator-=(const CStokesVector& v)

Subtraction

CStokesVector& operator*=(const CStokesVector& v)

CStokesVector& operator*=(const SquareMatrix<Complex,4>& m)

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

CStokesVector& operator*=(Float f)

Bool operator==(const CStokesVector& v) const

Equality

Bool operator!=(const CStokesVector& v) const

Inequality

CStokesVector& applySlin()

Apply conversion matrix from Stokes to linear, in place.

CStokesVector& applyScirc()

Apply conversion matrix from Stokes to circular, in place

CStokesVector& applySlinInv()

Apply conversion matrix from linear to Stokes, in place

CStokesVector& applyScircInv()

Apply conversion matrix from circular to Stokes, in place

friend Complex innerProduct(const CStokesVector& l, const CStokesVector& r)

Return a StokesVector with the real part. StokesVector real(); inner product of two complex vectors

friend double norm(const CStokesVector& l)

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

Write out a CStokesVector using the Vector output method.


class StokesVector:public RigidVector<Float,4>

Interface

static String dataTypeId()
StokesVector():RigidVector<Float,4>()
StokesVector(Float f):RigidVector<Float,4>(f)
StokesVector(Float v0, Float v1, Float v2, Float v3): v2<Float,4>(v0,v1,v2,v3)
StokesVector(const StokesVector& v):RigidVector<Float,4>(v)
StokesVector& operator=(const StokesVector& v)
StokesVector& operator=(const Vector<Float>& v)
StokesVector& operator=(Float f)
StokesVector& operator-()
StokesVector& operator+=(const StokesVector& v)
StokesVector& operator-=(const StokesVector& v)
StokesVector& operator*=(Float f)
StokesVector& operator*=(const StokesVector& v)
StokesVector& operator*=(const SquareMatrix<Float,4>& m)
Bool operator==(const StokesVector& v) const
Bool operator!=(const StokesVector& v) const
Float maxEigenValue() const
Float minEigenValue() const
Float determinant() const
friend Float innerProduct(const StokesVector& l, const StokesVector& r)
friend CStokesVector operator*(const CStokesVector<Complex,4>& m, const StokesVector& v)
friend ostream& operator<<(ostream& os, const StokesVector& v)
See Also
StokesVector ancillary functions -- Ancillary functions used to manipulate StokesVector and related classes

Description

Member Description

static String dataTypeId()

StokesVector():RigidVector<Float,4>()

StokesVector(Int n):RigidVector(n) {} Default constructor zeroes vector.

StokesVector(Float f):RigidVector<Float,4>(f)

Construct from scalar, setting all values to a constant.

StokesVector(Float v0, Float v1, Float v2, Float v3): v2<Float,4>(v0,v1,v2,v3)

Construct with four values specified.

StokesVector(const StokesVector& v):RigidVector<Float,4>(v)

Construct from Vector (should have length 4) StokesVector(const Vector & v):RigidVector(v) {} Copy constructor with copy semantics.

StokesVector& operator=(const StokesVector& v)

Construct from RigidVector StokesVector(const RigidVector& v):RigidVector(v) {} Assignment

StokesVector& operator=(const Vector<Float>& v)

Assign from a Vector

StokesVector& operator=(Float f)

Assign from a scalar, setting all values to a constant

StokesVector& operator-()

Negation

StokesVector& operator+=(const StokesVector& v)

Addition

StokesVector& operator-=(const StokesVector& v)

Subtraction

StokesVector& operator*=(Float f)

StokesVector& operator*=(const StokesVector& v)

StokesVector& operator*=(const SquareMatrix<Float,4>& m)

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

Bool operator==(const StokesVector& v) const

Equality

Bool operator!=(const StokesVector& v) const

Inequality

Float maxEigenValue() const

Compute the maximum EigenValue

Float minEigenValue() const

Compute the minimum EigenValue

Float determinant() const

Compute the determinant of the coherence matrix

friend Float innerProduct(const StokesVector& l, const StokesVector& r)

The innerproduct of 2 StokesVectors

friend CStokesVector operator*(const CStokesVector<Complex,4>& m, const StokesVector& v)

Multiplication of StokesVector by a Complex SquareMatrix

friend ostream& operator<<(ostream& os, const StokesVector& v)

Write out a StokesVector using the Vector output method.