sunpy/sunpy — pull request #101 by ayshih (2011-11-23 04:31:59+00:00)
Title: Fixes to WCS

The WCS data/pixel conversions did not take into account non-zero values for CRVAL1/CRVAL2 (AIA maps have zeros).

There also appeared to be an off-by-one indexing problem; this should be confirmed by someone else. As an "obvious" test:

import sunpy
from sunpy.wcs import wcs
aia = sunpy.Map(sunpy.AIA_171_IMAGE)
wcs.convert_data_to_pixel(aia.header, 0., 0.)

This should return `(512.5, 512.5)` (after all, this is exactly the reference pixel), but prior to the fix it returns `(511.5, 511.5)`.

For reference, here are the values in `aia.header`:

...
'CRPIX1': 512.5,
'CRPIX2': 512.5,
'CRVAL1': 0.0,
'CRVAL2': 0.0,
...