astrofrog/reproject — pull request #54 by astrofrog (2014-11-19 18:34:27+00:00)
Title: Funny values after reprojection

When setting up the following test case:

```
import reproject
import numpy as np
from astropy.io import fits

hdr = fits.Header()
hdr['NAXIS'] = 2
hdr['NAXIS1'] = 4
hdr['NAXIS2'] = 4
hdr['CTYPE1'] = 'RA---TAN'
hdr['CTYPE2'] = 'DEC--TAN'
hdr['CRPIX1'] = 2
hdr['CRPIX2'] = 2
hdr['CRVAL1'] = 90
hdr['CRVAL2'] = -20
hdr['CD1_1'] = 5.9E-05
hdr['CD2_1'] = 4.2E-08
hdr['CD1_2'] = -2.1E-08
hdr['CD2_2'] = 5.9E-05

data = np.ones((4, 4))
projected_data, footprint = reproject.reproject((data, hdr), hdr)
print "Projected data:\n", projected_data
print "\nFootprint:\n", footprint
```

I'd expect `projected_data` to be a 4x4 matrix of ~ones, but instead I see the following output:
```
Projected data:
[[ 1. nan nan nan]
[ 1. 1. 1. 1.]
[ 1. 1. 1. nan]
[ nan nan 1. nan]]

Footprint:
[[ 1. 0. 0. 0.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 0.]
[ 0. 0. 1. 0.]]
```

Or, alternatively, when using `dtype=int` for the input data:
```
data = np.ones((4, 4), dtype=int)
projected_data, footprint = reproject.reproject((data, hdr), hdr)
print "Projected data:\n", projected_data
print "\nFootprint:\n", footprint
```

I get the following funny result:
```
Projected data:
[[ 1.00000000e+00 -9.22337204e+18 -9.22337204e+18 -9.22337204e+18]
[ 1.00000000e+00 1.00000000e+00 1.00000000e+00 1.00000000e+00]
[ 1.00000000e+00 1.00000000e+00 1.00000000e+00 -9.22337204e+18]
[ -9.22337204e+18 -9.22337204e+18 1.00000000e+00 -9.22337204e+18]]

Footprint:
[[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]]
```

What gives, I wonder?