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

for use with StokesVectors and related classes More...

#include <StokesUtil.h>

Public Member Functions

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

casacore::Float casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::abs ( const StokesVector sv)
inline

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 innerProduct(), and casacore::sqrt().

casacore::Bool casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::near ( const StokesVector val1,
const StokesVector val2,
casacore::Double  tol = 1.0e-5 
)
casacore::Bool casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::nearAbs ( const StokesVector val1,
const StokesVector val2,
casacore::Double  tol = 1.0e-5 
)

Functions to determine if one StokesVector is near another.

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

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

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

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

Definition at line 118 of file StokesUtil.h.

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

Definition at line 133 of file StokesUtil.h.

casacore::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 ( casacore::Array< U > &  output,
const casacore::Array< T > &  input 
)

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

The same function can be used to convert a casacore::Complex/casacore::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 ( casacore::Array< U > &  output,
const casacore::Array< T > &  input 
)

Convert an casacore::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 casacore::Complex or casacore::DComplex Array. I have not tested if this works for other template types.


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