python - Superimpose on FITS image on another with PyWCSGrid2 -


i've got 2 .fits images. 1 image of stars , galaxies. other significance map want plot on it, contour. pywcsgrid2 python module in, i've tried overlay 1 on other while , can't them both show @ same time. ideas why isn't working?

import matplotlib.pyplot plt import sys import pyfits import pywcsgrid2 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  # 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: issue seems 2 images have different scales, plotting contours, tiny , waaaay in bottom left corner. need rescale them somehow.

it's possible drawing contour bellow image? doing this:

# 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() 

but thing can better:

# draw image im = ax.imshow(data, cmap=plt.cm.gray, origin="lower",interpolation="nearest",alpha=1.0) # overlay -> draw contour cont = ax.contour(data_contour, [5, 6, 7, 8, 9],                    colors=["r","r","r", "r", "r"], alpha=0.5) plt.show() 

i hope helps.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -