ASTR 3520: IRAF quick tips



For hints on using DS9 without IRAF, check out Adam's DS9 tips page

Instructions for dealing with IRAF errors on cosmos

Since the changeover to the new cosmos server, your login.cl files may be incorrect. They currently have home defined as /raid/home/(username)/etc, but this is no longer correct; you will receive errors saying that iraf could not modify uparm$(taskname). You should change this by removing the /raid at the front of the path. This can be done using any editor: look for the line "set home = "/raid/home/..." and modify it.

You can try to re-run mkiraf, which will create a new login.cl for you. If you had any settings saved in login.cl, it will overwrite them. You must also go on and change your imdir to "home$images/". Search for the line #set imtype "imh" and change it to read set imtype "fits" (remove the # at the beginning of the line).

If you have trouble with .imh files showing up instead of .fits files:
  1. check to see if your imtype is set correctly with show imtype.
  2. if it's imh, use set imtype=fits to fix it
  3. you may need to use the flpr command to make sure IRAF recognizes the change
  4. Find your login.cl file. Make sure the set imtype=fits line is uncommented as in the directions above.

IRAF quick tips

-If you see errors that involve "uparm" or "unable to write...":
 -try to logout of the cl and log back in; make sure you're in the directory with your login.cl file
 -make sure your login.cl has been edited as per the directions above

-If you have problems with imexam and cursor behavior:
 -restart DS9, try again
 -restart DS9, logout of the cl and log back in
 -get frustrated, call or e-mail Adam, see if he gets frustrated

-Using IRAF graphics terminals:
 -q quits; a quit and re-enter solves most problems
 -? displays help in the terminal. Don't forget to quit out of the help when you're done
 -:(command) allows "colon commands" that can be quite powerful (see, e.g., "wcs" in imexam)

-A syntax error in IRAF generally means you have not loaded the requisite package.
  -if you don't know what package that is, use the help command (e.g. help temden)


Matching Guider Images to Science Images

Instead of going through each individual file's header, I recommend using this command:
imhead proc-*.fits[0] lo+ | grep -E "Pixel\ file\|UTTIME"
in the ecam directory, and the command
imhead e*.fits lo+ | grep -E "Pixel\ file\|UTC-OBS"
in the science directory for the selected night in order to list the file names and exposure start times for each file. You can then write the output of these commands to a file by appening a redirect to the end of the command, e.g.
imhead e*.fits lo+ | grep -E "Pixel\ file\|UTC-OBS" > filename.txt .
Once you have found the necessary files, copy them to your directory.
If you are using DIS instead of Echelle, replace e*.fits with d*.fits.

If you're curious about what those commands mean, read on.
You should already be familiar with the imhead command, which with the long option enabled prints the full header. The [0] appended to the end of the filename chooses the first extension in the fits image. A fits file is capable of holding many extensions, i.e. many images, in one file. In the case of the Echelle guider camera, the proc-[something].fits files have the slit superimposed on the sky image as the first extension, and the slit mask image as the second extension.
The grep command outputs all lines containing a regular expression from its input. A regular expression is a special pattern matching expression. In this case, we have "Pixel\ file\|UTC-OBS", which means we are searching for lines with the string Pixel file or UTC-OBS. The backslash before the space escapes the space so that IRAF doesn't think you are giving it another command. Similarly, we must escape the or operator | (though I'm not entirely certain why - this is not standard behavior). The -E option tells grep that we are using an extended regular expression, which is what allows the use of the | symbol.


ASTR3520 home

Page written by