gavo.protocols.simbadinterface module

A caching proxy for CDS’ Simbad object resolver.

class gavo.protocols.simbadinterface.ObjectCache[source]

Bases: object

a cache for simbad queries kept in dc.metastore.

This used to be file-based, and used different keys for different purposes. The different keys didn’t seem to be useful, so they’re ignored now.

This only caches positive responses; there’s too much that can go wrong when caching negatives, and the expectation is that negatives are so varying that there’s little to win anyway.

The values passed in are json-encoded (for simbad, these are dictionaries).

addItem(key, value)[source]

adds an item to the cache.

value is json-encoded before writing it.

getItem(key)[source]

returns a previously stored object of key.

This raises a KeyError if nothing has been stored before.

class gavo.protocols.simbadinterface.Sesame[source]

Bases: object

is a simple interface to the simbad name resolver.

getPositionFor(identifier)[source]
query(ident)[source]
svc_urls = ['http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame/-ox/SN?', 'http://vizier.cfa.harvard.edu/viz-bin/nph-sesame/-ox/SN?']
gavo.protocols.simbadinterface.getSimbadPositions(identifier)[source]

returns ra and dec from Simbad for identifier.

It raises a KeyError if Simbad doesn’t know identifier.