gavo.stc.tapstc module

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.

class gavo.stc.tapstc.GeomExpr(frame, operator, operands)[source]

Bases: object

a sentinel object to be processed by morphers.

asLogic(template)[source]
flatten()[source]
gavo.stc.tapstc.getPGSphereTrafo(fromSys, toSys)[source]

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.

gavo.stc.tapstc.getSTCForTAP(tapIdentifier)[source]

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).

gavo.stc.tapstc.getSimpleSTCSParser()[source]
gavo.stc.tapstc.getTAPSTC(stcInstance)[source]

returns a tap system identifier for an STC AstroSystem.

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

gavo.stc.tapstc.parseSimpleSTCS(s)
gavo.stc.tapstc.simpleSTCSToPolygon(stcsExpr)[source]

returns an spoly for an STC-S region specification.

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