casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casa::DefaultWCCoordinateHandler Class Reference

Class to provide default coordinate handling for WorldCanvases. More...

#include <DefaultWCCoordinateHandler.h>

Inheritance diagram for casa::DefaultWCCoordinateHandler:
casa::WCCoordinateHandler

Public Member Functions

 DefaultWCCoordinateHandler ()
 Default Constructor Required. More...
 
virtual casacore::Bool linToWorld (casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)
 just copy lin to world and vice versa. More...
 
virtual casacore::Bool linToWorld (casacore::Matrix< casacore::Double > &world, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &lin)
 Batch transformation where each row of lin is a coordinate that is transformed into each row of world. More...
 
virtual casacore::Bool worldToLin (casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)
 transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning false if the coordinate could not be transformed. More...
 
virtual casacore::Bool worldToLin (casacore::Matrix< casacore::Double > &lin, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &world)
 Batch transformation where each row of world is a coordinate that is transformed into each row of lin. More...
 
virtual casacore::uInt nWorldAxes () const
 return the number of world axes. More...
 
virtual casacore::Vector
< casacore::String
worldAxisNames () const
 Routines that give the axes names and the units. More...
 
virtual casacore::Vector
< casacore::String
worldAxisUnits () const
 
std::string errorMessage () const
 
virtual ~DefaultWCCoordinateHandler ()
 Destructor. More...
 
- Public Member Functions inherited from casa::WCCoordinateHandler
 WCCoordinateHandler ()
 Default Constructor Required. More...
 
virtual ~WCCoordinateHandler ()
 Routines that give the axes names and the unit. More...
 

Detailed Description

Class to provide default coordinate handling for WorldCanvases.

Prerequisite

Etymology

DefaultWCCoordinateHandler stands for Default WorldCanvas casacore::Coordinate Handler

Synopsis

Implements identity transformation function pairs between World Coordinates and linear coordinates. It assumes 2 axes only.

Motivation

Recognized that 95% of the time the WorldCanvas will be used in conjunction with a world coordinate system of some kind. So it makes more sense to assume that there is always a coordinate handler available and use it rather than to have to check to see if there is a handler registered with the WorldCanvas or not each time you have to do a transformation.

The WorldCanvas creates this default handler for its own purpose.

Definition at line 66 of file DefaultWCCoordinateHandler.h.

Constructor & Destructor Documentation

casa::DefaultWCCoordinateHandler::DefaultWCCoordinateHandler ( )

Default Constructor Required.

virtual casa::DefaultWCCoordinateHandler::~DefaultWCCoordinateHandler ( )
virtual

Destructor.

Member Function Documentation

std::string casa::DefaultWCCoordinateHandler::errorMessage ( ) const
inlinevirtual

Implements casa::WCCoordinateHandler.

Definition at line 98 of file DefaultWCCoordinateHandler.h.

virtual casacore::Bool casa::DefaultWCCoordinateHandler::linToWorld ( casacore::Vector< casacore::Double > &  world,
const casacore::Vector< casacore::Double > &  lin 
)
virtual

just copy lin to world and vice versa.

The input vectors must be of length 2. The output vectors are resized as needed. The output matrices must be the correct shape on input.

Implements casa::WCCoordinateHandler.

virtual casacore::Bool casa::DefaultWCCoordinateHandler::linToWorld ( casacore::Matrix< casacore::Double > &  world,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  lin 
)
virtual

Batch transformation where each row of lin is a coordinate that is transformed into each row of world.

On input, if the i'th position in the failures vector is true, the i'th transformation is not attempted. If the j'th transformation fails, the j'th position in the failures vector will be set. The return value is true only when the failures vector has no position set to true; This function is implemented in this base class by making repeated calls to the casacore::Vector<casacore::Double> version of linToWorld.

Reimplemented from casa::WCCoordinateHandler.

virtual casacore::uInt casa::DefaultWCCoordinateHandler::nWorldAxes ( ) const
inlinevirtual

return the number of world axes.

Always 2.

Implements casa::WCCoordinateHandler.

Definition at line 88 of file DefaultWCCoordinateHandler.h.

virtual casacore::Vector<casacore::String> casa::DefaultWCCoordinateHandler::worldAxisNames ( ) const
virtual

Routines that give the axes names and the units.

Both return "Pixel".

virtual casacore::Vector<casacore::String> casa::DefaultWCCoordinateHandler::worldAxisUnits ( ) const
virtual
virtual casacore::Bool casa::DefaultWCCoordinateHandler::worldToLin ( casacore::Vector< casacore::Double > &  lin,
const casacore::Vector< casacore::Double > &  world 
)
virtual

transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning false if the coordinate could not be transformed.

Derived classes should override.

Implements casa::WCCoordinateHandler.

virtual casacore::Bool casa::DefaultWCCoordinateHandler::worldToLin ( casacore::Matrix< casacore::Double > &  lin,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  world 
)
virtual

Batch transformation where each row of world is a coordinate that is transformed into each row of lin.

On input, if the i'th position in the failures vector is true, the i'th transformation is not attempted. If the j'th transformation fails, the j'th position in the failures vector will be set. The return value is true only when the failures vector has no position set to true; This function is implemented in this base class by making repeated calls to the casacore::Vector<casacore::Double> version of worldToLin.

Reimplemented from casa::WCCoordinateHandler.


The documentation for this class was generated from the following file: