astropy/astropy — pull request #519 by astrofrog (2012-12-02 10:58:54+00:00)
Title: Make WCS accept any dict-like object

@mdboom - this is a suggested fix for #345 - however, I'm having issues, because of the following error:

```
In [1]: from astropy.wcs import WCS

In [2]: wcs = WCS({'CTYPE1':'GLON-CAR', 'CTYPE2':'GLAT-CAR'})
ERROR: ValueError: key must be ' ' or 'A'-'Z' [astropy.wcs.wcs]
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
----> 1 wcs = WCS({'CTYPE1':'GLON-CAR', 'CTYPE2':'GLAT-CAR'})

/Users/tom/Library/Python/2.7/lib/python/site-packages/astropy/wcs/wcs.pyc in __init__(self, header, fobj, key, minerr, relax, naxis, keysel, colsel, fix)
307 wcsprm = _wcs.Wcsprm(header=header_bytes, key=key,
308 relax=relax, keysel=keysel_flags,
--> 309 colsel=colsel)
310 except _wcs.NoWcsKeywordsFoundError:
311 # The header may have SIP or distortions, but no core

ValueError: key must be ' ' or 'A'-'Z'
```

The dict is not a valid full WCS header, but the error is a little unclear. Why is this being raised?

I did not attach this code to #345 in case you want to implement a better fix.