next up previous 65
Next: On-line help
Up: Worked Examples
Previous: Specifying the directory to contain the pixel files


A Simple IRAF Session

This example demonstrates a simple session using IRAF. It covers: converting a FITS image to the IRAF OIF format, displaying an image and calculating statistics for an image. It also introduces the IRAF on-line help system and displaying and setting IRAF task parameters.

The FITS image used in this example is available as file:

/star/examples/sg12/ccdimage.fit

If you intend to work through the example using this image you should make a copy of it in your IRAF directory. Alternatively, you may prefer to use a FITS image of your own.

  1. Start IRAF and SAOTNG as described in the previous example (Section [*]). Subsequent commands should be issued from the window which is running the IRAF command language (that is, the one with the prompt set to `cl>').

  2. The first step is to convert the FITS image to the IRAF OIF format (see Section [*]). If you are using IRAF version 2.11 this step is not strictly necessary as this version of IRAF can access FITS files directly. However, it is included here in order to keep the example consistent for versions 2.10 and 2.11. In addition, you might find the OIF format more convenient for subsequent operations. You should also note that the command to perform the conversion is slightly different in the two versions. FITS file ccdimage.fit (or an alternative) should be available in your IRAF directory. Type either:

    IRAF version 2.10:
     

    rfits  ccdimage.fit  1  ccdframe

    IRAF version 2.11:
     

    rfits  ccdimage.fit  0  ccdframe

    A line similar to the following should be displayed:

    File: ccdframe KAPPA - Cadd Size = 384 x 256

    File ccdframe.imh should be created in your IRAF directory and file ccdframe.pix in the pixels directory (probably subdirectory pixels if you have used the loginuser.cl file supplied with this document). From the IRAF command language you can show the files in the current directory with command dir, change to a new directory with cd and list a text file with cat; these commands behave similarly to the equivalent Unix commands. You can use these commands to check that the header and pixel files have been created. When you are satisfied that all is well, make your IRAF directory your current directory again.

  3. To show a summary of the file, including its provenance, type:

    imhead  ccdframe

  4. To display an image using SAOTNG simply type:

    display  ccdframe  1

    The image should be displayed in the SAOTNG window. You can use the various buttons in the SAOTNG window to customise the display.

  5. To display simple statistics about the image type:

    imstat  ccdframe

    Output similar to the following should be listed:

    #               IMAGE      NPIX      MEAN    STDDEV       MIN       MAX
                 ccdframe     98304      508.     308.3      330.    31988.
    

  6. On-line help information is available for all the IRAF tasks. To obtain help on imstat simply type:

    help  imstat

    A description of the command and its various parameters will be displayed. Some brief details of the IRAF on-line help are given in Section [*], below. So far, we have been specifying information to IRAF tasks by giving mandatory parameters on the command line. IRAF tasks also have so-called `hidden' parameters which adopt a default value if you do not specify them. You can show the current value of all the parameters of a task using the command lpar. For example:

    lpar  imstat

    The output should be something like:

           images = "ccdframe"      Images
          (fields = "image,npix,mean,stddev,min,max") Fields to be printed
           (lower = INDEF)          Lower cutoff for pixel values
           (upper = INDEF)          Upper cutoff for pixel values
        (binwidth = 0.1)            Bin width of histogram in sigma
          (format = yes)            Format output and print column labels?
            (mode = "ql")
    

    The parameters enclosed in brackets are hidden (in this case this is all of them except images).

  7. By default imstat displayed the name of the image, the number of pixels, the mean, standard deviation and minimum and maximum values. However, the help information revealed that other options were available and that these were controlled by the value of parameter fields. Suppose that we wished to display the mean, standard deviation, skewness and kurtosis2. It is necessary to set parameter fields appropriately, which is achieved by typing:

    imstat.fields  =  "mean,stddev,skew,kurtosis"

    If imstat is run again:

    imstat  ccdframe

    the output should now be:

    #      MEAN    STDDEV      SKEW  KURTOSIS
           508.     308.3     62.03     4728.
    

    In addition to setting parameter values from the command line they can also be edited using task epar; see the Beginner's Guide[1] for further details.

  8. Finally, type:

    logout

    To leave IRAF.



Subsections

next up previous 65
Next: On-line help
Up: Worked Examples
Previous: Specifying the directory to contain the pixel files

An Introduction to IRAF
Starlink Guide 12
R. Morris, G.J. Privett & A.C. Davenhall
2nd December 1999
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council