Iraf Reductions of Capilla CCD Images


Contents Intro I/O Imexam Bias Flat Field BadPix Flash CoAdd Resources




1.1 - Introduction

This tutorial has been designed to take you through the steps necessary to 'reduce' the raw images you've taken at Capilla Peak Observatory with the Photometrics CH360 camera. Reduction methods are described in the context of the NOAO software package IRAF ( Image Reduction and Analysis Facility ), the standard for optical astronomy in the US. You won't learn but a smidgen of IRAF here ... it's vast and this is just to get you going.

The process of reducing the data is no more than a means to recover the science data from images that, in their raw form, contain extraneous data related to imperfections in the optics of the telescope, flaws and sensitivity variations in the CCD, non-uniformities in filter transmissivity, debris in the optical train, vignetting of the optical beam, electronic signatures, and more. All of these effects add up to what is called an "instrumental signature" that is contained within the image, along with the science data.

The steps outlined in this tutorial are the minimum that you need to take to free the science data from the raw data. Once done, you'll be ready to perform the photometric analyses your project requires. None of that analysis is addressed here. You'll find lots of information on IRAF's many analysis packages at the NOAO ftp site, in the IRAF help pages, and in the IRAF reference volumes drifting about the department. The main IRAF Project WWW page is here

1.2 - Setting Up

You will need an account on one of the IFA UNIX machines. See the system administrator about setting up your account if you don't already have one. If you don't know UNIX well, you can find some basics here.

First, open an xterm window on your terminal and type cd . This will place you in your HOME/root directory. You need to create an IRAF directory which will store all of your image headers and other files used in data processing. Do this by typing mkdir iraf. Now type cd iraf to move into your IRAF directory. IRAF uses a start-up file named login.cl to read in the IRAF environment and data specific to your account. To create this file type mkiraf. You'll be prompted for terminal type...respond with xgterm. Enter an ls to check the contents of your IRAF directory. You should see your login.cl file, and a sub-directory called uparm. IRAF will have automatically set your username, home directory, image directory, and parameter file directory in the login.cl file, but you should check that it looks right. In particular, your image directory ( imdir , where the actual images are stored after you read them into IRAF ) should be the one that the system administrator has approved. The pertinent lines in the login.cl file should look something like this:

home   = "/a/wallace/export/home/username/iraf/"
imdir  = "/nfs/data6/username"
uparm  = "home$uparm/"
userid = "username" 

The commented-out set commands in the login.cl can be uncommented to indicate some preferences to IRAF. For instance, what editor do you want to use when editing within IRAF? Just delete the # symbol at the beginning of the first set command, and enter the name of the editor you like. You should uncomment and set stdimage to "imt1024" ... this will set the image display appropriately for the 1024X1024 SiTe CCD chip in the Photometrics camera at Capilla. The old RCA chip setting should be " imt512", if you happen to use it. The login.cl file also has a number of foreign declarations. These are setting that allow you to access the command line of the native OS of your machine. Access to other UNIX commands is accomplished using the command preface '!'  . For instance,   !more ed.txt   will access the UNIX more command.

Add configuration parameters of your own through the loginuser.cl file, which you must create. A generic copy can be had with the command " cp /usr/local/iraf/local/loginuser.cl   . "  .   The   '.'   at the end of the command indicates that the destination of the copied file is your current directory. For starters, it should look something like this:

# Set up terminal characteristics.
stty nlines=40
stty ncols=80
# Create default area to write/read images from/to disk.
set fits=/nfs/data6/username/
# Load packages required for CCD reductions
images
tv
noao
imred
ccdred
bias
digiphot
apphot
dataio
daophot
keep


Fill in your working directory name at the set fits line. This is where your fits images will be stored, so create the directory with mkdir /nfs/data6/username. Check to see that your directory was created by entering cd /nfs/data6 then ls, or just   ls /nfs/data6   . If not or you get a ``Permission denied'' message, see the system administrator about getting permission. Enter cd ~/iraf to return to your IRAF directory.
To start up IRAF all you have to do is type xiraf . xiraf is a local start-up script that opens two IRAF xgterm windows, and the image display facility saoimage. Instead of entering xiraf, you can enter cl in one of your xgterm windows. IRAF will be invoked in the xgterm window without saoimage. An alternative image display facility, ximtool is available: use imxiraf instead of xiraf and you'll get the same xgterm IRAF windows and the ximtool display.

1.3 - About IRAF


IRAF is made up of four parts:
  - the Command Language (CL) - the user interface to the system;
  - the applications packages - the routines and algorithms that do the data analysis;
  - the Virtual Operating System (VOS) - the foundation of higher level functions;
  - the Host Interface System - the interface between IRAF's VOS and the host machine.
Only the first two are directly apparent to the user in most cases. When you start IRAF with xiraf, imxiraf, or cl, you are invoking the command language in an xterm or xgterm window which thereafter serves as your command interface to IRAF. The CL gives the user direct control over the data and the parameters involved in data analysis through an assortment of tasks that are logically organized into packages. Depending on the explicit instructions in your login.cl and loginuser.cl files, when you invoke IRAF you'll see a listing of loaded packages:

apropos       language.     noao.        scripts.     tables.      
dataio.       lists.        obsolete.    softools.    utilities. 
dbms.         mtools.        plot.       stsdas.      xray.      
images.       mxpackage.    proto.       system.  

 cl >                                       


The tasks associated with each package are accessible from the cl > if you've loaded that package already. Access to any package, loaded or not, is accomplished by typing it's name at the cl >:

 cl > noao                                     
   artdata.       digiphot.    mtlocal.      observatory    surfphot.
   astrometry.    focas.       nobsolete.    onedspec.      twodspec.
   astutil.       imred.       nproto.       rv.           
 no >


The new listings are the tasks in the noao package, invoked simply by typing the task name at the no > prompt ( or from the cl > prompt if the package is loaded). Return to the previous prompt by typing bye at the current prompt. A lo at the cl > will exit IRAF.

There is lots of help within IRAF ... just type help followed by a package or task name. Enter help packagename and you'll see a listing of all the tasks under that package with a short description of each. Type help taskname to see a help page on a task. If there is a subject or keyword you need a clue on, try reference subject or apropos subject.

Virtually all the tasks in IRAF have a parameter file, which you can look at with the   lpar taskname   command, and edit with the   epar taskname   command. These parameters control how the task operations will be accomplished. There are both hidden (parenthesized) and positional/query (unparenthesized) parameters. The query parameters will be confirmed each time a task is run (via command line prompt) unless they are explicitly stated on the command line. The hidden parameter values currently entered in the parameter file are used in executing the task unless specified on the command line by the user. You'll see several examples in the sections that follow. It's important to understand the parameters for the tasks you use ... otherwise what you think is being done to your data may not be what's really being done.

A few miscellaneous points:

-- The ccdlist procedure will not work properly until you run the setinstrument task. For most Capilla data analysis, you'll want to enter ``direct'' at the ``Instrument ID'' prompt, which appears after you type setinstrument at the cl prompt. After entering ``direct'', you'll be placed in editing mode into the ccdred parameter file, which for starters you should exit ( type :wq then return ) without making any changes. Again you'll be placed in editing mode into a parameter set, this time the ccdproc set. Again exit without altering the file. By entering ``direct'' at the initial prompt, you're directing IRAF's attention to the direct.dat file, which lets IRAF know what the local header keyword is for filter type, among other things.

-- IRAF has some simple logging features to allow the recording of events of interactive sessions. From these saved event logs, one can save a particular data analysis sequence, track errors in programs, etc. One can log commands, errors, traces, background and user messages. To implement the logging feature, type keeplog = yes, then logfile = "home$logfile", and finally logmode = "commands nobackground errors trace". See help for "logging" for more data.

-- You can recall a history of the last few commands with history ; get the last n commands with history n ; or print out the whole history list with history -999. The command e will recover the last command in an editing mode. Use the uparrow\downarrow keys following an e command to see and edit commands earlier or later in the history list. Typing ^ n, where n is the history list number of a command, will cause that command to be executed. Type ^ lis and the last command that started with 'lis' will be executed. e imcomb will bring up the last imcombine command.

-- IRAF recognizes the minimum unique string for commands, so that you can enter imhe for imheader or disp for display and IRAF will know what you mean.

A document that you may find useful is A User's Introduction to the IRAF Command Language by Shames and Tody. It gives the lowdown on the CL command language in some detail. A Beginners Guide to Using IRAF by Jeannette Barnes goes into much more detail about many of the topics covered in this tutorial.




Contents Intro I/O Imexam Bias Flat Field BadPix Flash CoAdd Resources