# Creating a 2D matrix from 2 FITS images of unequal dimensions for Radio/FIR correlation

I have two images of NGC 6946:

item       description        size (pixels)    scale (arcseconds/pixel)
1.     70 micron MIPS FITS     241 x 241           4.5
2.     20 cm VLA FITS          512 x 512           2.0


I need to create a matrix with 2 columns (70 micron vs 20 cm), where each column will store the values at each pixel in such a way that the central pixel coordinate of each image coincides, so that I can plot for Radio/FIR correlation.

How should I perform such task in python?

• I've added the astropy tag on the off chance that it will apply. Do you want to interpolate one image to fit the other, since their pixel sizes aren't 1:1? Will you need to rotate one image to match the other as well? I reformatted a bit, feel free to edit further or roll-back. – uhoh Nov 19 '19 at 8:03
• Thank you for formatting my question. I will keep this method in mind. Returning to the problem at hand, I want to create a 70 micron intensity (Jy) vs 20 cm intensity (Jy) plot and fit a curve through those points. – user30981 Nov 19 '19 at 9:15
• Right, you are hoping for pixel-for-pixel matching so that you can look for a correlation. They have different scales, so you'll need to at least interpolate first, since the pixel scales are different, (roughly 9:4). Is there some rotation difference, or are they both oriented exactly the same way (e.g. North = up)? – uhoh Nov 19 '19 at 12:24
• Do the images have world co-ordinate system (WCS) in their headers? – TazAstroSpacial Nov 22 '19 at 6:17
• Yes. Thank you. I have already done it. – user30981 Dec 17 '19 at 0:17

If you have the WCS for both images, you can use the astropy reproject module. Once you have projected image 1 onto image 2, the (x,y)th pixel from the output will correspond to the (x,y)th pixel from image 2.