Source code for

Support for the IVOA Space-Time-Coordinate data model.

We're dealing with a huge data model here that probably can't be
fully implemented in any sense of the word.

So, we have a stripped down data model in the form of an abstract syntax
tree here (defined in the dm submodule).  This can be built directly or
from various input formats (XXXast submodules).  From the AST, you can
also build various output formats (XXXgen submodules).

All other operations should be performed on the AST.

Note that this is slow as a dog.  I doubt we'll ever see performant STC
implementations.  This is really intended for one-shot transformations,
e.g. into functions or a query language.  Don't do any transformations
in serious loops.

#c Copyright 2008-2023, the GAVO project <>
#c This program is free software, covered by the GNU GPL.  See the
#c COPYING file in the source distribution.

# Not checked by pyflakes: API file with gratuitous imports

import sys

from import (STCError, STCSParseError, STCLiteralError,
	STCValueError, STCNotImplementedError, STCUnitError,
	STCNamespace, stcSpaceRefFrames, stcRefPositions, ColRef)

from import (parseISODT,
	jYearToDateTime, dateTimeToJYear,
	bYearToDateTime, dateTimeToBYear,
	jdnToDateTime, dateTimeToJdn,
	mjdToDateTime, dateTimeToMJD,

from import conform as conformTo, getSimple2Converter

from import fromPgSphere

from import EquivalencePolicy, defaultPolicy

from import parseSTCS, parseQSTCS

from import getSTCS, getSpatialSystem

from import STC

from import parseSTCX, parseFromETree

from import astToStan, getSTCXProfile, nodeToStan

from import getLibrarySystem

from import (TAP_SYSTEMS, getTAPSTC, getSimpleSTCSParser,
	parseSimpleSTCS, simpleSTCSToPolygon, getPGSphereTrafo)

from import getUtypes

from import parseFromUtypes

[docs]def getSTCX(ast, rootElement): return astToStan(ast, rootElement)