astropy/astropy — pull request #1912 by barentsen (2013-12-18 15:49:37+00:00)
Title: WCS.footprint_to_file() is broken

An exception is raised when executing WCS.footprint_to_file() for an arbitrary coordinate system. For example:

```Python
from astropy.wcs import WCS
mywcs = WCS({'CTYPE1': 'RA---ZPN', 'CTYPE2': 'DEC--ZPN',
'CRPIX1': -335, 'CRPIX2': 3042,
'CRVAL1': 237.9, 'CRVAL2': 32.9,
'CRUNIT1': 'deg', 'CRUNIT2': 'deg'})
mywcs.footprint_to_file('/tmp/tmp.ds9')
```
raises:

```Python
ERROR: AttributeError: 'WCS' object has no attribute 'footprint' [astropy.wcs.wcs]
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 mywcs.footprint_to_file('/tmp/tmp.ds9')

/home/gb/bin/anaconda/lib/python2.7/site-packages/astropy-0.4.dev6667-py2.7-linux-x86_64.egg/astropy/wcs/wcs.pyc in footprint_to_file(self, filename, color, width)
1669 f.write('linear\n')
1670 f.write('polygon(')
-> 1671 self.footprint.tofile(f, sep=',')
1672 f.write(') # color={0}, width={1:d} \n'.format(color, width))
1673 f.close()

AttributeError: 'WCS' object has no attribute 'footprint'
```

I cannot spot anywhere in WCS or WCSBase where `self.footprint` might be created and hence how it might be fixed. I wonder if this function has ever worked at all?