Coverage for python/lsst/meas/extensions/astrometryNet/astrometryNetDataConfig.py : 72%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
''' We used to have AstrometryNetDataConfig() use the pex_config mechanism, but we need nested lists, so we do this home-brew version instead. '''
''' Checks the validity of a magnitude column map in AstrometryNetDataConfig. ''' raise RuntimeError('Mag maps must be dicts') raise RuntimeError('Mag maps must be dicts mapping str->str: got bad key \"%s\"' % str(k)) raise RuntimeError('Mag maps must be dicts mapping str->str: got bad value \"%s\"' % str(v)) raise RuntimeError('Mag maps items must be non-empty: got bad values \"%s\" -> \"%s\"' % (str(k), str(v)))
''' Checks the validity of an index list in AstrometryNetDataConfig. ''' raise RuntimeError('indexList config item must be a list') raise RuntimeError('indexList config items must be strings: got bad one \"%s\"' % (str(k),)) raise RuntimeError('indexList config items must be non-empty strings')
''' Checks the validity of a multi_index list in AstrometryNetDataConfig. ''' raise RuntimeError('multiIndexList config item must be a list') raise RuntimeError('multiIndexList config items must be lists: got bad one \"%s\"' % (str(k),)) raise RuntimeError('multiIndexList config items must be non-empty lists') raise RuntimeError('multiIndexList config items must be strings: got bad one \"%s\"' % (str(kk),)) raise RuntimeError('multiIndexList config items must be non-empty strings')
''' Astrometry.net data config object. This is a plain-python config structure similar to pexConfig.
For examples of use, see tests/astrometry_net_data/photocal/andConfig*.py
''' ('idColumn', str, 'id', None, 'Column name (in the index files) of the ID number of reference sources'), ('defaultMagColumn', str, 'mag', None, 'Default column name (in the index files) of the reference source mag'), ('defaultMagErrorColumn', str, '', None, 'Default column name (in the index files) of the reference source mag error'), ('starGalaxyColumn', str, None, None, 'Column name of the star/galaxy flag'), ('variableColumn', str, None, None, 'Column name of the star variability flag'), ('magErrorColumnMap', dict, {}, _checkMagMap, 'Mapping from LSST filter name to mag error column name'), ('magColumnMap', dict, {}, _checkMagMap, 'Mapping from LSST filter name to mag column name'), ('indexFiles', list, [], _checkIndexList, 'List of Astrometry.net index filenames'), ('multiIndexFiles', list, [], _checkMultiIndexList, 'Astrometry.net multi-index filename lists. ' 'Each item in this list must itself be a list of filenames. ' 'The first filename is the file that contains the star kd-tree and tag-along tables. ' 'Subsequent filenames must be files containing just the non-star index parts ' '(quads and code kd-tree). Note that this means you may need to repeat the first filename ' 'if it contains a star kd-tree and the first index.'), ('allowCache', bool, True, None, 'Allow use of cache for reading index file regions?'), ]
# Hold on to your socks!
self.set(k, v)
raise RuntimeError(('Attempted to set AstrometryNetDataConfig' ' field \"%s\" to type %s, but need type %s') % (nm, str(typ), str(type(v)))) # Looks ok; set it!
raise RuntimeError('Attempted to set invalid AstrometryNetDataConfig' ' field \"%s\"' % k) |