Package gavo :: Package stc :: Module tapstc
[frames] | no frames]

Module tapstc

source code

The subset of STC proposed by the TAP spec.

Use this rather than the full-blown STC library for TAP and friends. TAP's semi-sanitation of STC needs some special handling anyway, and this is much faster than the full-blown mess.

Classes
  GeomExpr
a sentinel object to be processed by morphers.
Functions
 
getPGSphereTrafo(fromSys, toSys)
returns a pgsphere expression fragment to turn a pgsphere geometry from fromSys to toSys.
source code
 
getTAPSTC(stcInstance)
returns a tap system identifier for an STC AstroSystem.
source code
 
getSTCForTAP(*args)
returns an stc AST for a tap reference system identifier.
source code
 
getSimpleSTCSParser(*args) source code
 
parseSimpleSTCS(s) source code
 
simpleSTCSToPolygon(stcsExpr)
returns an spoly for an STC-S region specification.
source code
Variables
  TAP_SYSTEMS = set(['', 'BROKEN', 'FK4', 'FK5', 'GALACTIC', 'IC...
  TAP_REFPOS = set(['BARYCENTER', 'GEOCENTER', 'HELIOCENTER', 'L...
  TAP_FLAVORS = set(['CARTESIAN2', 'CARTESIAN3', 'SPHERICAL2'])
  UNIVERSALLY_COMPATIBLE = set([None, '', 'BROKEN', 'RELOCATABLE...
  TRANSFORMS = {'FK4': (1.56518643337, -0.00485905528049, -1.576...
  __package__ = 'gavo.stc'
Function Details

getPGSphereTrafo(fromSys, toSys)

source code 

returns a pgsphere expression fragment to turn a pgsphere geometry from fromSys to toSys.

fromSys and toSys are system designations like for TAP.

If the systems are "compatible" (i.e., no transformation is deemed necessary), None is returned. An STCValueError is raised for incomprehensible system specifications.

getTAPSTC(stcInstance)

source code 

returns a tap system identifier for an STC AstroSystem.

This is stc.astroSystem.spaceFrame.refFrame if existing and TAP-defined, UNKNOWN otherwise.

getSTCForTAP(*args)

source code 

returns an stc AST for a tap reference system identifier.

The tapIdentifier is any string in which the first item is the reference system. Everything else is ignored (this is because it seems someone intended additional specs like "BARYCENTER" to be legal, although there really is nothing we can do about them).

Decorators:
  • @utils.memoized

getSimpleSTCSParser(*args)

source code 
Decorators:
  • @utils.memoized

simpleSTCSToPolygon(stcsExpr)

source code 

returns an spoly for an STC-S region specification.

This is used to let people upload VOTables with REGION items.


Variables Details

TAP_SYSTEMS

Value:
set(['',
     'BROKEN',
     'FK4',
     'FK5',
     'GALACTIC',
     'ICRS',
     'RELOCATABLE',
     'UNKNOWN',
...

TAP_REFPOS

Value:
set(['BARYCENTER',
     'GEOCENTER',
     'HELIOCENTER',
     'LSR',
     'RELOCATABLE',
     'TOPOCENTER',
     'UNKNOWNREFPOS'])

UNIVERSALLY_COMPATIBLE

Value:
set([None, '', 'BROKEN', 'RELOCATABLE', 'UNKNOWN'])

TRANSFORMS

Value:
{'FK4': (1.56518643337, -0.00485905528049, -1.57636810435),
 'FK5': None,
 'GALACTIC': (1.34635609744, -1.09731900184, 0.574770524729),
 'ICRS': None}