Image Registration Exercise

Written by Gautham Narayan (gnarayan@stsci.edu) for LSST DSFP #5

In this directory, you should be able to find two fits file from one of the projects I worked on


In [ ]:
!ls *fits

While the images have been de-trended, they still have the original WCS from the telescope. They aren't aligned. You could use ds9 to check this trivially, but lets do it with astropy instead.


In [ ]:
import astropy.io.fits as afits
from astropy.wcs import WCS
from astropy.visualization import ZScaleInterval
import matplotlib

%matplotlib notebook
%pylab

In [ ]:
##### I've given you some imports above. They're a big hint on what to try. You get to do this!!! #####

Use the astrometry.net client (solve-field) to determine an accurate WCS solution for this field.


In [ ]:
!solve-field -h

Options you might want to look at:

--ra, --dec and --radius: Restrict the solution to some radius around RA and Dec. The regular telescope WCS should be plenty for an initial guess.

--scale-units, --scale-low and --scale-high: You might not know the exact pixel scale (and it's a function of where you are on the detector in any case, but you also set limits from this based on the existing CD1_2, CD2_1

-D, -N: Write to an output directory and write out a new FITS file with the solved WCS.

Don't use out/ as the output directory.

--parity: You can usually set this and get a speedup of 2x

To get info from the header, you can use astropy, or just use imhead from the WCSTools package at the command line


In [ ]:
print(WCS(f1[0].header))

or


In [ ]:
!imhead wdd7.040920_0452.051_6.fits

Use the above info to solve for the WCS for both images.

The problem with the distortion polynomial that astronometry.net uses is that routines like ds9 ignore it. Look at astrometry.net's wcs-to-tan routine and convert the solved WCS to the tangent projection.


In [ ]:
!wcs-to-tan -h

The commands I used are in Register_images_solution.txt and the output I generated in the out/ subdirectory.