[AstroPy] Astropy reproject to align two HST images

Shupe, David L. shupe at ipac.caltech.edu
Thu Jan 16 10:32:44 EST 2020


Hi Shalmalee,

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[1].header, hdul1)
input_wcs = WCS(hdul2[1].header, hdul2)

In the call to reproject, pass a tuple of (array, WCS) as the first argument:

array, footprint = reproject_interp((hdul1[1].data, input_wcs), output_wcs, shape_out=hdul2[1].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.

Kind regards,
David Shupe
Caltech/IPAC

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:

Hi.

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.

[https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png] astropy_reproject_NGC_2257.ipynb<https://drive.google.com/a/students.mq.edu.au/file/d/1815Npx--OXYrDlN1zrgyVzpN5fwuGa3B/view?usp=drive_web>[X]
[https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png] f336w_01_flt.fits<https://drive.google.com/a/students.mq.edu.au/file/d/1u3RFtGVDJa3cj6vEjvUcocJxWykEA4Z4/view?usp=drive_web>[X]
[https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png] f814w_01_flt.fits<https://drive.google.com/a/students.mq.edu.au/file/d/1wQa7DmCIQyNs24Bn40G-yXoPlLqipTCr/view?usp=drive_web>[X]


Thanks and regards,
Shalmalee Kapse,
PhD Candidate,
Department of Physics and Astronomy,
Macquarie University,NSW - 2109, Australia.
_______________________________________________
AstroPy mailing list
AstroPy at python.org<mailto:AstroPy at python.org>
https://mail.python.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20200116/4ab1e086/attachment-0001.html>


More information about the AstroPy mailing list