Package gavo :: Package stc :: Module dm :: Class _Coordinate
[hide private]
[frames] | no frames]

Class _Coordinate

source code

             object --+            
                      |            
utils.autonode.AutoNode --+        
                          |        
             common.ASTNode --+    
                              |    
                _CoordinateLike --+
                                  |
                                 _Coordinate
Known Subclasses:

An abstract base for coordinates.

They have an iterTransformed(convFunc) method iterating over constructor keys that have to be changed when some convFunc is applied to the coordinate. These may be multiple values when, e.g., errors are given or for geometries.

Since these only make sense together with units, some elementary unit handling is required. Since we keep the basic unit model of STC, this is a bit over-complicated.

First, for the benefit of STC-S, a method getUnitString() -> string or None is required. It should return an STC-S-legal unit string.

Second, a method getUnitArgs() -> dict or None is required. It has to return a dictionary with all unit-related constructor arguments (that's unit and velTimeUnit for the standard coordinate types). No None values are allowed; if self's units are not defined, return None.

Third, a method getUnitConverter(otherUnits) -> function or None is required. OtherUnits can be a tuple or a result of getUnitArgs. The tuple is interpreted as (baseUnit, timeUnit). The function returned must accept self's coordinate values in otherUnit and return them in self's unit(s). This is the function that iterTransformed requires.

Nested Classes [hide private]

Inherited from utils.autonode.AutoNode: __metaclass__

Instance Methods [hide private]
 
_setupNode(self) source code
 
iterTransformed(self, converter) source code
 
__init__(self, error=None, frame=None, id=None, name=None, pixSize=None, resolution=None, size=None, ucd=None, value=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code

Inherited from _CoordinateLike: getPosition

Inherited from common.ASTNode: __eq__, __hash__, __ne__, ensureId

Inherited from utils.autonode.AutoNode: __repr__, change, iterAttributes, iterChildren, iterNodeChildren, iterNodes

Inherited from utils.autonode.AutoNode (private): _setupNodeNext

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Methods [hide private]

Inherited from utils.autonode.AutoNode: cloneFrom

Class Variables [hide private]
  _a_error = None
  _a_resolution = None
  _a_pixSize = None
  _a_value = None
  _a_size = None
  _dimensionedAttrs = ['error', 'resolution', 'pixSize', 'size']
  inexactAttrs = set(['value'])
  _nodeAttrs = [('error', None), ('frame', None), ('id', None), ...

Inherited from _CoordinateLike (private): _a_frame, _a_name

Inherited from common.ASTNode (private): _a_id, _a_ucd

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_setupNode(self)

source code 
Overrides: utils.autonode.AutoNode._setupNode

__init__(self, error=None, frame=None, id=None, name=None, pixSize=None, resolution=None, size=None, ucd=None, value=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

_nodeAttrs

Value:
[('error', None),
 ('frame', None),
 ('id', None),
 ('name', None),
 ('pixSize', None),
 ('resolution', None),
 ('size', None),
 ('ucd', None),
...