Package gavo :: Package utils :: Module pgsphere :: Class PgSAdapter
[frames] | no frames]

Class PgSAdapter

source code

object --+
         |
        PgSAdapter
Known Subclasses:

A base class for objects adapting pgSphere objects.

The all need a pgType attribute and two static methods
_adaptToPgSphere(obj) and _castFromPgSphere(value, cursor).

You must also define a sequence checkedAttributes; all attributes
metioned there must be equal for two adapted values to be equal (equality
testing here really is mainly for unit tests with hand-crafted values).

Also, all subclasses you should provide an asPoly returning a spherical
polygon.  This is used when uploading VOTables with REGION columns.

In practice, you also want:

fromDALI(cls, daliSeq) -- a classmethod turning the DALI votable
  representation (typically, float arrays in degrees) into a corresponding
  object.
asDALI(self) -- the inverse of fromDALI
asSODA(self) -- returns a representation of the geometry as
  used in SODA parameters.

Instance Methods
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
asPoly(self) source code
 
asSODA(self)
returns the "SODA-form" for this circle.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  pgType = None
hash(x)
Properties

Inherited from object: __class__

Method Details

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

asSODA(self)

source code 

returns the "SODA-form" for this circle.

This is a string containing blank-separated float literals; the floats are what asDALI returns, and hence this is built on top of asDALI. We don't worry about the fact that the coordinates just *might* be non-ICRS.