IRAF quick tips



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

Instructions for dealing with IRAF errors

If you experience errors containing $uparm, make sure you have write permissions to your home and imdir directories, which are set on lines 7 and 8 of your login.cl file.
To install IRAF, run mkiraf, which will create a new login.cl for you. You may have to change your imdir to "home$images/" or something similar. You must 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

To start logging with pyraf, use the command .logfile [filename.log]
-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 these commands or similar:
imhead proc-*.fits[0] lo+ | egrep "Pixel\ file\|UTTIME"
imhead e*.fits lo+ | grep -E "Pixel\ file\|UTC-OBS"

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). egrep is equivalent to grep -E for older versions of grep that do not allow the option syntax.