ASTR 4880 Computer Lab Session 3

Log in to your astro1 account, open an xgterm window, change to your IRAF directory, and type cl to start IRAF. Change to the directory in your account where the image files from Sessions 1 and 2 are stored. Type oned and epar splot and make sure that the options parameter includes hist. If not, make it so.

Measuring the locations of centers of features with splot

A fundamental part of spectroscopy is measurement of the locations of spectral lines. In this session, we'll get started on this topic, as well as prepare to carry out Lab 2, which will involve measuring the locations of emission lines in a spectrum of the thorium-argon lamp.

Among the files you copied to your account from my CCD3/20090831 directory are two Th-Ar spectra, file numbers 28 and 30. This evening, we will work with either one of them. (Lab 2 will use a different set of data, though.) Open either file with splot and give any row number to plot.

Your plot should include some tall, upward spikes; those are the Th-Ar emission lines. Move up or down with the ( or ) key until your plot includes several lines. Then type:

:nsum 10

This command causes splot to plot the sum of 10 adjacent rows and improves the signal-to-noise ratio in your graph. Use the parenthesis keys to move to higher or lower row numbers in order to maximize the height of the lines you choose to work with.

Zoom in on a line. In splot, the easiest method is to type a at the left-hand end of the region you want to see and then again at the right-hand end. This method is available in no other task. In order to measure line centers, you should be well zoomed in, so that you see individual pixels clearly.

If your line is too tall for your zoomed-in graph, use w n to scale the graph correctly. Several methods for measuring the location of the center of a line are available.

Saving the results of measurements

While working with splot, you can review your accomplishments by typing :show to see a listing of your measurement results in the xgterm text window. There is no way to delete a measurement once it is made, but, if you decide you have made a mistake, you can enter a comment by typing #. When the yellow bar appears at the bottom of the graphics screen, type the text of your comment.

When you quit splot, the same text will be saved to a file called splot.log in the current directory. It can be: opened with a text editor such as pico and then copied and pasted to a Windows text processor; fetched with the Windows Secure FTP application; or whatever. Measurement results from subsequent sessions with splot will be appended to the splot.log file, so no work will be lost. If you switch to a different work activity in the same directory, it might be a good idea to rename the splot.log file in order to start a new one for the new activity.

The one way in which work can be lost is to end splot abnormally. The splot.log file is created only if the task is quit properly. For example, do not attempt to quit splot by closing the graphics window. You must quit it by typing q when the red graphics cursor (crosshair) is active, or the results of your measurements will be lost.

Measurements involve a series of decisions, such as exactly where to place the cursor. If a problem surfaces later - such as, your measurement disagrees with someone else's - you may want to review what those decision were. For this purpose, you should save the graphics showing the fitted Gaussian and so forth. Review your saved graphics files with the task gkimosaic

Advanced editing of image headers

We will need to use this technique later in the semester: advanced editing of image headers with the task asthedit, which belongs to the package astutil. To begin, type astutil at the IRAF command line prompt, then epar asthedit .

PACKAGE = astutil
TASK = asthedit

images = 200908310028.fits Images to be operated upon
[use applicable file name]
commands= cmds-lamps.asth File of commands
(table = keywds2.tbl) File of values
(colname= ut exptime datatype dateobs object observer) Column names in table file
(prompt = asthedit> ) Prompt for STDIN commands
(update = no) Update image header?
(verbose= yes) Verbose output?
(oldstyl= no) Use old style format?
(mode = ql)

The second line (file of commands) references a text file. The file named here can be found in /mnt/vol01/ndm/CCD3/20090831/ - copy it to your current directory.

The third line (table) references another text file; copy it into your current directory as above. It is a sample only; the values will have to be changed to match the file(s) you are working with. It has one line per image header to be edited; if you specify only one image for editing, only the first line will be used.

The fourth line gives the column headings for the table values given in the table file.

Display the file cmds-lamps.asth with pico.

Each line is a command to create a header keyword and (if update=yes) add it to the image header. The item to the left of the equals sign is the name of the keyword. When there is an '@' and quotation marks, the purpose is to accommodate a special character such as a '-' in the name of the keyword. To the right of the keyword, the items beginning with a '$' are variables to be read from the column in the data table with the same name. The '#' character is a comment character, causing the text following it in the line to be ignored.

The parentheses in the first command indicate that a calculation is to be done with the ut item; the sexstr, which is an abbreviation for "sexagesimal string," is a function giving the calculation to be performed. Here it just indicates that the universal time is given in hours and minutes.

After updating the file keywds2.tbl with appropriate values from the observing log for the image you are editing, check the parameters for asthedit and execute it. It will list the keywords to be added. Quit and execute it again with update=yes (or update+) in the command line, then check the image header that results.

Additional material 10/21/09

An enlarged version of the command file for asthedit, cmds-lamps.asth, has now replaced the one we used last week. The first 9 lines put new keywords into the image header but do no calculations. Try running asthedit as we did last time, but with this new version of the command file.
Return to ASTR 4880 home page

Latest update (by NDM): 10/26/09 1:28