gavo.user.mkrd module¶
Creation of resource descriptors
The first part of this is an early experiment to automatically create resource descriptors from structured data representations.
While parts of this may be recoverable for smarter gavo start functionality, doing this so that the result is actually useful is hard.
Instead, the new gavo start functionality just fetches one of a few commented RD templates, fills out a thing or two and leaves the rest to the operator.
- class gavo.user.mkrd.MkrdMacroProcessor[source]¶
Bases:
MacroExpander
a macro expander for RD templates.
- class gavo.user.mkrd.TemplateMacroPackage[source]¶
Bases:
MacroPackage
Macros for RD templates.
- class gavo.user.mkrd.VizBBBParser[source]¶
Bases:
object
A simple and naive parser for VizieR Byte-by-Byte descriptions.
The results are available in the colAttrs and bytesForCols attributes.
- bbbLinePat = re.compile('\\s*(?P<from>\\d+)\\s*-\\s*(?P<to>\\d+)\\s+(?P<format>[A-Z0-9.]+)\\s+(?P<units>[^\\s]*)\\s+(?P<label>[^\\s]*)\\s+(?P<description>.*)')¶
- tableBorderPat = re.compile('--------+')¶
- gavo.user.mkrd.formatColumnElement(colAttrs)[source]¶
returns a column element XML literal for colAttrs in Markus’ preferred formatting.
- gavo.user.mkrd.getColumnXML(colAttrs)[source]¶
returns formatted XML for a sequence for column attributes.
colAttrs is a sequence of dicts with fillers into COLUMN_ELEMENT_TEMPLATES; the must already be escaped for use in XML attributes.
- gavo.user.mkrd.getTypeForFTFormat(format, name)[source]¶
returns a DaCHS type for FITS table column.
- gavo.user.mkrd.isIgnoredKeyword(kw)[source]¶
returns true if kw should not be translated or put into the table.
This is important for all WCS keywords when you want to compute SIAP bboxes; these keywords must not be translated.
- gavo.user.mkrd.iterColAttrsFITS(table)[source]¶
yields dicts of column attributes from a FITS binary table HDU.
- gavo.user.mkrd.iterColAttrsVOTable(inFile)[source]¶
tries to parse (binary) inFile as a VOTable and yields colAttrs dictionaries for all FIELDs in it.
- gavo.user.mkrd.iterColAttrsViz(inFile, dumpRanges=False)[source]¶
tries to parse (text) inFile as a VizieR-Style bytes-by-bytes description and yields colAttrs for the first described table.
dumpRanges is for interactive use, where the function additionally dumps a colDefs content to stdout.