Search code examples
plotrgbastropyaplpy

RGB image components misaligned


I am using aplypy to create an RGB image of the Eagle nebula from three FITS files, representing the red, green and blue components of the image. The FITS files are available here, 673nm being the red, 656nm the green and 502nm the blue.

import aplpy
aplpy.make_rgb_cube(['673nmos.fits','656nmos.fits','502nmos.fits'], 'nmod_cube.fits')
aplpy.make_rgb_image('nmod_cube.fits','nmod.png')

f = aplpy.FITSFigure('../data/nmod_cube_2d.fits')
f.show_rgb('../data/output/nmod.png')

The image should look something like this, but comes out looking like the image below. The blue component is clearly misaligned with the red and green.

Eagle nebula misaligned RGB

make_rgb_cube is supposed to realign the three images in to the same projection based on the WCS information in each FITS header, according to the docs, but it doesn't seem to be working in this case.

Do I need to employ a star matching library to get the alignment accuracy?


Solution

  • There is an error in the WCS coordinates in the header of the Blue FITS file. I have contacted spacetelescope.org to alert them.

    Another example from the site, of M17, is created correctly using the aplpy script shown in the question. Blinking through each filter using DS9, as suggested in the comments, confirms the correct alignment.

    M17