casa
$Rev:20696$
|
for use with StokesVectors and related classes More...
#include <StokesUtil.h>
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< StokesVector > | operator* (const Array< Float > &farray, const StokesVector &sv) |
These Functions to multiply a StokesVector by an Array of Floats. | |
Array< StokesVector > | operator* (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) |
for use with StokesVectors and related classes
Public interface
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.
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)
Definition at line 95 of file StokesUtil.h.
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 casa::innerProduct(), and casa::sqrt().
Bool casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::near | ( | const StokesVector & | val1, |
const StokesVector & | val2, | ||
Double | tol = 1.0e-5 |
||
) |
Bool casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::nearAbs | ( | const StokesVector & | val1, |
const StokesVector & | val2, | ||
Double | tol = 1.0e-5 |
||
) |
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 | ||
) |
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
void casa::StokesUtil_global_functions_StokesVector_ancillary_Functions::unpackStokes | ( | Array< U > & | output, |
const Array< T > & | input | ||
) |