gavo.protocols.siap module

Support code for the Simple Image Access Protocol.

class gavo.protocols.siap.SIAPCutoutCore(parent, **kwargs)[source]

Bases: DBCore

A core doing SIAP plus cutouts.

It has, by default, an additional column specifying the desired size of the image to be retrieved. Based on this, the cutout core will tweak its output table such that references to cutout images will be retrieved.

The actual process of cutting out is performed by the product core and renderer.

attrSeq = [<gavo.base.complexattrs.StructListAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.rscdef.common.NamePathAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.base.parsecontext.ReferenceAttribute object>, <gavo.rscdef.common.RDAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>]
clearProperty(name)
completedCallbacks = []
copiedCols = ['centerAlpha', 'centerDelta', 'imageTitle', 'instId', 'dateObs', 'nAxes', 'pixelSize', 'pixelScale', 'mime', 'refFrame', 'wcs_equinox', 'wcs_projection', 'wcs_refPixel', 'wcs_refValues', 'wcs_cdmatrix', 'bandpassId', 'bandpassUnit', 'bandpassHi', 'bandpassLo', 'pixflags']
getFullId()
getProperty(name, default=<Undefined>)
getQueryCols(service, queryMeta)[source]

returns the fields we need in the output table.

The normal DbBased core just returns whatever the service wants. Derived cores, e.g., for special protocols, could override this to make sure they have some fields in the result they depend on.

hasProperty(name)
managedAttrs = {'condDesc': <gavo.base.complexattrs.StructListAttribute object>, 'condDescs': <gavo.base.complexattrs.StructListAttribute object>, 'distinct': <gavo.base.attrdef.BooleanAttribute object>, 'groupBy': <gavo.base.attrdef.UnicodeAttribute object>, 'id': <gavo.base.parsecontext.IdAttribute object>, 'inputTable': <gavo.base.complexattrs.StructAttribute object>, 'limit': <gavo.base.attrdef.IntAttribute object>, 'namePath': <gavo.rscdef.common.NamePathAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'outputTable': <gavo.base.complexattrs.StructAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'queriedTable': <gavo.base.parsecontext.ReferenceAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>, 'sortKey': <gavo.base.attrdef.UnicodeAttribute object>}
name_ = 'siapCutoutCore'
property rd
resolveName(context, id)
run(service, inputData, queryMeta)[source]

does the DB query and returns an InMemoryTable containing the result.

setProperty(name, value)
gavo.protocols.siap.dissectPositions(posStr)[source]

tries to infer RA and DEC from posStr.

In contrast to base.parseCooPair, we are quite strict here and just try to cope with some bad clients that leave out the comma.

gavo.protocols.siap.getPGSQuery(intersect, ra, dec, sizes, prefix, sqlPars)[source]

returns SQL for a SIAP query on pgsSIAP tables.

gavo.protocols.siap.getQuery(queriedTable, parameters, sqlPars, prefix='sia')[source]

returns an SQL fragment for a SIAP query for bboxes.

The SQL is returned as a WHERE-fragment in a string. The parameters are added in the sqlPars dictionary.

parameters is a dictionary that maps the SIAP keywords to the values in the query. Parameters not defined by SIAP are ignored.

gavo.protocols.siap.parseSIAP2Geometry(aString, fieldName='POS')[source]

parses a SIAPv2 geometry spec to a pgsphere object.

Parse errors raise validation errors for fieldName.