SEARCH
ARCHIVE · SOFTWARE

OpenFITS: the Crab's Pulse

BY GERARDO BLANCO · · 7 MIN
KOSMOSLOGOS ARCHIVEAutomatic translation of the original Spanish post by Gerardo Blanco (KosmosLogos, CC BY-SA 3.0). Read the original in Spanish. /2010/07/openfits-el-pulso-del-cangrejo.html

The third part of a tutorial on how to use FITS images to create astronomical images.

Crab Nebula

In the first part we saw an introduction where we explained what programs to use to create images, as well as telling about FITS files.

In the second part a tutorial was developed to create a color image of the supernova remnant Cassiopeia A.

In this third and final part we will create an image of the Crab Nebula.

1-We will download the data file from:

Crab 0.3-10 keV Fits File http://chandra.harvard.edu/photo/2009/crab/fits/crab.fits

2-Open the file in GIMP and change to RGB

a. File->Open and select the previous file b. Note that the default parameters in the dialog box should work well for this example.
c. We should see something similar to the one below.
d. The image is in grayscale and needs to be changed to RGB to color the layers. We go to Image->Mode->RGB.

tutorial2

3-Adjust levels

a. The image is very dark and needs level adjustment.
b. We open the Levels dialog by selecting Colors->Levels and freely adjust by moving the little triangles or sliders under the histogram under Input Levels.

c. Typically only the gamma of each layer would be adjusted by moving the middle slider or little triangle to the right or left, depending on how much we want to adjust the level.

d. The trick of adjusting levels in this step is to be able to visualize the more diffuse details in the object, but minimizing the amount of background "noise". Let's change the level sliders to our liking.

tutorial3

4-Apply the smoothing algorithm

a. At this point we start to see a better image, but very pixelated. To correct this in the previous tutorial the GMIC filter was used because it works well for data of diffuse X-ray structures. The Crab emits a lot of X-rays, so the smoothing can be as simple as applying a small Gaussian Blur. We do this from Filters->Blur->Gaussian Blur. Even with a blur of 2 pixels radius it will give good results. If we want to use the other filter, instead of this blur, we can also try from Filters->GMIC...->Enhancement->Anisotropic Smoothing.

tutorial4

5-Error cleanup

a. From the opening of the image we notice something strange in the image: the dark line crossing the Nebula and the black dot with bright lines on each side. These are instrumental errors and not data from the object and will need to be carefully removed without introducing anything new and strange.

b. We know that the central black dot is the source of the most intense X-rays in the image, so intense that the detector was not able to properly record the light coming from that region and, instead, was saturated to the point of having no useful data, a "black hole". We can simply, but carefully, replace the black of that dot with white, to indicate the most intense light in the image.

c. The bright lines from this central region are "readout streaks" created by residual photons across the detector while the image was being transferred from the CCD. We will see similar things in our own digital cameras or in cell phone cameras when they are exposed to localized bright light sources, like the Sun. Those lines can be removed using the GIMP tool called healing, designed to repair image irregularities.

d. To use this tool we select it from the toolbox (it appears as two crossed yellow band-aids) and then we will do CTRL-click on a region of the image near the artifact to define the source pixels, then click on the artifact itself. What happens is the following: by doing CTRL-click we are "copying" a small region and by clicking elsewhere we are "pasting" what we copied before. In this way we can do CTRL-click on a small region near the black line and then click on the black line. We will see that where we clicked now appears as that region where we had done CTRL-click. We can repeat this many times until the white lines and the black line "disappear".

The tool is an algorithm that will blend pixels from the selected region into the new region and repair the irregularity in the process. The same approach can be used on the dark band in the image as well. The tool has different parameters that we can configure like opacity, brush size, and be careful when blending to follow the contour and structure in the image. If done well it will look as if those marks or artifacts had never been there. It requires a bit of patience and a good eye and may take us some time to achieve.

I recommend using a small brush so as not to blend anything. For that we will need to zoom in on the image with the magnifying glass that is in the tools.

To make the central black dot white we can use the elliptical selection tool, make a little circle the same size as the black dot and change its color.

tutorial5

For that we use the tool, click near the black dot and with the mouse pressed drag down. A circle will form that we can shrink or enlarge by positioning the mouse at the corners until a kind of little arrow appears. And we can move the circle by moving the mouse until a cross appears, press and drag to where we want. Once we have the circle in the same place as the black dot, we change its color. To do this we press the fill tool, a paint bucket icon. Below the tools we will see two rectangles, normally one black on top and one white on the bottom. Those are the foreground and background colors. There is a double arrow in a corner that allows swapping the background color to foreground color. With the tool selected we will see below some options like fill with foreground color or with background color. We will have to choose the color that is white. If neither color is white, we click on one of the rectangles and a dialog box will open to choose a color. Once this is configured we bring the mouse pointer to our circle and click, transforming the circle to white.

6-Add color

a. In the previous tutorial, when applying color, a limitation of GIMP in relation to Photoshop was seen, but for now we continue with this program.

b. In a broadband image like this one, typically a single color map gradient is applied to the image to show the X-ray intensity. To apply it we go to Colors->Colorize.

c. We will notice that changing the Hue modifies the numbers from 0 to 360, as in the previous example, where we explained why.

d. Let's play with the Hue selector until we find a color we like. Usually, this type of broadband X-ray images are often portrayed in blue (Hue of 220), but it can be a matter of taste.

e. Depending on the chosen color, we will end up with something similar to the image below.

tutorial6

7-The final touches

a. Now that we have added color, a nice image is being seen, but we will do something more.

b. We can try the various GIMP tools to emphasize the color and brightness of the image.

c. In the previous example, a levels adjustment was performed again using the Curves tool in Colors->Curves, to emphasize the saturation of the brighter levels and suppress the lower levels a bit. Color balance was also used: Colors->Color Balance, to bring in more blues.

d. With a bit of practice, we will get better and develop an intuitive sense of what we can do.
My result is the first image in that post.
We can compare our final image with some image of the pulsar in the Crab Nebula by Chandra.

To save the image we can go to File->Save image as->In the top field we can set the image name which can be saved in different formats. Some of the most used image formats are PNG and JPG. We go to the bottom of that dialog box, select, for example, JPG images and save.

tutorial7

On Chandra's openFITS there are several other files to download and try our luck. As we see, astronomical images have data with physical information about the objects, but also some art and aesthetic sense. The next time we see an image of astronomical objects, we will at least get a glimpse of how it was made.

In the future, the Chandra X-ray Observatory may continue with this series, but in the meantime, we already have some ideas to experiment with.

Sources and related links

About the images

KOSMOSLOGOS ARCHIVEOriginally published on KosmosLogos by Gerardo Blanco · License CC BY-SA 3.0 · Adapted format, original text unchanged
GERARDO BLANCOAuthor of the KosmosLogos blog, written from Argentina about astronomy, astrophysics, cosmology, and related sciences.

RELATED

SOFTWARE