Making an RGB composite image¶
This example shows the process required to create an RGB composite image of three AIA images at different wavelengths. To read more about the algorithm used in this example, see this Astropy tutorial.
We will use three AIA images from the sample data at the following wavelengths: 171, 193, and 211 Angstroms. The 171 image shows the quiet solar corona, 193 shows a hotter region of the corona, and 211 shows active magnetic regions in the corona.
Before the images are assigned colors and combined, they need to be
normalized so that features in each wavelength are visible in the combined
image. We will apply multi-scale Gaussian normalization using
sunkit_image.enhance.mgn to each map and then create the rgb composite.
k parameter is a scaling factor applied to the normalized image. A
value of 5 produces sharper details in the transformed image. In the
Q is a softening
parameter which we set to 0 and
stretch controls the linear stretch
applied to the combined image.
The output of the
astropy.visualization.make_lupton_rgb algorithm is not
a Map, but instead an image. So, we need to create a WCS Axes using one of
original maps and manually set the label. In the first step below, we grab
the Set1 qualitative colormap to apply to the custom legend lines.
cmap = plt.cm.Set1 custom_lines = [Line2D(, , color=cmap(0), lw=4), Line2D(, , color=cmap(2), lw=4), Line2D(, , color=cmap(1), lw=4)] fig = plt.figure() ax = fig.add_subplot(111, projection=maps.wcs) im = ax.imshow(im_rgb) lon, lat = ax.coords lon.set_axislabel('Helioprojective Longitude') lat.set_axislabel('Helioprojective Latitude') ax.legend(custom_lines, ["AIA 171", "AIA 193", "AIA 211"]) ax.set_title("AIA RGB Composite") plt.show()
Total running time of the script: ( 0 minutes 8.040 seconds)