ASTR 4880 Computer Lab Session 7

The goal of the first offering of this session was to obtain a flat fielded stellar spectrum. In order to do so, we repeated what we did in Session 4, with better data. We also added a few refinements:

Log in to your astro1 account, change to your iraf directory, open an xgterm window, and type cl to start IRAF. At the cl command prompt, type:

show imtype

and check that it responds with hhh. If it does not, ask for instructions.

Create a new directory for tonight's session on the server4 file system, to which there is a data2 or data3 link in your iraf directory. Now, copy to this directory all the files that are reached with the following command. They include 10 biases, 10 red flats, two comps, and one star. A printed copy of the observing log for the night will be provided.

copy /mnt/vol01/ndm/CCD3/20091113/* ./

Editing the header keywords

This step is similar to what we have done before, except that now we will add a set of keywords to all our lamp images (not the star, yet). With the data, you pulled over a keywds2.tbl file. Run asthedit with this file and with the usual command file, cmds-lamps.asth. You want to run it on all the images except number 17. The most convenient way to do this may be to delete number 17 and use *.fits in asthedit's images parameter field. Then copy number 17 back in when you need it.

Creating median bias and flat images

IRAF has specialized scripts for combining biases and flats, which recognize the imagetyp header keywords that you just inserted. These scripts are included in the ccdred package, which does general CCD reductions. To load it, type at the IRAF command prompt,



epar zerocombine

PACKAGE = ccdred
TASK = zerocombine

input = *.fits List of zero level images to combine
(output = bias.fits) Output zero level name
(combine= median) Type of combine operation
(reject = none) Type of rejection
(ccdtype= zero) CCD image type to combine
(process= no) Process images before combining?
(delete = no) Delete input images after combining?
(clobber= no) Clobber existing output image?
(scale = none) Image scaling
(statsec= ) Image section for computing statistics

Perform a similar operation with the task flatcombine. The output file name should contain the string 'flat' and have a .fits extension, the ccdtype parameter should be flat, and everything else should be the same.

Cosmic ray removal

The star exposure with which we are working for practice was only 5 minutes in duration, but still it has enough cosmic rays in it for the results to be ugly. The night of data with which you will work for your next lab includes longer exposures, so the cosmic rays will be even more numerous.

Copy the star exposure /mnt/vol01/ndm/CCD3/20091113/200911130017.fits back to your current directory, if you deleted it previously. Let's skip editing the image header for now.

Subtract from it the median bias you have already created to create an image that will herein be called 17b.fits.

Our method for removing cosmic rays is to fit a polynomial to each line of the image in the direction parallel to the spectrum. For example, we might plot each row of interest with splot, open the interactive curve fitting package with t, select c for clean, select the curve fitting parameters to give the desired results, and create a new image with i. Answer 'yes' to the question about overwriting the image. Carry out this process for 10 to 15 rows, then quit and open the new image with splot to check your results.

As the previous activity makes clear, this method is very time consuming. The task lineclean should save some time, because it allows the user to select fitting parameters and then apply them to the entire image. The fit parameters can be those previously selected with splot.

As you also doubtless realize by now, IRAF provides no free lunches. With lineclean, the catch is that it operates in only one direction, which in our case is perpendicular to the direction we want. Therefore, we have to transpose our image:

epar imtranspose

PACKAGE = imgeom
TASK = imtranspose

input = 17b.fits Images to be transposed
output = 17bt.fits Output image names
(len_blk= 512) Size in pixels of internal subraster
(mode = ql)

The transposition may take a minute or two.

Now, epar lineclean

PACKAGE = imfit
TASK = lineclean

input = 17bt.fits Images to be cleaned
output = 17btc.fits Output images
(interac= yes) Set fitting parameters interactively?
(sample = *) Sample points to use in fit
(naverag= 1) Number of points in sample averaging
(functio= spline3) Fitting function
(order = 11) Order of fitting function
(low_rej= 0.) Low rejection in sigma of fit
(high_re= 5.) High rejection in sigma of fit
(niterat= 1) Number of rejection iterations
(grow = 0.) Rejection growing radius in pixels
(graphic= stdgraph) Graphics output device
(cursor = ) Graphics cursor input
(mode = ql)

Notice the low rejection value of zero, in order to avoid rejecting stellar absorption lines. We will also have to exercise caution about the high rejection parameter, since the stellar spectrum has an Hα emission feature. It would be good to have checked that in the previous iteration with splot. The above values should be good to start.

Now we are ready to start aperture definition, extraction, and flat fielding. Depending on guidance from your instructor, please proceed to follow the instructions in the newly revised Session 4, starting with "Aperture definition."

Or proceed to Session 8.

*If your show imtype gets a response of imh instead of hhh, you need to quit IRAF and edit the file in the iraf directory in which you started up IRAF. In that file, the line

#set imtype = "imh"

should be changed to read,

set imtype = "hhh"

You may want to check whether you have more than one iraf directory. If you do, that fact could lead to confusion. It might be a good idea to take a few minutes to decide which of them you are going to use and delete the others. To delete a directory, delete all the files in it, cd to the directory above it with cd .. and type rmdir .

It's perfectly OK to have more than one iraf directory; in fact, it's a good idea if you are working on more than one project for which you need different class parameters. For example, perhaps you are using your astro1 account to do research with IRAF while taking this class. In that case, give these directories informative names, so that you can tell at a glance the purpose of each one. You can rename an iraf directory after it has been created.
Back to top of page

Return to ASTR 4880 home page

Latest update (by NDM): 11/22/09 20:20