Package gavo :: Package user :: Module mkrd
[frames] | no frames]

Module mkrd

source code

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.

Classes
  TemplateMacroPackage
Macros for RD templates.
  MkrdMacroProcessor
a macro expander for RD templates.
Functions
 
isIgnoredKeyword(kw)
returns true if kw should not be translated or put into the table.
source code
 
structToETree(aStruct)
returns an ElementTree for the copyable content of aStruct.
source code
 
getTypeForFTColumn(fitsCol)
returns a DaCHS type for FITS table column.
source code
 
makeTableFromFT(rd, srcName, opts) source code
 
makeDataForFT(rd, srcName, opts) source code
 
makeTableFromFITS(rd, srcName, opts) source code
 
makeDataForFITS(rd, srcName, opts) source code
 
makeTableFromVOTable(rd, srcName, opts) source code
 
makeDataForVOTable(rd, srcName, opts) source code
 
makeRD(args, opts) source code
 
indent(elem, level=0) source code
 
writePrettyPrintedXML(root) source code
 
parseCommandLine() source code
 
main() source code
 
parseNewCommandLine() source code
 
start() source code
Variables
  ignoredFITSHeaders = set(['BITPIX', 'BSCALE', 'BZERO', 'COMMEN...
  wcsKey = re.compile(r'CD.*|CRVAL.*|CDELT.*|NAXIS.*|CRPIX.*|CTY...
  FT_TYPE_MAP = {'A': 'text', 'B': 'bytea', 'D': 'double precisi...
  tableMakers = {'FITS': <__builtin__.function object>, 'FT': <_...
  dataMakers = {'FITS': <__builtin__.function object>, 'FT': <__...
  __package__ = 'gavo.user'
Function Details

isIgnoredKeyword(kw)

source code 

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.

structToETree(aStruct)

source code 

returns an ElementTree for the copyable content of aStruct.

Note that due to manipulations at parse time and non-copyable content, this will, in general, not reproduce the original XML trees.

getTypeForFTColumn(fitsCol)

source code 

returns a DaCHS type for FITS table column.

This currently ignores array sizes and such. Well, people can always fix things manually.


Variables Details

ignoredFITSHeaders

Value:
set(['BITPIX',
     'BSCALE',
     'BZERO',
     'COMMENT',
     'DATAMAX',
     'DATAMIN',
     'EXTEND',
     'HISTORY',
...

wcsKey

Value:
re.compile(r'CD.*|CRVAL.*|CDELT.*|NAXIS.*|CRPIX.*|CTYPE.*|CUNIT.*|CROT\
A.*|RADECSYS|AP?_\d_\d|BP?_\d_\d|LATPOLE|LONPOLE')

FT_TYPE_MAP

Value:
{'A': 'text',
 'B': 'bytea',
 'D': 'double precision',
 'E': 'real',
 'I': 'smallint',
 'J': 'integer',
 'K': 'bigint'}

tableMakers

Value:
{'FITS': <__builtin__.function object>,
 'FT': <__builtin__.function object>,
 'VOT': <__builtin__.function object>}

dataMakers

Value:
{'FITS': <__builtin__.function object>,
 'FT': <__builtin__.function object>,
 'VOT': <__builtin__.function object>}