IRAF processing RECIPES for the Glenlea Observatory:
(Feb. 2, 2006)
Processing with Iraf
Firing up Iraf
- Type "xiraf -ds9 &", for 24-bit display
- Make sure you have saved your original fits files. Tip:
copy each of them from a fits storage directory into your working directory
as you need them.
IRAF works on fits files and converts these to IRAF format (.imh
and .pix files ) the first time they are encountered.
- Load the following packages by typing their names in sequence:
(If you want to unload packages type "bye".)
- Confirm that you have set a backup name for your files by examining
the parameters in ccdred and that you have a logfile set
by examining parameters in imred.
For your webpage you can make a table of processing steps somewhat similar to
that of
Jennifer Fallis.
- Producing Calibration Frames:
For each of the frames, we will first set the parameters for the
ccdprocessing software appropriately and then we will run the software
on the individual frames. Subsequently we will combine the individual
frames into their calibration image.
- Zero Bias Frames:
- Using epar ccdproc set parameters
so that only the
overscan region will be subtracted from your bias
images. That is, set fixpix, trim and all
corrections to no and
ccdtype = ""
overscan = yes
biassec = [1:6,1:512]
- process by typing (or epar'ing) (assuming your
images are prefixed with b1)
ccdproc b1*.fit
- New processed files will have been produced. They will be in
2 parts - imh and pix files. The latter will be in your
imdir. You can check these using imhead and
displaying the new images.
- combine your bias frames into one zero frame image:
- set the following parameters
in zerocombine (the rest can be their
defaults)
processing = no
combine = average
reject = minmax
ccdytype =""
nlow = 0
nhigh = 1
scale = none
- type
zerocombine b1*imh out=zero1.imh
- Dark Frames:
- set ccdproc parameters so that the
overscan region and the zero frame will be subtracted
from your dark images.
(Note: this has to be done for each different
each different exposure time.)
That is,
ccdtype = ""
overscan = yes
zerocor = yes
biassec = [1:6,1:512]
zero = zero1.imh
An example of settings is
in ccdprocdark.list
- process by typing (or epar'ing)
ccdproc d*.fit
- your files will have been overwritten with processed
images. You can check these using imhead and
displaying the new images.
- combine your dark frames into one dark frame image:
- set parameters in darkcombine
processing = no
combine = median
reject = none
ccdtype = ""
scale = none
- select a name for your calibration image (like
darky1.imh) and type
darkcombine d*.imh out=darky1.imh
- Flat Field Frames:
Recall that for 2006, we are using sky frames to create the
flatfield frames. Let's assume that they are prefixed
with "s".
- set ccdproc parameters so that the
overscan region and the zero frame will be subtracted
from your flatfield images.
(Note: this has to be done for each different
filter separately and for each
different exposure time.)
That is,
ccdtype = ""
overscan = yes
zerocor = yes
darkcor = yes
biassec = [1:6,1:512]
zero = zero1.imh
dark = dark1.imh
- process by typing (or epar'ing)
ccdproc s*.fit
- your files will have been overwritten with processed
images. You can check these using imhead and
displaying the new images.
- combine your flat frames into one flatfield frame image:
- set parameters in flatcombine
output = flatsky1.imh
processing = no
combine = median
reject = none
ccdtype = ""
scale = mode
statsec = "" # this gives stats on whole image
subset = "no"
An example of settings is
in flatcombine.list.
- type
flatcombine s*.imh out=flatsky1.imh
- Check that the flatfield is adequate using
display. Eg. in the command line type
"display flatsky1.imh 1" where the 1 stands for
frame 1. (Also see Tricks below for another example.)
- Process your target images:
- Do basic processing for each different filter and
each different exposure time :
- Write settings to ccdproc which will
(1) subtract the overscan, the zero frame and the dark frame
(2) divide the flatfield
from each target image per filter and per exposure time.
An complete example of settings is
in ccdproctarget.list.
In general, the following parameters change.
ccdtype = ""
overscan = yes
zerocor = yes
darkcor = yes
flatcor = yes
biassec = [1:6,1:512]
zero = "zero1.imh"
dark = "dark1.imh"
flat = "flatsky1.imh"
- Run the ccdproc task, either from the command line or
using epar.
- Check the file that this worked correctly. Use imhead
with the "long" option to check the values for the
calibration images. Use display to examine the
image.
- Analyze your Image Quality. See Course Outline.
- Combine your target fields:
- Shift your images so that they
are aligned using imalign. Imalign will
refine your estimate of the position of the
centres of stars in your images,
and calculate the shift needed to match each image up
to a reference image. Then it will shift the image.
More information is available via "help imalign".
- Pick the sharpest image to
be your reference image, that is, an image that
the others are shifted to match.
- In your reference image, using the
cursor in the image display, roughly
determine the centres of more than
3 stars that appear all the target images.
Enter these coordinates into
a text file with the first column for pixel x and the
second column for pixel y. (At the end of the line
for the last star enter a carriage return.) Here
is an example named refcoords.
- Estimate the sizes of the centering boxes.
To do this determine the largest separaton
of your reference
stars between images, including out to the faint "wings"
of the stars.
And determine the separation between images of
the peak brightness of the
same reference star. These 2 sizes
will be used for the bigbox and
boxsize parameters needed for centering.
You can look at the
PSF using imexamine. This will also give
you a centre for your star if you use the "r" key.
This key gives you a radial profile; plot parameters
can be set in rimexam. (Note to galaxy
researchers, you can set one of the axes to log so
that you can make an Intensity Profile.)
- If you have more than a few images to shift,
it is easiest to make an input list of names
and an output list with new names for your shifted
images. You can use any UNIX editor to do this
(e.g. textedit, vi, emacs; I can help you with emacs.)
Suppose you have images of different exposure times
and filters and you wish to combine those of 300 seconds
in the r filter.
To make your input list, in IRAF you can type:
dir
target* ncol=1 > inlist-r-300s
then type:
copy inlist-r-300s outlist-r-300s
Then edit
outlist-r-300s to give new names, so you
don't overwrite the originals, and save this edited file.
- If you have large shifts, you will have complexities.
In this case, do NOT trim the images.
Instead set trimimages="no".
- Epar the task imalign which is the task
that will calculate the stars' centres and shift your
target images. You can use the lists in the second
step to ensure your original images won't be
overwritten. The lists are inserted in the input
and output parameters with an @ as the prefix to the
listname. An example of settings is
in imalign.list.
- Run imalign and copy the verbose information
on your screen into your logfile. Note
that your images will be trimmed to the common area
in all your images.
- Place your shifted images into the image display
in different frames and blink them to confirm the
shift worked.
- If you have used at least 5 stars and
your images do not shift accurately, see the section
on Complexities.
- Combine your images using imcombine:
Use images from the same filter and the same exposure
time. (See the section on
Complexities if you have different exposure times.)
- Use imcombine
- If you have more than 2 images then median the
images together. If you have 2, then average
them.
- You can try to compensate for different observing
conditions by scaling the images. Pick a region within
the image that is free of stars or the galaxy and
use this as the region for the statistics.
An example of parameters for scaling is shown in
combine.avgscale.list.
- An example of parameters for averaging using the
simplest combination algorithm is shown in
combine.avg_noscale.list.
- If you have only 2 images, and need to remove cosmic
rays and other defects, you can use a clipping algorithm.
For clipping, check out the specifications for readnoise
and gain for the ccd and have the task produce a sigma
image displaying clipped pixels to check that the
algorithm isn't producing artefacts.
- Remove cosmetic defects:
To remove cosmetic defects such as cosmic rays and satellite
trails, one can use imedit. Check the help file to learn
how to interactively edit your data.
- Save your greyscale stretches:
- By setting the parameters in the display task you
can display all of your raw data values or your can re-map
the display to show different features. (See
Complexities below.)
- Once displayed
these stretches can be saved to fits files which can be put
into other manipulation packages (such as GIMP or PhotoShop)
- In an image manipulation package, make further
contrast adjustments and save in tiff, gif and/or
jpeg formats.
- Flatfielding:
- Divide by zero error. If you get an arithmatic
error during flatfielding, it means that there are numbers
between 1 and zero (i.e. fractions) that during division
are causing the pixel value to blow up to infinity. The
offending pixels can be replaced using imreplace.
Read the help file and speak to Jayanne.
- Different exposure times:
The simplest thing to do to get them to give the same counts per
second, is to divide all images by exposure time in each of their
headers using imarith. Then you don't have to keep track
of how to scale images, etc.
- Images won't align:
If you have used at least 5 stars and
your images do not shift accurately, then you may need
to refine the estimates of the centres of your stars.
This can be done using imcentroid and the
resultant shifts need to be listed in a file which
can be input into the "shifts" parameter in imalign.
Read these tasks' help files for more information and talk
to Jayanne.