astropy/astropy — pull request #2107 by mdboom (2014-03-26 13:43:44+00:00)
Title: astropy.wcs failing to recognize invalid region in ZPN and HPX projections

In the following header:

```
NAXIS = 2
NAXIS1 = 200
NAXIS2 = 200
CTYPE1 = 'RA---ZPN'
CRPIX1 = 100
CDELT1 = -6.666666666667E-02
CRVAL1 = 0.000000000000E+00
CTYPE2 = 'DEC--ZPN'
CRPIX2 = 100
CDELT2 = 6.666666666667E-02
CRVAL2 = -9.000000000000E+01
LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole
LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole
PV2_0 = 10.000000000000E-02 / Projection parameter 0
PV2_1 = 9.750000000000E-01 / Projection parameter 1
```
much of the central part of the image should have no valid world coordinates (according to ds9 for example) but ``astropy.wcs`` does not seem to give ``np.nan`` as might be expected. For example, slightly off from the center:

```
In [18]: wcs.wcs_pix2world(110,110, 0)
Out[18]: [array(134.99999999999994), array(-85.18719178916112)]
```

whereas ds9 does not report any valid coordinates for that pixel position.

cc @mdboom