casa
$Rev:20696$
|
Interconvert between pixel and Quality value. More...
#include <QualityCoordinate.h>
Public Member Functions | |
QualityCoordinate (const Vector< Int > &whichQuality) | |
The length of whichQuality is the length of the axis, and the values define which quality are in which axis value. | |
QualityCoordinate (const QualityCoordinate &other) | |
Copy constructor (copy semantics) | |
QualityCoordinate & | operator= (const QualityCoordinate &other) |
Assignment (copy semantics) | |
virtual | ~QualityCoordinate () |
Destructor. | |
virtual Coordinate::Type | type () const |
Returns Coordinates::QUALITY. | |
virtual String | showType () const |
Always returns the String "Quality". | |
virtual uInt | nPixelAxes () const |
Always returns 1. | |
virtual uInt | nWorldAxes () const |
virtual Bool | toWorld (Vector< Double > &world, const Vector< Double > &pixel) const |
Convert a pixel to a world coordinate or vice versa. | |
virtual Bool | toPixel (Vector< Double > &pixel, const Vector< Double > &world) const |
Bool | toPixel (Int &pixel, Quality::QualityTypes quality) const |
Interconvert between pixel and world as a Quality type. | |
Bool | toWorld (Quality::QualityTypes &quality, Int pixel) const |
virtual void | makePixelRelative (Vector< Double > &pixel) const |
Make absolute coordinates relative and vice-versa. | |
virtual void | makePixelAbsolute (Vector< Double > &pixel) const |
virtual void | makeWorldRelative (Vector< Double > &world) const |
virtual void | makeWorldAbsolute (Vector< Double > &world) const |
Vector< Int > | quality () const |
Get the Quality values (Quality::QualityType) that we constructed with into a vector. | |
void | setQuality (const Vector< Int > &whichQuality) |
Set a new vector of Quality values (a vector of Quality::QualityType) | |
virtual Vector< String > | worldAxisNames () const |
Report the value of the requested attribute. | |
virtual Vector< Double > | referencePixel () const |
virtual Matrix< Double > | linearTransform () const |
virtual Vector< Double > | increment () const |
virtual Vector< Double > | referenceValue () const |
virtual Bool | setWorldAxisNames (const Vector< String > &names) |
Set the value of the requested attribute. | |
virtual Bool | setReferencePixel (const Vector< Double > &refPix) |
virtual Bool | setLinearTransform (const Matrix< Double > &xform) |
virtual Bool | setIncrement (const Vector< Double > &inc) |
virtual Bool | setReferenceValue (const Vector< Double > &refval) |
virtual Bool | setWorldAxisUnits (const Vector< String > &units) |
The set function has no effect as the units must be empty for a QualityCoordinate Always returns True. | |
virtual Vector< String > | worldAxisUnits () const |
virtual Bool | setWorldMixRanges (const IPosition &shape) |
Set the world min and max ranges, for use in function toMix , for a lattice of the given shape (for this coordinate). | |
virtual void | setDefaultWorldMixRanges () |
virtual String | format (String &units, Coordinate::formatType format, Double worldValue, uInt worldAxis, Bool isAbsolute=True, Bool showAsAbsolute=True, Int precision=-1, Bool usePrecForMixed=False) const |
Format a QualityCoordinate world value with the common format interface (refer to the base class Coordinate for basics. | |
virtual Bool | near (const Coordinate &other, Double tol=1e-6) const |
Comparison function. | |
virtual Bool | near (const Coordinate &other, const Vector< Int > &excludeAxes, Double tol=1e-6) const |
virtual Bool | save (RecordInterface &container, const String &fieldName) const |
Save the QualityCoordinate into the supplied record using the supplied field name. | |
virtual Coordinate * | clone () const |
Make a copy of the QualityCoordinate using new. | |
virtual Bool | doNearPixel (const Coordinate &other, const Vector< Bool > &thisAxes, const Vector< Bool > &otherAxes, Double tol=1.0e-6) const |
Comparison only made for specified axes in this and other Coordinate. | |
Static Public Member Functions | |
static Double | toWorld (Quality::QualityTypes quality) |
Interconvert between world stored as a Double and world stored as a Quality type. | |
static Quality::QualityTypes | toWorld (Double world) |
static QualityCoordinate * | restore (const RecordInterface &container, const String &fieldName) |
Recover the QualityCoordinate from a record. | |
Private Member Functions | |
Bool | toWorld (Double &world, const Double pixel) const |
Bool | toPixel (Double &pixel, const Double world) const |
QualityCoordinate () | |
Undefined and inaccessible. | |
Private Attributes | |
Block< Int > | values_p |
Double | crval_p |
Keep these for subimaging purposes. | |
Double | crpix_p |
Double | matrix_p |
Double | cdelt_p |
String | name_p |
String | unit_p |
Int | nValues_p |
Interconvert between pixel and Quality value.
Public interface
Caution: All pixel coordinates are zero relative;
In this example we create a QualityCoordinate containing 'DATA' and 'ERROR'
Vector<Int> newQuality(2); newQuality(0) = Quality::DATA; newQuality(1) = Quality::ERROR; qual = QualityCoordinate(newQuality);
Definition at line 79 of file QualityCoordinate.h.
casa::QualityCoordinate::QualityCoordinate | ( | const Vector< Int > & | whichQuality | ) | [explicit] |
The length of whichQuality is the length of the axis, and the values define which quality are in which axis value.
Often the vector will be of length 2 and will contain Quality::DATA, and ERROR.
casa::QualityCoordinate::QualityCoordinate | ( | const QualityCoordinate & | other | ) |
Copy constructor (copy semantics)
virtual casa::QualityCoordinate::~QualityCoordinate | ( | ) | [virtual] |
Destructor.
casa::QualityCoordinate::QualityCoordinate | ( | ) | [private] |
Undefined and inaccessible.
virtual Coordinate* casa::QualityCoordinate::clone | ( | ) | const [virtual] |
Make a copy of the QualityCoordinate using new.
The caller is responsible for calling delete.
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::doNearPixel | ( | const Coordinate & | other, |
const Vector< Bool > & | thisAxes, | ||
const Vector< Bool > & | otherAxes, | ||
Double | tol = 1.0e-6 |
||
) | const [virtual] |
Comparison only made for specified axes in this and other Coordinate.
Reimplemented from casa::Coordinate.
virtual String casa::QualityCoordinate::format | ( | String & | units, |
Coordinate::formatType | format, | ||
Double | worldValue, | ||
uInt | worldAxis, | ||
Bool | isAbsolute = True , |
||
Bool | showAsAbsolute = True , |
||
Int | precision = -1 , |
||
Bool | usePrecForMixed = False |
||
) | const [virtual] |
Format a QualityCoordinate world value with the common format interface (refer to the base class Coordinate for basics.
A QualityCoordinate is formatted differently from other Coordinate types. The world value is converted to the character representation as defined by the enum QualityTypes
in the class Quality .
Thus, all other arguments to do with formatting and precision are ignored.
Reimplemented from casa::Coordinate.
virtual Vector<Double> casa::QualityCoordinate::increment | ( | ) | const [virtual] |
Implements casa::Coordinate.
virtual Matrix<Double> casa::QualityCoordinate::linearTransform | ( | ) | const [virtual] |
Implements casa::Coordinate.
virtual void casa::QualityCoordinate::makePixelAbsolute | ( | Vector< Double > & | pixel | ) | const [virtual] |
Reimplemented from casa::Coordinate.
virtual void casa::QualityCoordinate::makePixelRelative | ( | Vector< Double > & | pixel | ) | const [virtual] |
Make absolute coordinates relative and vice-versa.
For the QualityCoordinate relative world coordinates are defined to be the same as absolute world coordinates. Relative pixels do have meaning and are implemented (rel = abs - refPix)
Reimplemented from casa::Coordinate.
virtual void casa::QualityCoordinate::makeWorldAbsolute | ( | Vector< Double > & | world | ) | const [virtual] |
Reimplemented from casa::Coordinate.
virtual void casa::QualityCoordinate::makeWorldRelative | ( | Vector< Double > & | world | ) | const [virtual] |
Reimplemented from casa::Coordinate.
virtual Bool casa::QualityCoordinate::near | ( | const Coordinate & | other, |
Double | tol = 1e-6 |
||
) | const [virtual] |
Comparison function.
Any private Double data members are compared with the specified fractional tolerance. Don't compare on the specified axes in the Coordinate. If the comparison returns False, method errorMessage returns a message about why.
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::near | ( | const Coordinate & | other, |
const Vector< Int > & | excludeAxes, | ||
Double | tol = 1e-6 |
||
) | const [virtual] |
Implements casa::Coordinate.
virtual uInt casa::QualityCoordinate::nPixelAxes | ( | ) | const [virtual] |
Always returns 1.
Implements casa::Coordinate.
virtual uInt casa::QualityCoordinate::nWorldAxes | ( | ) | const [virtual] |
Implements casa::Coordinate.
QualityCoordinate& casa::QualityCoordinate::operator= | ( | const QualityCoordinate & | other | ) |
Assignment (copy semantics)
Vector<Int> casa::QualityCoordinate::quality | ( | ) | const |
Get the Quality values (Quality::QualityType) that we constructed with into a vector.
virtual Vector<Double> casa::QualityCoordinate::referencePixel | ( | ) | const [virtual] |
Implements casa::Coordinate.
virtual Vector<Double> casa::QualityCoordinate::referenceValue | ( | ) | const [virtual] |
Implements casa::Coordinate.
static QualityCoordinate* casa::QualityCoordinate::restore | ( | const RecordInterface & | container, |
const String & | fieldName | ||
) | [static] |
Recover the QualityCoordinate from a record.
A null pointer means that the restoration did not succeed - probably because fieldName doesn't exist or doesn't contain a CoordinateSystem.
virtual Bool casa::QualityCoordinate::save | ( | RecordInterface & | container, |
const String & | fieldName | ||
) | const [virtual] |
Save the QualityCoordinate into the supplied record using the supplied field name.
The field must not exist, otherwise False
is returned.
Implements casa::Coordinate.
virtual void casa::QualityCoordinate::setDefaultWorldMixRanges | ( | ) | [virtual] |
Reimplemented from casa::Coordinate.
virtual Bool casa::QualityCoordinate::setIncrement | ( | const Vector< Double > & | inc | ) | [virtual] |
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::setLinearTransform | ( | const Matrix< Double > & | xform | ) | [virtual] |
Implements casa::Coordinate.
void casa::QualityCoordinate::setQuality | ( | const Vector< Int > & | whichQuality | ) |
Set a new vector of Quality values (a vector of Quality::QualityType)
virtual Bool casa::QualityCoordinate::setReferencePixel | ( | const Vector< Double > & | refPix | ) | [virtual] |
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::setReferenceValue | ( | const Vector< Double > & | refval | ) | [virtual] |
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::setWorldAxisNames | ( | const Vector< String > & | names | ) | [virtual] |
Set the value of the requested attribute.
For the QualityCoordinate, these have no effect (always return True) except for setWorldAxisNames.
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::setWorldAxisUnits | ( | const Vector< String > & | units | ) | [virtual] |
The set function has no effect as the units must be empty for a QualityCoordinate Always returns True.
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::setWorldMixRanges | ( | const IPosition & | shape | ) | [virtual] |
Set the world min and max ranges, for use in function toMix
, for a lattice of the given shape (for this coordinate).
The implementation here gives world coordinates at the start and end of the Quality axis. The output vectors are resized. Returns False if fails (and then setDefaultWorldMixRanges
generates the ranges) with a reason in errorMessage()
. The setDefaultWorldMixRanges
function gives you [-1e99->1e99].
Reimplemented from casa::Coordinate.
virtual String casa::QualityCoordinate::showType | ( | ) | const [virtual] |
Always returns the String "Quality".
Implements casa::Coordinate.
virtual Bool casa::QualityCoordinate::toPixel | ( | Vector< Double > & | pixel, |
const Vector< Double > & | world | ||
) | const [virtual] |
Implements casa::Coordinate.
Bool casa::QualityCoordinate::toPixel | ( | Int & | pixel, |
Quality::QualityTypes | quality | ||
) | const |
Interconvert between pixel and world as a Quality type.
It returns False if no conversion could be done.
Bool casa::QualityCoordinate::toPixel | ( | Double & | pixel, |
const Double | world | ||
) | const [private] |
virtual Bool casa::QualityCoordinate::toWorld | ( | Vector< Double > & | world, |
const Vector< Double > & | pixel | ||
) | const [virtual] |
Convert a pixel to a world coordinate or vice versa.
Returns True if the conversion succeeds, otherwise it returns False and method errorMessage
returns an error message. The output vectors are appropriately resized before use.
Implements casa::Coordinate.
Bool casa::QualityCoordinate::toWorld | ( | Quality::QualityTypes & | quality, |
Int | pixel | ||
) | const |
static Double casa::QualityCoordinate::toWorld | ( | Quality::QualityTypes | quality | ) | [static] |
Interconvert between world stored as a Double and world stored as a Quality type.
Since these functions are static, any valid Quality type can be used. The second function returns Quality::Undefined if world is illegal.
static Quality::QualityTypes casa::QualityCoordinate::toWorld | ( | Double | world | ) | [static] |
Bool casa::QualityCoordinate::toWorld | ( | Double & | world, |
const Double | pixel | ||
) | const [private] |
virtual Coordinate::Type casa::QualityCoordinate::type | ( | ) | const [virtual] |
Returns Coordinates::QUALITY.
Implements casa::Coordinate.
virtual Vector<String> casa::QualityCoordinate::worldAxisNames | ( | ) | const [virtual] |
Report the value of the requested attribute.
Implements casa::Coordinate.
virtual Vector<String> casa::QualityCoordinate::worldAxisUnits | ( | ) | const [virtual] |
Implements casa::Coordinate.
Double casa::QualityCoordinate::cdelt_p [private] |
Definition at line 255 of file QualityCoordinate.h.
Double casa::QualityCoordinate::crpix_p [private] |
Definition at line 255 of file QualityCoordinate.h.
Double casa::QualityCoordinate::crval_p [private] |
Keep these for subimaging purposes.
Definition at line 255 of file QualityCoordinate.h.
Double casa::QualityCoordinate::matrix_p [private] |
Definition at line 255 of file QualityCoordinate.h.
String casa::QualityCoordinate::name_p [private] |
Definition at line 256 of file QualityCoordinate.h.
Int casa::QualityCoordinate::nValues_p [private] |
Definition at line 258 of file QualityCoordinate.h.
String casa::QualityCoordinate::unit_p [private] |
Definition at line 257 of file QualityCoordinate.h.
Block<Int> casa::QualityCoordinate::values_p [private] |
Definition at line 252 of file QualityCoordinate.h.