astropy/astropy — pull request #556 by adrn (2012-12-12 16:05:45+00:00)
Title: Get a Coordinates object from an astronomical name

I threw this together in ~20 minutes, but I thought it'd be killer to have a feature that would let us get a Coordinates object from an astronomical name without any extra work. Right now, this looks like:

import astropy.coordinates as coord
m42_coords = coord.ICRSCoordinates.from_name("M42")
m42_gal_coords = coord.GalacticCoordinates.from_name("M42")

It just does a query to `Sesame`, and parses the returned text (see: http://cdsweb.u-strasbg.fr/doc/sesame.htx). The service lets you specify a database to search, e.g. SIMBAD, NED, Vizier, or all, so you can specify that like:

castor_coords = coord.ICRSCoordinates.from_name("castor", databse="simbad")

but the default is to just search all.

Anyway, it's a pretty dumb-simple implementation so if anyone has ideas, let me know.