I've got 2 .FITS images. One is an image of some stars and galaxies. The other is a significance map that I want to plot over it, as a contour. PyWCSGrid2 is the python module to do this in, but I've tried to overlay one on the other for a while and I can't get them both to show up at the same time. Any ideas why this isn't working?
import matplotlib.pyplot as plt
import sys
import pyfits
import pywcsgrid2
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
imagename=str("example1.fits")
def setup_axes():
ax = pywcsgrid2.subplot(111, header=f_radio[0].header)
return ax
# GET IMAGE1
data = f_radio[0].data #*1000
ax = setup_axes()
# prepare figure & axes
fig = plt.figure(1)
#GET CONTOUR SOURCE:
f_contour_image = pyfits.open("IMAGE2.fits")
data_contour = f_contour_image[0].data
# DRAW CONTOUR
cont = ax.contour(data_contour, [5, 6, 7, 8, 9],
colors=["r","r","r", "r", "r"], alpha=0.5)
# DRAW IMAGE
im = ax.imshow(data, cmap=plt.cm.gray, origin="lower", interpolation="nearest",alpha=1.0)
plt.show()
UPDATE: The issue seems to be that the two images have different scales, so it actually IS plotting the contours, but they are tiny and waaaay in the bottom left corner. I need to rescale them somehow.