casa
5.7.0-16
|
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< StokesVector > | operator* (const casacore::Array< casacore::Float > &farray, const StokesVector &sv) |
These Functions to multiply a StokesVector by an casacore::Array of Floats. More... | |
casacore::Array< StokesVector > | operator* (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) |
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 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.
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.
|
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.
|
inline |
Definition at line 118 of file StokesUtil.h.
|
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 | ||
) |
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
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.