casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::StokesUtil_global_functions_StokesVector_ancillary_Functions Struct Reference

for use with StokesVectors and related classes More...

#include <StokesUtil.h>

List of all members.

Public Member Functions

template<class T , class U >
void unpackStokes (Array< U > &output, const Array< T > &input)
 Convert an Array of StokesVectors to an array of Floats or Doubles (depending on the templates).
template<class T , class U >
void repackStokes (Array< U > &output, const Array< T > &input)
 Convert an Array of Floats or Doubles to an Array of StokesVectors.
Array< StokesVectoroperator* (const Array< Float > &farray, const StokesVector &sv)
 These Functions to multiply a StokesVector by an Array of Floats.
Array< StokesVectoroperator* (const StokesVector &sv, const Array< Float > &farray)
Float abs (const StokesVector &sv)
 Functions to compare stokesVectors with each other.
Bool operator> (const StokesVector &left, const StokesVector &right)
Bool operator< (const StokesVector &left, const StokesVector &right)
Bool nearAbs (const StokesVector &val1, const StokesVector &val2, Double tol=1.0e-5)
 Functions to determine if one StokesVector is near another.
Bool near (const StokesVector &val1, const StokesVector &val2, Double tol=1.0e-5)

Detailed Description

for use with StokesVectors and related classes

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Synopsis

Global Functions to operate on StokesVectors. Currently this includes functions to convert arrays from/to arrays of StokesVectors and some miscellaneous mathematical operations.

The {un,re}packStokes functions convert between an Array of StokesVector or CStokesvector into an Array of Float/Double or Complex/DComplex. The Float/Double array has one more dimension than the corresponding StokesVector array, and this extra dimension (always the slowest moving or last one) has a length of 4. The output array is always resized to the appropriate size.

The StokesVector comparison functions use the the "length" of the StokesVector (ie. sqrt(I^2+Q^2+U^2+V^2)) to make a comparison. In particular the abs() function returns the "length" of the StokesVector. It is called abs rather than say length() to allow StokesVectors to utilise other globals functions (like allNearAbs()) which expect the absolute value function to be defined.

Motivation

g++ does not like templated and non-templated code in the same file. So the templated stuff was split off and put into this file. Later this became a convient place to put all the global functions, and the non-templated global functions are also defined here (and the implementation is put in a separate .cc file)

Thrown Exceptions

To Do

Definition at line 95 of file StokesUtil.h.


Member Function Documentation

Functions to compare stokesVectors with each other.

They are all based on the norm derived using the "length" of the vector in 4-space.

Definition at line 127 of file StokesUtil.h.

References casa::innerProduct(), and casa::sqrt().

Functions to determine if one StokesVector is near another.

Array<StokesVector> casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::operator* ( const Array< Float > &  farray,
const StokesVector sv 
)

These Functions to multiply a StokesVector by an Array of Floats.

The result is an Array of StokesVectors that is the same size as the Array of Floats with each polarization being the Array of floats multiplied by the corresponding component in the supplied StokesVector.

Array<StokesVector> casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::operator* ( const StokesVector sv,
const Array< Float > &  farray 
) [inline]

Definition at line 118 of file StokesUtil.h.

Bool casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::operator< ( const StokesVector left,
const StokesVector right 
) [inline]

Definition at line 133 of file StokesUtil.h.

Bool casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::operator> ( const StokesVector left,
const StokesVector right 
)
template<class T , class U >
void casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::repackStokes ( Array< U > &  output,
const Array< T > &  input 
)

Convert an Array of Floats or Doubles to an Array of StokesVectors.

The same function can be used to convert a Complex/DComplex array to an array of CStokesVector. The last non-degenerate axis on the input array MUST be of length 4

template<class T , class U >
void casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::unpackStokes ( Array< U > &  output,
const Array< T > &  input 
)

Convert an Array of StokesVectors to an array of Floats or Doubles (depending on the templates).

The same function can be used to convert an array of CStokesVectors to a Complex or DComplex Array. I have not tested if this works for other template types.


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