iraf

Synopsis

  • IRAF = Image Reduction and Analysis Facility
  • IRAF is a (huge) (historical) software package to work with astronomical images and spectra. It has its own scripting language (called cl-script), allowing you to build reduction pipelines etc using IRAF.
  • The “user interface” is “special”, the scripting language cl-script is awful, the documentation is hard to find.
  • But luckily IRAF can be scripted using python, through a module called pyraf.
  • Tiny subset of funtions used in TP4
    • Measure the width of stars and the sky level : imexamine
    • Combine images : imcombine
    • Prereduce images using simple pixel-by-pixel arithmetic : imarith
    • Filter (e.g. “smooth”) images (for instance by convolution with a gaussian : gauss)
  • Written by US National Optical Astronomy Observatories (NOAO)
  • ESO has a similar tool called ESO-MIDAS
    • midas website.
    • But the problems are also quite similar … Anyway we will use IRAF, as IRAF is the most widespread tool.
  • Comments
    • IRAF is quite old-fashioned, but it still can be very powerful.
    • Very file-based : as IRAF comes from the past (i.e. very small amounts of RAM), many fundamental operations can only be done one step after the other, reading and writing files all the time… this makes it slow !

General documentation & tutorials

  • The classical guide (1993 !)
    • here.
    • (there are other more specific tutorials on this same website)
  • A nice tutorial quite well suited for our tasks

First time configuration

On regor2:

  1. Load the iraf module:

    module add scisoft/iraf
    module add ds9
    

    You can check the loaded modules by running:

    module list
    

    and you should see something like:

    1) /dios           2) /scisoft/base   3) /scisoft/iraf   4) /ds9/7.1
    
  2. Move to you to your home directory:

    cd
    
  3. Makes your iraf directory and move into it:

    mkdir iraf
    cd iraf
    
  4. Create configuration files:

    mkiraf
    

    You will be asked to enter a terminal type : enter “xgterm”. In your iraf directory, some new files are now created. Among them, “login.cl” is the configuration file for IRAF, in the same way that “.tcshrc” (in your home directory) is the configuration file for your shell.

  5. Edit the file “login.cl”:

    gedit login.cl
    

    and make the following changes:

    • Line 8 : set imdir to the same path than home, i.e. copy the string from line 7 into this line 8.
    • Line 24 : set stdimage to imt4096, then UNCOMMENT this line
    • Line 32 : set imtype to “fits” instead of “imh”, then UNCOMMENT this line

    and save the file.

How to launch

On regor2:

  1. Start ds9:

    ds9&
    

    No need to do this from an xgterm, nor from scisoft.

  2. Launch an xgterm

    xgterm &
    

    This will open a new terminal window.

  3. Launch IRAF from within this xgterm:

    cd ~/iraf
    ecl
    

    “enhanced cl” : tab-completion, delete key, up arrow, …