radio-astro-tools/spectral-cube — pull request #140 by keflavich (2014-09-02 19:02:39+00:00)
Title: Quicklook: Do something (not something smart) if there are unmatched celestial axes

Plotting a PV diagram resulted in this traceback:
```
>>> sl.quicklook()
Traceback (most recent call last):
File "", line 1, in
sl.quicklook()
File "/Users/adam/repos/spectral-cube/spectral_cube/spectral_cube.py", line 152, in quicklook
self.FITSFigure = aplpy.FITSFigure(self.hdu)
File "/Users/adam/repos/spectral-cube/spectral_cube/spectral_cube.py", line 120, in hdu
hdu = fits.PrimaryHDU(self.value, header=self.wcs.to_header())
File "/Users/adam/repos/astropy/astropy/wcs/wcs.py", line 2379, in to_header
header_string = self.wcs.to_header(relax)
InconsistentAxisTypesError: ERROR 4 in wcs_types() at line 2136 of file cextern/wcslib/C/wcs.c:
Unmatched celestial axes.
```
so instead let's use `imshow` for now.

This is an outstanding bug, though - there needs to be a sensible way to plot a celestial axis. In this particular case, we need smarter slicing: the axis needs to be marked as a celestial axis that doesn't need a partner. In the more general case, we just need the pixel scale and should revert to the `OFFSET` WCS type used in pvextractor.