Image Reprojection Exercise

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

We've already determined the WCS solution for two misalgined images in Exercise 1 using astrometry.net (Register_images_exercise.ipynb). Now we're going to reproject the images onto the same grid.


In [ ]:
import numpy as np
import matplotlib
import astropy.io.fits as afits
from astropy.wcs import WCS
import reproject
from astropy.visualization import ZScaleInterval
import astropy.table as at
import astropy.coordinates as coords
import astropy.units as u
from astropy.visualization.wcsaxes import WCSAxes
import astropy.visualization.wcsaxes.frame as frame

%matplotlib notebook
%pylab

If you didn't get through Exercise 1, that's OK! I saved my output! You can just use that if you'd like and press on!


In [ ]:
!ls ../01_Registration/out/

Open the two images and load the wcs solution that you created in the tangent plane (I used wcs.tan as my file extension)


In [ ]:
#### You get to do this ####

OK, now reproject the data of the 2008 image on to the 2004 image. Look for functions in the reproject module. Remember to keep flux conservation in mind!


In [ ]:
#### You get to do this ####

Now display the two images as you did in the last exercise - you should be able to copy and paste the same code even


In [ ]:
#### You get to do this ####

Hopefully that's halfway reasonable looking compared to what we started from! For funsies, scale both images to have mean 1 and attempt to subtract them. Remember than there are NaNs in the reprojected image!


In [ ]:
#### You get to do this. You can look for NaNs in the image, or the reproject functions should return a footprint ####

Now construct a simple difference image from the original data


In [ ]:
#### You get to do this ####

Create a figure instance, zscale the differences and see what the residuals look like


In [ ]:
#### You get to do this ####