[AstroPy] Astropy reproject to align two HST images
Shupe, David L.
shupe at ipac.caltech.edu
Thu Jan 16 10:32:44 EST 2020
The error you are encountering is due to the WCS constructor needing more information from your input FITS files.
I have modified your notebook to make it work through the reproject step. Here are my suggestions:
Construct WCS’s explicitly like this, passing the HDULists as an additional argument so that the distortion parts are picked up:
hdul1 = fits.open('f336w_01_flt.fits')
hdul2 = fits.open('f814w_01_flt.fits’)
output_wcs = WCS(hdul1.header, hdul1)
input_wcs = WCS(hdul2.header, hdul2)
In the call to reproject, pass a tuple of (array, WCS) as the first argument:
array, footprint = reproject_interp((hdul1.data, input_wcs), output_wcs, shape_out=hdul2.data.shape)
I was unable to make the plotting step work but at least these changes made the reproject step work without raising an exception.
On Jan 15, 2020, at 10:58 PM, SHALMALEE KAPSE <shalmalee.kapse at students.mq.edu.au<mailto:shalmalee.kapse at students.mq.edu.au>> wrote:
I am trying to align two images I downloaded from MAST HST portal. For this, I am using astropy-reproject package. However, I am running into an error, every time I use reproject, despite providing the WCS information.
Following is the error:
ValueError: an astropy.io.fits.HDUList is required for Lookup table distortion.
I am using reproject version 0.6, and astropy both versions (3.2.3 and 4.0).
Information about the images: One image is from HST/WFC3 and second one is from HST/ACS. I am attaching the two images along with my reproject code (.ipynb). Please let me know how to proceed and solve this issue. Thanks in advance.
Thanks and regards,
Department of Physics and Astronomy,
Macquarie University,NSW - 2109, Australia.
AstroPy mailing list
AstroPy at python.org<mailto:AstroPy at python.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the AstroPy