casa
5.7.0-16
|
A class that represents the Flux (reference semantics) More...
#include <SkyCompBase.h>
Public Member Functions | |
Flux () | |
The default constructor makes an object with I = 1, Q=U=V=0 , a casacore::Stokes representation, and units of "Jy". More... | |
Flux (T i) | |
The default constructor makes an object with I = 1, Q=U=V=0 , a casacore::Stokes representation, and units of "Jy". More... | |
Flux (T i, T q, T u, T v) | |
This constructor makes an object where I,Q,U,V are all specified. More... | |
Flux (typename casacore::NumericTraits< T >::ConjugateType xx, typename casacore::NumericTraits< T >::ConjugateType xy, typename casacore::NumericTraits< T >::ConjugateType yx, typename casacore::NumericTraits< T >::ConjugateType yy, ComponentType::Polarisation pol) | |
This constructor makes an object where the flux values and polarisation representation are specified. More... | |
Flux (const casacore::Vector< T > &flux) | |
This constructor makes an object where I,Q,U,V are all specified by a casacore::Vector that must have four elements. More... | |
Flux (const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &flux, ComponentType::Polarisation pol) | |
This constructor makes an object where the flux values are all specified by a casacore::Vector that must have four elements. More... | |
Flux (const casacore::Quantum< casacore::Vector< T > > &flux) | |
This constructor makes an object where the flux values are all specified by a casacore::Quantum<casacore::Vector> that must have four elements. More... | |
Flux (const casacore::Quantum< casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > > &flux, ComponentType::Polarisation pol) | |
This constructor makes an object where the flux values are all specified by a casacore::Quantum<casacore::Vector> that must have four elements. More... | |
Flux (const Flux< T > &other) | |
The copy constructor uses reference semantics. More... | |
~Flux () | |
The destructor is trivial. More... | |
Flux< T > & | operator= (const Flux< T > &other) |
The assignment operator uses reference semantics. More... | |
Flux< T > | copy () const |
Return a distinct copy of this flux. More... | |
const casacore::Unit & | unit () const |
These two functions return the current units. More... | |
void | unit (casacore::Unit &unit) const |
void | setUnit (const casacore::Unit &unit) |
This function sets the current unit. More... | |
void | convertUnit (const casacore::Unit &unit) |
This function sets the current units to the supplied value and additionally converts the internal flux values to the correspond to the new unit. More... | |
ComponentType::Polarisation | pol () const |
These two functions return the current polarisation representation. More... | |
void | pol (ComponentType::Polarisation &pol) const |
void | setPol (ComponentType::Polarisation pol) |
This function sets the current polarisation representation. More... | |
void | convertPol (ComponentType::Polarisation pol) |
This function sets the current polarisation representation to the supplied value and additionally converts the internal flux values to the correspond to the new polarisation representation. More... | |
const casacore::Vector < typename casacore::NumericTraits< T > ::ConjugateType > & | value () const |
This function returns the flux values. More... | |
const casacore::NumericTraits < T >::ConjugateType & | value (casacore::uInt p) const |
This function returns the specified component of the flux values. More... | |
void | value (casacore::Vector< T > &value) |
This function returns the flux values after converting it to the Stokes representation. More... | |
void | value (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &value) const |
This function returns the flux values. More... | |
void | value (casacore::Quantum< casacore::Vector< T > > &value) |
This function returns the flux values after converting it to the Stokes representation. More... | |
void | value (casacore::Quantum< casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > > &value) const |
This function returns the flux values. More... | |
casacore::Quantum< T > | value (casacore::Stokes::StokesTypes stokes, casacore::Bool toJy=true) |
Return the flux value in a casacore::Quantum for the specified Stokes. More... | |
void | setValue (T value) |
This function sets the Flux values assuming the supplied value represents the casacore::Stokes I flux in the current units. More... | |
void | setValue (const casacore::Vector< T > &value) |
This function sets the Flux values assuming the supplied values represent the flux in the casacore::Stokes representation and is in the current units. More... | |
void | setValue (const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &value) |
This function sets the Flux values assuming the supplied values represent the flux in the current representation and units. More... | |
void | setValue (const casacore::Quantum< casacore::Vector< T > > &value) |
This function sets the flux values and units assuming the supplied values represent the flux in the casacore::Stokes representation. More... | |
void | setValue (const casacore::Quantum< casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > > &value, ComponentType::Polarisation pol) |
This function sets the flux values, units and polarisation assuming the supplied values represent the flux in the specified representation. More... | |
void | setValue (const casacore::Quantum< T > &value, casacore::Stokes::StokesTypes stokes) |
Set flux for given casacore::Stokes from Quantum. More... | |
void | scaleValue (const T &factor) |
Scale the Flux value by the specified amount. More... | |
void | scaleValue (const T &factor0, const T &factor1, const T &factor2, const T &factor3) |
void | scaleValue (const typename casacore::NumericTraits< T >::ConjugateType &factor) |
void | scaleValue (const typename casacore::NumericTraits< T >::ConjugateType &factor0, const typename casacore::NumericTraits< T >::ConjugateType &factor1, const typename casacore::NumericTraits< T >::ConjugateType &factor2, const typename casacore::NumericTraits< T >::ConjugateType &factor3) |
void | setErrors (const typename casacore::NumericTraits< T >::ConjugateType &error0, const typename casacore::NumericTraits< T >::ConjugateType &error1, const typename casacore::NumericTraits< T >::ConjugateType &error2, const typename casacore::NumericTraits< T >::ConjugateType &error3) |
Set/get the errors in the flux. More... | |
void | setErrors (const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &errors) |
const casacore::Vector < typename casacore::NumericTraits< T > ::ConjugateType > & | errors () const |
casacore::Bool | fromRecord (casacore::String &errorMessage, const casacore::RecordInterface &record) |
This functions convert between a casacore::RecordInterface and a Flux object and define how the Flux is represented in glish. More... | |
casacore::Bool | toRecord (casacore::String &errorMessage, casacore::RecordInterface &record) const |
casacore::Bool | ok () const |
casacore::Function which checks the internal data of this class for correct dimensionality and consistent values. More... | |
Static Public Member Functions | |
static void | stokesToCircular (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< T > &in) |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Circular representation. More... | |
static void | stokesToCircular (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Circular representation. More... | |
static void | circularToStokes (casacore::Vector< T > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in Circular representation and one in casacore::Stokes representation. More... | |
static void | circularToStokes (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in Circular representation and one in casacore::Stokes representation. More... | |
static void | stokesToLinear (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< T > &in) |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Linear representation. More... | |
static void | stokesToLinear (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Linear representation. More... | |
static void | linearToStokes (casacore::Vector< T > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in Linear representation and one in casacore::Stokes representation. More... | |
static void | linearToStokes (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in Linear representation and one in casacore::Stokes representation. More... | |
static void | linearToCircular (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in Linear representation and one in Circular representation. More... | |
static void | circularToLinear (casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in) |
This function converts between a casacore::Vector in Circular representation and one in Linear representation. More... | |
Private Attributes | |
casacore::CountedPtr< FluxRep < T > > | itsFluxPtr |
A class that represents the Flux (reference semantics)
Public interface
The Flux class is used to represent the flux of a component on the sky
This class is nearly identical to the FluxRep class and the reader is referred to the documentation of this class for a general explanation of this class. Most of the functions in this class just call the functions in the FluxRep class.
There are two important differences between the Flux class and the FluxRep class.
The functions for converting between different polarisation representations require that the supplied and returned vector have all four polarisations. In the casacore::Stokes representation the order of the elements is I,Q,U,V, in the linear representation it is XX,XY,YX,YY, and in the circular representation it is RR,RL,LR,LL.
These functions will correctly convert between Linear/Circular representations and the casacore::Stokes representation even if the linear or circular polarisation cannot represent a physically realisable polarisation (eg if XY != conj(YX)
). In these cases the stokes representation will have an imaginary component and be complex. When converting the complex casacore::Stokes representation to a real one the imaginary components are simply discarded.
The function in this example calculates the total flux of all the components in a list. It accumulates the flux in a casacore::Vector after ensuring that the flux is in the appropriate units and Polarisation. It then returns the sum as a Flux object. Because this class uses reference semantics the returned object is passed by reference and hence this is a relatively cheap operation.
This class was needed to contain the flux in the ComponentModels class. It centralizes a lot of code that would otherwise be duplicated. The reference semantics further simplify the interface that the component classes use.
Definition at line 57 of file SkyCompBase.h.
casa::Flux< T >::Flux | ( | ) |
The default constructor makes an object with I = 1, Q=U=V=0
, a casacore::Stokes representation, and units of "Jy".
casa::Flux< T >::Flux | ( | T | i | ) |
The default constructor makes an object with I = 1, Q=U=V=0
, a casacore::Stokes representation, and units of "Jy".
casa::Flux< T >::Flux | ( | T | i, |
T | q, | ||
T | u, | ||
T | v | ||
) |
This constructor makes an object where I,Q,U,V are all specified.
It assumes a casacore::Stokes representation, and units of "Jy".
casa::Flux< T >::Flux | ( | typename casacore::NumericTraits< T >::ConjugateType | xx, |
typename casacore::NumericTraits< T >::ConjugateType | xy, | ||
typename casacore::NumericTraits< T >::ConjugateType | yx, | ||
typename casacore::NumericTraits< T >::ConjugateType | yy, | ||
ComponentType::Polarisation | pol | ||
) |
This constructor makes an object where the flux values and polarisation representation are specified.
It assumes the units are "Jy".
casa::Flux< T >::Flux | ( | const casacore::Vector< T > & | flux | ) |
This constructor makes an object where I,Q,U,V are all specified by a casacore::Vector that must have four elements.
It assumes a casacore::Stokes representation, and units of "Jy".
casa::Flux< T >::Flux | ( | const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & | flux, |
ComponentType::Polarisation | pol | ||
) |
This constructor makes an object where the flux values are all specified by a casacore::Vector that must have four elements.
The polarisation representation must also be specified. It assumes the units are "Jy".
casa::Flux< T >::Flux | ( | const casacore::Quantum< casacore::Vector< T > > & | flux | ) |
This constructor makes an object where the flux values are all specified by a casacore::Quantum<casacore::Vector> that must have four elements.
The casacore::Quantum must have units that are dimensionally equivalent to the "Jy" and these are the units of the FluxRep object. A casacore::Stokes polarisation representation is assumed.
casa::Flux< T >::Flux | ( | const casacore::Quantum< casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > > & | flux, |
ComponentType::Polarisation | pol | ||
) |
This constructor makes an object where the flux values are all specified by a casacore::Quantum<casacore::Vector> that must have four elements.
The casacore::Quantum must have units that are dimensionally equivalent to the "Jy" and these are the units of the FluxRep object. The polarisation representation must also be specified.
casa::Flux< T >::Flux | ( | const Flux< T > & | other | ) |
The copy constructor uses reference semantics.
casa::Flux< T >::~Flux | ( | ) |
The destructor is trivial.
|
static |
This function converts between a casacore::Vector in Circular representation and one in Linear representation.
|
static |
This function converts between a casacore::Vector in Circular representation and one in casacore::Stokes representation.
The imaginary components of the casacore::Stokes vector are discarded.
|
static |
This function converts between a casacore::Vector in Circular representation and one in casacore::Stokes representation.
The imaginary components of the casacore::Stokes vector are NOT ignored.
void casa::Flux< T >::convertPol | ( | ComponentType::Polarisation | pol | ) |
This function sets the current polarisation representation to the supplied value and additionally converts the internal flux values to the correspond to the new polarisation representation.
void casa::Flux< T >::convertUnit | ( | const casacore::Unit & | unit | ) |
This function sets the current units to the supplied value and additionally converts the internal flux values to the correspond to the new unit.
Flux<T> casa::Flux< T >::copy | ( | ) | const |
Return a distinct copy of this flux.
As both the assignment operator and the copy constructor use reference semantics this is the only way to get a real copy.
const casacore::Vector<typename casacore::NumericTraits<T>::ConjugateType>& casa::Flux< T >::errors | ( | ) | const |
casacore::Bool casa::Flux< T >::fromRecord | ( | casacore::String & | errorMessage, |
const casacore::RecordInterface & | record | ||
) |
This functions convert between a casacore::RecordInterface and a Flux object and define how the Flux is represented in glish.
They return false if the casacore::RecordInterface is malformed and append an error message to the supplied string giving the reason.
|
static |
This function converts between a casacore::Vector in Linear representation and one in Circular representation.
|
static |
This function converts between a casacore::Vector in Linear representation and one in casacore::Stokes representation.
The imaginary components of the casacore::Stokes vector are discarded.
|
static |
This function converts between a casacore::Vector in Linear representation and one in casacore::Stokes representation.
The imaginary components of the casacore::Stokes vector are NOT ignored.
casacore::Bool casa::Flux< T >::ok | ( | ) | const |
casacore::Function which checks the internal data of this class for correct dimensionality and consistent values.
Returns true if everything is fine otherwise returns false.
Flux<T>& casa::Flux< T >::operator= | ( | const Flux< T > & | other | ) |
The assignment operator uses reference semantics.
ComponentType::Polarisation casa::Flux< T >::pol | ( | ) | const |
These two functions return the current polarisation representation.
void casa::Flux< T >::pol | ( | ComponentType::Polarisation & | pol | ) | const |
void casa::Flux< T >::scaleValue | ( | const T & | factor | ) |
Scale the Flux value by the specified amount.
These functions multiply the flux values irrespective of the current polarisation representation. If only one scale factor is supplied then only the first component of the flux is scaled.
void casa::Flux< T >::scaleValue | ( | const T & | factor0, |
const T & | factor1, | ||
const T & | factor2, | ||
const T & | factor3 | ||
) |
void casa::Flux< T >::scaleValue | ( | const typename casacore::NumericTraits< T >::ConjugateType & | factor | ) |
void casa::Flux< T >::scaleValue | ( | const typename casacore::NumericTraits< T >::ConjugateType & | factor0, |
const typename casacore::NumericTraits< T >::ConjugateType & | factor1, | ||
const typename casacore::NumericTraits< T >::ConjugateType & | factor2, | ||
const typename casacore::NumericTraits< T >::ConjugateType & | factor3 | ||
) |
void casa::Flux< T >::setErrors | ( | const typename casacore::NumericTraits< T >::ConjugateType & | error0, |
const typename casacore::NumericTraits< T >::ConjugateType & | error1, | ||
const typename casacore::NumericTraits< T >::ConjugateType & | error2, | ||
const typename casacore::NumericTraits< T >::ConjugateType & | error3 | ||
) |
Set/get the errors in the flux.
void casa::Flux< T >::setErrors | ( | const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & | errors | ) |
void casa::Flux< T >::setPol | ( | ComponentType::Polarisation | pol | ) |
This function sets the current polarisation representation.
It does NOT convert the flux values.
void casa::Flux< T >::setUnit | ( | const casacore::Unit & | unit | ) |
This function sets the current unit.
It does NOT convert the flux values to correspond to the new unit. The new unit must be dimensionally equivalent to the "Jy".
void casa::Flux< T >::setValue | ( | T | value | ) |
This function sets the Flux values assuming the supplied value represents the casacore::Stokes I flux in the current units.
The other casacore::Stokes parameters are set to zero.
void casa::Flux< T >::setValue | ( | const casacore::Vector< T > & | value | ) |
This function sets the Flux values assuming the supplied values represent the flux in the casacore::Stokes representation and is in the current units.
The casacore::Vector must have four elements.
void casa::Flux< T >::setValue | ( | const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & | value | ) |
This function sets the Flux values assuming the supplied values represent the flux in the current representation and units.
The casacore::Vector must have four elements.
void casa::Flux< T >::setValue | ( | const casacore::Quantum< casacore::Vector< T > > & | value | ) |
This function sets the flux values and units assuming the supplied values represent the flux in the casacore::Stokes representation.
The units of the Quantum must be dimensionally equivalent to the "Jy" and the casacore::Vector must have four elements.
void casa::Flux< T >::setValue | ( | const casacore::Quantum< casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > > & | value, |
ComponentType::Polarisation | pol | ||
) |
This function sets the flux values, units and polarisation assuming the supplied values represent the flux in the specified representation.
The units of the casacore::Quantum must be dimensionally equivalent to the "Jy" and the casacore::Vector must have four elements.
void casa::Flux< T >::setValue | ( | const casacore::Quantum< T > & | value, |
casacore::Stokes::StokesTypes | stokes | ||
) |
Set flux for given casacore::Stokes from Quantum.
|
static |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Circular representation.
|
static |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Circular representation.
The imaginary components of the casacore::Stokes vector are NOT ignored.
|
static |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Linear representation.
|
static |
This function converts between a casacore::Vector in casacore::Stokes representation and one in Linear representation.
The imaginary components of the casacore::Stokes vector are NOT ignored.
casacore::Bool casa::Flux< T >::toRecord | ( | casacore::String & | errorMessage, |
casacore::RecordInterface & | record | ||
) | const |
const casacore::Unit& casa::Flux< T >::unit | ( | ) | const |
These two functions return the current units.
void casa::Flux< T >::unit | ( | casacore::Unit & | unit | ) | const |
const casacore::Vector<typename casacore::NumericTraits<T>::ConjugateType>& casa::Flux< T >::value | ( | ) | const |
This function returns the flux values.
The polarisation representation and units are in whatever is current.
const casacore::NumericTraits<T>::ConjugateType& casa::Flux< T >::value | ( | casacore::uInt | p | ) | const |
This function returns the specified component of the flux values.
The polarisation representation and units are in whatever is current.
void casa::Flux< T >::value | ( | casacore::Vector< T > & | value | ) |
This function returns the flux values after converting it to the Stokes representation.
The units of the returned casacore::Vector are the current units.
void casa::Flux< T >::value | ( | casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & | value | ) | const |
This function returns the flux values.
The polarisation representation and units are in whatever is current.
void casa::Flux< T >::value | ( | casacore::Quantum< casacore::Vector< T > > & | value | ) |
This function returns the flux values after converting it to the Stokes representation.
The units of the returned casacore::Quantum are the current units of the FluxRep object. The length of the casacore::Vector in the casacore::Quantum will be resized to 4 elements if it is not already that length.
void casa::Flux< T >::value | ( | casacore::Quantum< casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > > & | value | ) | const |
This function returns the flux values.
The units of the returned Quantum are the current units of the FluxRep object. Similarly the polarisation representation of the returned casacore::Quantum is the current polarisation representation. The length of the casacore::Vector in the casacore::Quantum will be resized to 4 elements if it is not already that length.
casacore::Quantum<T> casa::Flux< T >::value | ( | casacore::Stokes::StokesTypes | stokes, |
casacore::Bool | toJy = true |
||
) |
Return the flux value in a casacore::Quantum for the specified Stokes.
Can convert to Jy if requested.
|
private |