P03: Photometry Practical using astroImageJ

In this practical you will learn to do relative photometry on astronomical data. Our example dataset will be data on the delta-Scuti star SZ Lyn. The data was taken by third-year students using the department's remote controlled 10-inch telescope, ROSA.

We know how to do aperture photometry in principle. In practice, there are many software packages available to perform aperture photometry. We will analyse our images using AstroImageJ. This software package is freely available, runs on Windows, Linux and OS X and does not have a steep learning curve.

The Data

You will need a copy of the data. The data files are located at C:\\SharedFolder\astrolab\SZLyn. There are 427 images of SZ Lyn, taken over several hours. Each image is stored in a file format called FITS format, and end in the .fit extension. FITS format is the standard image format for astronomical data. Inside one file is both the image, and a header, which contains metadata about the image - such as when it was taken, and what filter the data was taken in.

You can work on the data in the SharedFolder. However, this folder is local to the PC you are working on now. If you want to keep files from this practical to use later, you will need to copy those files to your U: or M: drives. Don't copy all the FITS files to those drives, though. The data is nearly half a gigabyte, and will fill your allocation of networked drive space!

At the end of this lab, you will have a sub-folder, called aligned, with your work in it. Please delete this folder before you leave.

The Software

AstroImageJ is already installed on the lab PCs. Should you want a copy for your own machine, it is available for download here. A detailed and helpful manual is available here. If you encounter difficulty, or do not understand a setting, check the manual.

To open AstroImageJ, double-click the file C:\\SharedFolder\astrolab\AstroImageJ\ImageJ\AstroImageJ.

Task 1: Open AstroImageJ. You are presented with the main window, as seen in figure 14. Load all of our images by choosing File > Import > Image Sequence... Select the folder that contains all the .fit images and click Open.

Important: In the options box which appears, make sure Use virtual stack is selected. Otherwise AstroImageJ will attempt to store all of the images in memory. This will not end well for you.

My Image

Figure 14: The AstroImageJ main window.

You should see a new window open, with a display of the first image in the stack. This is the photometry window, shown in figure 15. Near the bottom of the photometry window is a slider which moves through the images, and a button, which will animate through all the images in the stack. Press this button and notice how the stars move around slightly with time. This is due to imperfect tracking of the telescope. Note also the subtle changes in size of the stars as the seeing changes from frame to frame.

Our first step is to correct for the motion of the stars from frame-to-frame. AstroImageJ does this using the align stack function. Strictly speaking it is not necessary to align the images before performing photometry, but it makes the centroiding step of the photometry easier, so we will do it here.

My Image

Figure 15: The AstroImageJ photometry window.

Task 2: Align the images by choosing Process > Align stack using WCS or apertures... This brings up the stack aligner window (figure 16). Make sure the Use previous N apertures box and the Align only to whole pixels boxes are unchecked. Make sure the Show help panel box is checked.

The radii of the object aperture and sky annuli are not too important, but you might want to make sure the object radius is set to a reasonable value, since if the star lies outside this radius, AstroImageJ will not be able to calculate the image shift. Set this value to somewhere in the range 15-20.

Click OK to begin selecting stars to use for alignment. Left click on a star to add an aperture around it. Add two or three bright stars to use for alignment and press Enter or right-click to begin the alignment procedure.

AstroImageJ will now look for a star within each aperture, and measure the centroid of those stars. For each image, it uses the centroid of the stars to estimate the image shift, and saves an aligned version of the image into a subdirectory called aligned.

When AstroImageJ has finished, close the photometry window, and load the aligned images in as an Image Sequence. Be sure to use a virtual stack again! Once you've loaded the aligned images into the stack, hit the button and check the alignment.

My Image

Figure 16: The AstroImageJ Stack Aligner window.

Now it is time to perform the relative photometry on the aligned images. Recall that aperture photometry involves three steps, centroiding, sky background estimation and extraction of the counts from our object. AstroImageJ performs all three of these steps with the Multi-Aperture Photometry tool. First however, we need to know how large to make our object apertures, and the inner and outer radius of our sky annulus. To do that we need to know what the FWHM of the stars in our image is.

Task 3: In the photometry window, click on a star, then choose Analyze > Plot Seeing Profile... You should end up with a plot like figure 17. Based upon this plot, decide how large you want your aperture sizes to be.

seeing profile

Figure 17: The seeing profile for a bright star in the SZ Lyn data. AstroImageJ shows the FWHM at the top of the plot, and makes suggestions for the object aperture and sky annulus sizes, in this case 5, 9 and 14 pixels respectively.

Task 4: Open the Multi-Aperture photometry tool by choosing Analyze > Multi-aperture... Set the radius of the object aperture, and the inner and outer radii of the background annulus to the values chosen earlier.

Make sure the various options boxes are marked as indicated in figure 18, and click Place Apertures to begin. Aperture placement is done in exactly the same way as when you aligned the images.

Figure 19 shows a plot of the sky centred on SZ Lyn. The orientation of this image is not the same as the images from ROSA. Place your first aperture around SZ Lyn, and at least one other aperture around a comparison star. When choosing a comparison star, you should choose an unsaturated, bright star. If possible, it should be brighter than SZ Lyn. Why?

Once you've placed your apertures, right-click or press Enter to start performing photometry.

multi-aperture window

Figure 18: The AstroImageJ Multi-Aperture Measurement window. Here you can set the size of the object aperture and sky annuli. Note that the Update plot... box is unchecked.

The measurement window, which appears following aperture photometry, contains many entries for each image. Only a few are of direct interest to us however. These are:

  1. J.D - 2400000. J.D stands for Julian Date, which is a continuous timescale used by astronomers to avoid complications caused by leap days and seconds. Julian Date is simply a count of the number of days elapsed since January 1, 4713 BC.
  2. Source-Sky_T1. This is the number of counts measured from our target object. Sky background has been subtracted. Similarly, Source-Sky_C2 is the number of sky-subtracted counts from the comparison star.
  3. rel_flux_T1. Remember that to perform relative photometry, we divide the target counts by the comparison star counts. AstroImageJ does that for us, and places the results in this column.

SZ Lyn Sky Image

Figure 19: An image of the sky centred on SZ Lyn. This image covers a slightly smaller area of sky than your data, and the orientation is not the same. You should be able to use it to find SZ Lyn in your images.

Task 5: Save your data to a Tab-Separated Values text file by clicking in the Measurements window and choosing File > Save As... You should be able to open this file in Excel. Use Excel to make two scatter plots, one of JD vs Source-Sky_T1 and another of JD vs rel_flux_T1.

Notice how using relative photometry has corrected the large jump that occurs in the plot of the counts from the target star. This jump is associated with a change in position of the stars, but it has affected our target and comparison star equally, so it is not present in the count ratio plot.

Now you have successfully learnt to use AstroImageJ for aperture photometry. However there are two issues remaining. The first is that your lightcurve does not have accurate error bars. The second is that you do not know if you used the best aperture sizes. Before we can calculate error bars we need to know more about how CCDs work. We will cover that later in the course.

However, we can fix the second problem.

Task 6: Re-run your aperture photometry with a few different aperture sizes, and save the results. Leave the sky annulus unchanged for now, and simply change the object aperture radius.

Open these files in new Sheets in Excel and plot JD vs rel_flux_T1 in each case. Try to plot them on the same graph, and add a small offset to each dataset in y, so you can see the curves.

Which aperture size is best? What does the light curve look like when the object aperture is too small? What happens when it is too big? See if you can understand these effects.

One final thing to think about - if you use a small aperture radius like 2 pixels, much of the light from your object is falling outside your aperture. Why do you still get a reasonable lightcurve?