gavo.grammars.fitsprodgrammar module

A grammar to parse from primary FITS headers.

This grammar will return exactly one row per source.

class gavo.grammars.fitsprodgrammar.FITSProdGrammar(parent, **kwargs)[source]

Bases: Grammar

A grammar that returns FITS-headers as dictionaries.

This is the grammar you want when one FITS file corresponds to one row in the destination table.

The keywords of the grammar record are the cards in the primary header (or some other hdu using the same-named attribute). “-” in keywords is replaced with an underscore for easier @-referencing. You can use a mapKeys element to effect further name cosmetics.

This grammar should handle compressed FITS images transparently if set qnd=”False”. This means that you will essentially get the headers from the second extension for those even if you left hdu=”0”.

The original header is preserved as the value of the header_ key. This is mainly intended for use WCS use, as in wcs.WCS(@header_).

If you have more complex structures in your FITS files, you can get access to the pyfits HDU using the hdusField attribute. With hdusField="_H", you could say things like @_H[1].data[10][0] to get the first data item in the tenth row in the second HDU.

attrSeq = [<gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.rscdef.common.RDAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.complexattrs.StructAttribute object>]
clearProperty(name)
completedCallbacks = []
getFullId()
getProperty(name, default=<Undefined>)
hasProperty(name)
managedAttrs = {'enc': <gavo.base.attrdef.UnicodeAttribute object>, 'hdu': <gavo.base.attrdef.IntAttribute object>, 'hdusField': <gavo.base.attrdef.UnicodeAttribute object>, 'id': <gavo.base.parsecontext.IdAttribute object>, 'ignoreOn': <gavo.base.complexattrs.StructAttribute object>, 'mapKeys': <gavo.base.complexattrs.StructAttribute object>, 'maxHeaderBlocks': <gavo.base.attrdef.IntAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'qnd': <gavo.base.attrdef.BooleanAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>, 'rowfilter': <gavo.base.complexattrs.StructListAttribute object>, 'rowfilters': <gavo.base.complexattrs.StructListAttribute object>, 'sourceFields': <gavo.base.complexattrs.StructAttribute object>}
name_ = 'fitsProdGrammar'
onElementComplete()[source]
property rd
rowIterator

alias of FITSProdIterator

setProperty(name, value)
class gavo.grammars.fitsprodgrammar.FITSProdIterator(grammar, sourceToken, sourceRow=None)[source]

Bases: RowIterator

getLocator()[source]