astropy/astropy — pull request #1296 by keflavich (2013-07-28 14:18:21+00:00)
Title: `.format` shortcut for coordinates

I frequently need coordinates in HMS/DMS. While the `Angle` class has a wrapper to format a single angle as hms or dms, the Coordinate objects (e.g., `ICRSCoordinate`) do not. This PR implements one.

Example:
```
>>> from astropy import coordinates as coords
>>> w=coords.ICRSCoordinates.from_name('W51')
>>> print w.format(sep=':')
19:23:42.00000 14:30:33.01200
>>> print w.format()
19h23m42.00000s 14d30m33.01200s
```