casacore
|
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. More... | |
QualityCoordinate (const QualityCoordinate &other) | |
Copy constructor (copy semantics) More... | |
QualityCoordinate & | operator= (const QualityCoordinate &other) |
Assignment (copy semantics) More... | |
virtual | ~QualityCoordinate () |
Destructor. More... | |
virtual Coordinate::Type | type () const |
Returns Coordinates::QUALITY. More... | |
virtual String | showType () const |
Always returns the String "Quality". More... | |
virtual uInt | nPixelAxes () const |
Always returns 1. More... | |
virtual uInt | nWorldAxes () const |
virtual Bool | toWorld (Vector< Double > &world, const Vector< Double > &pixel, Bool=True) const |
Convert a pixel to a world coordinate or vice versa. More... | |
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. More... | |
Bool | toWorld (Quality::QualityTypes &quality, Int pixel) const |
virtual void | makePixelRelative (Vector< Double > &pixel) const |
Make absolute coordinates relative and vice-versa. More... | |
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. More... | |
void | setQuality (const Vector< Int > &whichQuality) |
Set a new vector of Quality values (a vector of Quality::QualityType) More... | |
virtual Vector< String > | worldAxisNames () const |
Report the value of the requested attribute. More... | |
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. More... | |
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. More... | |
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). More... | |
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. More... | |
virtual Bool | near (const Coordinate &other, Double tol=1e-6) const |
Comparison function. More... | |
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. More... | |
virtual Coordinate * | clone () const |
Make a copy of the QualityCoordinate using new. More... | |
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. More... | |
Public Member Functions inherited from casacore::Coordinate | |
virtual | ~Coordinate () |
Destructor. More... | |
virtual Bool | toMix (Vector< Double > &worldOut, Vector< Double > &pixelOut, const Vector< Double > &worldIn, const Vector< Double > &pixelIn, const Vector< Bool > &worldAxes, const Vector< Bool > &pixelAxes, const Vector< Double > &worldMin, const Vector< Double > &worldMax) const |
Mixed absolute pixel/world coordinate conversion. More... | |
Vector< Double > | worldMixMin () const |
Vector< Double > | worldMixMax () const |
virtual Bool | toWorldMany (Matrix< Double > &world, const Matrix< Double > &pixel, Vector< Bool > &failures) const |
Batch up a lot of transformations. More... | |
virtual Bool | toPixelMany (Matrix< Double > &pixel, const Matrix< Double > &world, Vector< Bool > &failures) const |
virtual void | makeWorldAbsoluteRef (Vector< Double > &world, const Vector< Double > &refVal) const |
Make absolute coordinates relative and vice versa with respect to the given reference value. More... | |
virtual void | makePixelRelativeMany (Matrix< Double > &pixel) const |
Batch up a lot of absolute/relative transformations. More... | |
virtual void | makePixelAbsoluteMany (Matrix< Double > &pixel) const |
virtual void | makeWorldRelativeMany (Matrix< Double > &world) const |
virtual void | makeWorldAbsoluteMany (Matrix< Double > &world) const |
virtual Coordinate * | makeFourierCoordinate (const Vector< Bool > &axes, const Vector< Int > &shape) const |
Find the Coordinate for when we Fourier Transform ourselves. More... | |
const String & | errorMessage () const |
If the last conversion to world or pixel coordinates resulted in an error, report that error. More... | |
virtual void | getPrecision (Int &precision, Coordinate::formatType &format, Bool showAsAbsolute, Int defPrecScientific, Int defPrecFixed, Int defPrecTime) const |
Provide a common interface to getting formatted representations of coordinate values. More... | |
String | formatQuantity (String &units, Coordinate::formatType format, const Quantum< Double > &worldValue, uInt axis, Bool isAbsolute=True, Bool showAsAbsolute=True, Int precision=-1) |
virtual Coordinate * | rotate (const Quantum< Double > &angle) const |
return the result of rotating the coordinate clockwise through the specified angle. More... | |
Static Public Member Functions | |
static Double | toWorld (Quality::QualityTypes quality) |
Interconvert between world stored as a Double and world stored as a Quality type. More... | |
static Quality::QualityTypes | toWorld (Double world) |
static QualityCoordinate * | restore (const RecordInterface &container, const String &fieldName) |
Recover the QualityCoordinate from a record. More... | |
Static Public Member Functions inherited from casacore::Coordinate | |
static String | typeToString (Coordinate::Type type) |
static void | set_wcs (::wcsprm &wcs) |
Call wcsset on the wcs structure. More... | |
static void | init_wcs (::wcsprm &wcs, int naxis) |
Call wcsini on the wcs structure. More... | |
static void | sub_wcs (const ::wcsprm &src, int &nsub, int axes[],::wcsprm &dst) |
Call wcssub on the src/dst pair. More... | |
static void | copy_wcs (const ::wcsprm &src,::wcsprm &dst) |
Call wcssub on the src/dst pair with null nsub/axes. More... | |
Private Member Functions | |
Bool | toWorld (Double &world, const Double pixel) const |
Bool | toPixel (Double &pixel, const Double world) const |
QualityCoordinate () | |
Undefined and inaccessible. More... | |
Private Attributes | |
Block< Int > | values_p |
Double | crval_p |
Keep these for subimaging purposes. More... | |
Double | crpix_p |
Double | matrix_p |
Double | cdelt_p |
String | name_p |
String | unit_p |
Int | nValues_p |
Additional Inherited Members | |
Public Types inherited from casacore::Coordinate | |
enum | Type { LINEAR, DIRECTION, SPECTRAL, STOKES, TABULAR, QUALITY, COORDSYS } |
This enum lists the types of the derived classes. More... | |
enum | formatType { DEFAULT, SCIENTIFIC, FIXED, MIXED, TIME } |
This enum is used for formatting world values into Strings. More... | |
Protected Member Functions inherited from casacore::Coordinate | |
Coordinate () | |
Default constructor. More... | |
Coordinate (const Coordinate &other) | |
Copy constructor (copy semantics) More... | |
Coordinate & | operator= (const Coordinate &other) |
Assignment (copy semantics) More... | |
void | set_error (const String &errorMsg) const |
Set error message. More... | |
Bool | find_scale_factor (String &error, Vector< Double > &factor, const Vector< String > &units, const Vector< String > &oldUnits) |
void | fourierUnits (String &nameOut, String &unitOut, String &unitInCanon, Coordinate::Type type, Int axis, const String &unitIn, const String &nameIn) const |
Tries to find a canonical unit for input unit (e.g. More... | |
Bool | toWorldWCS (Vector< Double > &world, const Vector< Double > &pixel, wcsprm &wcs) const |
Functions to interconvert pixel<->world via wcs. More... | |
Bool | toPixelWCS (Vector< Double > &pixel, const Vector< Double > &world, wcsprm &wcs) const |
Bool | toWorldManyWCS (Matrix< Double > &world, const Matrix< Double > &pixel, Vector< Bool > &failures, wcsprm &wcs) const |
Bool | toPixelManyWCS (Matrix< Double > &pixel, const Matrix< Double > &world, Vector< Bool > &failures, wcsprm &wcs) const |
void | toCurrentMany (Matrix< Double > &world, const Vector< Double > &toCurrentFactors) const |
Functions for handling conversion between the current units and the wcs units. More... | |
void | fromCurrentMany (Matrix< Double > &world, const Vector< Double > &toCurrentFactors) const |
virtual void | convertTo (Vector< Double > &) const |
Functions for handling conversion between the current reference frame and the native one. More... | |
virtual void | convertFrom (Vector< Double > &) const |
void | convertToMany (Matrix< Double > &world) const |
Functions for handling conversion between the current reference frame and the native one for many conversions. More... | |
void | convertFromMany (Matrix< Double > &world) const |
void | pcToXform (Matrix< Double > &xForm, const wcsprm &wcs) const |
Interconvert between wcs PC cards and Matrix xForm format. More... | |
void | xFormToPC (wcsprm &wcs, const Matrix< Double > &xForm) const |
Protected Attributes inherited from casacore::Coordinate | |
Vector< Double > | worldMin_p |
toMix ranges. More... | |
Vector< Double > | worldMax_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'
Definition at line 79 of file QualityCoordinate.h.
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.
casacore::QualityCoordinate::QualityCoordinate | ( | const QualityCoordinate & | other | ) |
Copy constructor (copy semantics)
|
virtual |
Destructor.
|
private |
Undefined and inaccessible.
|
virtual |
Make a copy of the QualityCoordinate using new.
The caller is responsible for calling delete.
Implements casacore::Coordinate.
|
virtual |
Comparison only made for specified axes in this and other Coordinate.
Reimplemented from casacore::Coordinate.
|
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 casacore::Coordinate.
Implements casacore::Coordinate.
Implements casacore::Coordinate.
|
virtual |
Reimplemented from casacore::Coordinate.
|
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 casacore::Coordinate.
|
virtual |
Reimplemented from casacore::Coordinate.
|
virtual |
Reimplemented from casacore::Coordinate.
|
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 casacore::Coordinate.
|
virtual |
Implements casacore::Coordinate.
|
virtual |
Always returns 1.
Implements casacore::Coordinate.
|
virtual |
Implements casacore::Coordinate.
QualityCoordinate& casacore::QualityCoordinate::operator= | ( | const QualityCoordinate & | other | ) |
Assignment (copy semantics)
Get the Quality values (Quality::QualityType) that we constructed with into a vector.
Implements casacore::Coordinate.
Implements casacore::Coordinate.
|
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 |
Save the QualityCoordinate into the supplied record using the supplied field name.
The field must not exist, otherwise False
is returned.
Implements casacore::Coordinate.
|
virtual |
Reimplemented from casacore::Coordinate.
Implements casacore::Coordinate.
|
virtual |
Implements casacore::Coordinate.
Set a new vector of Quality values (a vector of Quality::QualityType)
|
virtual |
Implements casacore::Coordinate.
|
virtual |
Implements casacore::Coordinate.
|
virtual |
Set the value of the requested attribute.
For the QualityCoordinate, these have no effect (always return True) except for setWorldAxisNames.
Implements casacore::Coordinate.
|
virtual |
The set function has no effect as the units must be empty for a QualityCoordinate Always returns True.
Implements casacore::Coordinate.
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 casacore::Coordinate.
|
virtual |
Always returns the String "Quality".
Implements casacore::Coordinate.
|
virtual |
Implements casacore::Coordinate.
Bool casacore::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.
|
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. The Bool parameter in toWorld() is ignored as this coordinate does not support a conversion layer frame.
Implements casacore::Coordinate.
Bool casacore::QualityCoordinate::toWorld | ( | Quality::QualityTypes & | quality, |
Int | pixel | ||
) | const |
|
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 |
|
virtual |
Returns Coordinates::QUALITY.
Implements casacore::Coordinate.
Report the value of the requested attribute.
Implements casacore::Coordinate.
Implements casacore::Coordinate.
|
private |
Definition at line 257 of file QualityCoordinate.h.
|
private |
Definition at line 257 of file QualityCoordinate.h.
|
private |
Keep these for subimaging purposes.
Definition at line 257 of file QualityCoordinate.h.
|
private |
Definition at line 257 of file QualityCoordinate.h.
|
private |
Definition at line 258 of file QualityCoordinate.h.
|
private |
Definition at line 260 of file QualityCoordinate.h.
|
private |
Definition at line 259 of file QualityCoordinate.h.
Definition at line 254 of file QualityCoordinate.h.