astropy/astropy — pull request #2620 by eteq (2014-06-12 20:01:37+00:00)
Title: Fix sky coord init nodata

DO NOT MERGE UNTIL #2586 IS IN

This closes #2613 by simply adding a check to make sure a `SkyCoord` has data after all the initialization steps are done.

It also fixes some quirks I noticed in how exceptions are handled for the case where a frame has no data. The basic problem was that the `data` property was raising an `AttributeError` that wouldn't be recognized in `__getattr__`. This sidesteps it by changing the relevant exception to a `ValueError` so that the user will again see a more helpful message that the frame has no data.

This is built from #2586 because otherwise there'd be conflicting changes. So once #2586 is in, I'll rebase and this can be merged. But in the meantime, just look at the last two commits to see what this actually does.

cc @taldcroft