This part of the cookbook provides a set of worked examples of reducing fibre spectroscopy observations from various instruments. The examples are:
The example of reducing Hydra data is available as part of the documentation for IRAF. The procedure is similar to, but simpler than, the procedure for reducing FLAIR data. Consequently it is sensible to work through the Hydra example before trying the FLAIR one.
All the examples assume that the requisite software is already installed at your site and ready for use. If the software is not available at your site then Section 7 describes how to obtain it. Note, however, that you will often require the assistance of your site manager to install the software.
Copies of the data files used in the examples are provided so that you can work through them yourself. On Starlink systems they are kept in directory:
Alternatively they can be retrieved by anonymous ftp from Edinburgh. The details are as follows:
site: | ftp.roe.ac.uk |
directory | /pub/acd/misc |
file | sc14.tar.Z |
Reply anonymous
to the ‘Name
’ prompt and give your e-mail address for the password. Set ftp to binary mode
before retrieving the file. The file is a compressed tar archive and should be decompressed with the Unix
command uncompress
(sic).
In order to work through the examples you should use a display capable of receiving X-output (typically an X-terminal or a workstation console). Strictly speaking the software will run on a black-and-white device, but realistically you need a colour display. Before starting you should ensure that your display is configured to receive X-output.
Finally, the examples show only some of the features of the various packages used. In all cases they have additional features which are not described here. You should see the appropriate user manuals for full details.
Hydra is a fibre spectrograph available at the Kitt Peak National Observatory (KPNO), Tucson (see, for example,
Barden et al.[7]). Observations acquired with it are usually reduced using the IRAF task dohydra
. dohydra
is
very similar to the IRAF task dofibers
which is used to reduce FLAIR and WYFFOS/AUTOFIB2 data. A
worked example of using dohydra
is available as part of the IRAF documentation. This example is similar to,
though simpler and easier than, the example of reducing FLAIR data given in Section 12, below. Thus, it is
sensible to work through the Hydra example before trying the FLAIR one, even though you are unlikely to
observe with Hydra.
Before trying the Hydra (or FLAIR) example you should already be familiar with the rudiments of IRAF and have an ‘IRAF directory’ prepared which you will use for running IRAF. If you are not au fait with IRAF then you must familiarise yourself with it before proceeding; SG/12: An Introduction to IRAF[34] is a convenient starting point.
The dohydra
tutorial is available at URL:
You can simply follow the instructions given and there is no need to repeat them here. There are, however, a couple of caveats which you should be aware of.
dohydra
parameters
recommended in the tutorial. It is available as file:
You should make a copy of this file in your IRAF home directory. Then from the IRAF command line type:
For information the script echoes the values that it sets to the IRAF command line.
FLAIR observations are usually reduced using IRAF (see Section 7.3.1) and this example is a simple demonstration of the procedure. The reduction of FLAIR data is documented in the manual FLAIR Data Reduction with IRAF[20]. The present example gives all the steps involved in a simple reduction but nonetheless you will find it useful to have a copy of the manual to hand as you work through it for further explanation of each step and future reference.
The example assumes that you are familiar with the rudiments of IRAF and already have an ‘IRAF directory’ prepared which you will use for running IRAF. If you are not au fait with IRAF then you must familiarise yourself with it before proceeding; SG/12: An Introduction to IRAF[34] is a convenient starting point. Reducing FLAIR observations with IRAF is similar to, but more complicated than, reducing Hydra observations, which was described in the previous example (Section 11, above). Consequently, it is sensible to work through the Hydra example before trying the present one.
The data used in this example are observations of some early-type stars in the direction of the Galactic centre. The stars are in the magnitude range 12 to 16 and the spectra cover the wavelength range 4000–4600Å. These data are unusual in that most FLAIR observations are of external galaxies. Nonetheless they can be used to illustrate the reduction procedure, which is as follows.
/star/examples/sc14/flair
. Copy these files to your IRAF directory:
The various files will be introduced as they are required. However, they are all listed in file
0FLAIR.LIS
.
loginuser.cl
provided with SG/12 to ensure that IRAF is configured correctly to handle the large
headers in FLAIR files (if you do not use this customisation file you may or may not encounter problems,
depending on how IRAF is configured at your site).
If any of the packages are not found then the most likely explanation is that they are not installed at your site; ask your site manager to install them. See Section 7.3 for details of how to obtain the FLAIR software and SG/12 for the standard IRAF packages.
flairsetup.cl
is provided with the example. It simply sets all the required values. It is correct
for the example data and can simply be used unaltered. However, if you wish to use it with your own data
there are couple of items which may need to be changed. Section 12.1 gives the details. To define and run
the script simply type:
For information the script echoes the values that it sets to the IRAF command line.
.fts
. They must be converted to the IRAF OIF format.
Rather than specifying all the file names individually they have previously been listed in file fits.lis
provided with the example (you might like to examine this file and check that it is just a list of file names).
The procedure for making the conversion differs slightly depending on which version of IRAF you are
using:
Here task imhead
extracts the header information and the IRAF cl
Unix-like output redirection
mechanism is used to write it to file heads.txt
. The contents of this file should be:
A copy of the output is also provided in file flairheads.txt
for comparison. It is obvious from this
output which file contains which sort of observation.
fixhead
is provided as part of the FLAIR software for this
purpose. Type:
The corrected data are written to images called flair101
to flair124
and the original images are
deleted.
zero.lis
. The master bias frame will simply be called zero
.
Type:
flatcombine
. Again there is a list of flat fields in file
flat.lis
and the master flat field will be called flat
. Type:
As usual, the arc and object frames are listed in file ccdproc.lis
. The flat field frame, flat
, should be
similarly corrected. Type:
flair108
and flair109
) and
two containing a mercury-cadmium arc (images flair110
and flair111
). The spectra used
in this example cover only a relatively narrow wavelength range and thus contain only a
few lines. Consequently the two types of arc must ultimately be added in order to provide
enough lines for wavelength calibration. However, prior to this step the arcs of the same
type are combined using combine
which detects and rejects cosmic-ray events in the images.
Type:
The final master arc frame is called arc
.
obj.lis
.
Type:
The master object frame is simply called obj
.
For FLAIR data an aperture identification file can be created automatically from the log file produced
when the fibres were positioned. This log file is usually called af.log
. Simply type:
where apid.txt
is the new aperture identification file. Alternatively the file can be created from scratch
using a text editor and your notes on positioning the fibres. However you create the file you need to be
familiar with its format and contents for subsequent operations. Figure 6 shows the first few lines of a
typical file. The lines beginning with a hash-character (‘#
’) are comments and can be ignored. Each
remaining line corresponds to one fibre and there is one line for every fibre in the instrument. The three
items on each line are, from left to right:
target astronomical object | 1 |
sky | 0 |
broken or ‘blanked off’ fibre | -1 or 1 |
If the fibre was pointing at sky then the object identification should be set to 999.
If the fibre was broken, blanked off or otherwise not in use it should be set to either 0 or 888.
You should print out a copy of file apid.txt
to assist in identifying the spectra in the next step. You might
find it convenient to underline or otherwise highlight the fibres which are pointing at target objects or
sky.
obj
using dofibers
. This process is highly interactive. Because there are
multiple spectra in the frame some operations need to be done repeatedly, once per spectrum.
Typically you will process the first one interactively to set the necessary parameters and then
process the rest automatically. IRAF has features to facilitate this sort of operation. Some
prompts can be answered with any of: ‘yes
’, ‘no
’, ‘YES
’ or ‘NO
’. The lower case replies apply only
to the current query. The upper case replies apply to all similar queries. To start dofibers
type:
Note that the master flat field frame (flat
) is being used to define the apertures and for the throughput
corrections. The following messages and prompts appear:
Reply yes
to the prompts or just hit return. A plot similar to Figure 7 should appear. It shows a slice
through the tramlines frame perpendicular to the dispersion direction. dofibers
has attempted to identify
the spectra but it will undoubtedly have made some mistakes which you will need to correct.
You need to ensure that each genuine spectrum (object or sky) is correctly identified and no
blanked off spectra are identified by mistake. You do this by comparing the identifications
shown in the plot with the entries in the aperture identification file, apid.txt
and changing
the identifications in the plot until they agree with the file. The following points might be
useful.
dofibers
makes several misidentifications in the first
few fibres. In this case it is less confusing to start with the highest numbered fibres and work
down, rather than vice versa.
You interact with the plot by positioning the cursor and issuing one or two character commands from
the keyboard. Help information about the commands available can be obtained by typing
<shift>?
, followed by hitting the space bar a few times to work through it and finally q
to return
to the interactive session. However, a few of the most useful commands are summarised
below.
w j
w k
w t
w b
w a
r
d
i
q
Once you have finally got the numbered spectra to agree with the entries in the aperture
identification file (which will take some time!) type q
to quit this stage and proceed to the
next.
dofibers
traces the positions along the dispersion axis:
A plot similar to Figure 8 appears. For the example data you can simply accept the fit and type q
and
proceed to the next step. However, for other data you might want to edit the fit. dofibers
then
prompts:
Reply NO
(in upper case) so that the trace is applied to all subsequent spectra.
A plot similar to Figure 9 is drawn. You may need to adjust the plot limits to make your plot appear similar to Figure 9; use the plot manipulation commands given above. You need to identify the lines and enter their wavelengths. For the example data the wavelengths are marked on the plot. The example data contain unusually few lines, of which four are suitable for wavelength calibration. Using this small number of lines is conveniently simple for the example. However, the FLAIR arc lamps usually produce spectra with more lines and it is often desirable to have as many lines as practical in order to improve the calibration. FLAIR support staff should be able to advise about where to find suitable wavelengths. Proceed as follows.
m
. You will then be prompted to
enter the appropriate wavelength in Å.
f
to perform a fit.
:order
followed by the required
order. A second order fit is adequate for the example data. Type f
again to re-fit the points
with the new order.
q
.
dofibers
makes a preliminary wavelength calibration using the lines you have given, attempts to find
further lines and displays all the additional lines it has found. You are then invited to inspect and amend
these additional identifications. For the example data it is probably best to delete all the additional
identifications. The useful commands are:
z
n
d
q
You will then be prompted:
Reply NO
. dofibers
should display a list of line identifications and residuals:
and prompt:
Again reply NO
.
Reply yes
and finally a plot of all the sky spectra will be drawn, similar to Figure 10. Again you may need
to adjust the axes to reproduce the plot shown. You should delete any sky spectra which appear to deviate
from the norm. In the example data no sky spectra need to be deleted. However, the procedure to delete a
spectrum is to position the cursor over it and type d
. Once you are happy with the remaining
spectra type q
to quit. You will be prompted for the technique to be used to combine the sky
spectra:
reply avsigclip
. dofibers
then terminates.
obj.ms
(‘.ms
’ for multiple spectra). To plot them type:
You will be prompted:
A plot similar to Figure 11 should appear. The axis ranges are adjusted in the usual way. Use )
and (
to
step through the spectra (forwards and backwards respectively). When you have finished inspecting the
spectra type q
to quit.
The FLAIR setup script flairsetup.cl
, is, of course, just a simple text file which can be listed or edited from
the Unix shell. In order to use the file with your own data there are a couple of items which may need to be
changed.
You should set the items combine.rdnoise
and dofibers.readnoise
to the readout noise of the CCD chip. The
value can be obtained from the FLAIR Web pages.
You may also need to alter the extents of the bias and trim regions (ccdproc.biassec
and ccdproc.trimsec
respectively). If you are unsure about the appropriate values then the FLAIR support staff should be able to
advise.
This example demonstrates the use of the 2dFDR (2dF Data Reduction) package for reducing 2dF observations. 2dFDR was written at the AAO specifically for the reduction of 2dF data and it is the usual way to reduce these data. The example works through a complete simple reduction but nonetheless only shows a few of the features of the 2dFDR package. For a full description you should see the 2dF User Manual[3]. You need a colour display to use 2dFDR.
A sample dataset is available from the AAO and it is used in the present example. It is not included in the usual example directory for the present cookbook, but rather you should download it from the AAO along with 2dFDR (see below). The data comprises observations of galaxies with Bj<19.7 and quasars with Bj<21. They were acquired in January 1998 using 2dF plate 0 and spectrograph 1 and include arcs, flat fields, offset skys and target galaxy and quasar spectra. Though the observations are genuine the celestial coordinates have been randomised to preserve the proprietary rights of the original observers. The data are provided courtesy of the 2dF Bright Galaxy Survey and 2dF QSO Survey teams.
The procedure to use 2dFDR is as follows.
All that is required to install 2dFDR is to simply extract the files from the tar archive. Similarly the
example data are just extracted from the archive. For further details see file README
included with
each tar archive.
DRCONTROL_DIR
to the name of
the directory where you have copied the files. For example, if I had put the files in directory
/home/acd/2dfdr
I would type:
To set up for running 2dFDR type:
(The ‘&
’ is, of course, simply to run drcontrol
as a detached process.) A series of windows should
appear.
29jan0033.sdf
(which is a flat field
and consequently suitable). Then click the OK button. A stream of processing information should be
displayed in the terminal window from which you are running drcontrol
and the main
window.
fibposa1.dat
should be created in the example data
directory.
drcontrol
terminal
window.
drcontrol
terminal window and the main window.
29jan0034.sdf
, 29jan0035.sdf
and 29jan0036.sdf
. These files contain object
frames and by combining them cosmic-ray events can be removed.
First click on file 29jan0034.sdf
in the Files: box and then click on the
>ADD>
button. The file name (with a complete directory specification) should appear in the Files to be Combined
box on the right hand side of the window. Repeat the procedure for files 29jan0035.sdf
and
29jan0036.sdf
. When you are finished the appearance of the window should be similar to Figure 16. If
you add the wrong file by mistake then simply click on the REMOVE button. When you have assembled
the correct list of files click on the OK button. Further output will be displayed in the drcontrol
terminal
window.
combined_frames.sdf
. This file is a two-dimensional array,
with one axis corresponding to the fibre number (ranging from 1 to 200) and the other to
wavelength.
The individual spectra can be plotted, for example, with Figaro (see SUN/86[43]). Type:
To start Figaro. Then type:
As is usual for Starlink software, the file name is specified without the .sdf
file type. Also note how the backslash
(‘∖’)
is used to prevent the brackets being interpreted by the Unix shell (the use of Starlink applications from
the Unix shell is discussed further in SC/4: C-shell Cookbook[15]). Simply hit return in response to the
additional prompts from splot
. Here spectrum number 90 is being displayed. A plot similar to Figure 17
should appear.
I am grateful to numerous people who contributed their time, expertise and data during the preparation of this cookbook. Nigel Hambly provided the data used in Section 12 and demonstrated the reduction of FLAIR data with IRAF. Dave Bowen provided the data used in Figures 3 and 4 and demonstrated the reduction of WYFFOS/AUTOFIB2 data with IRAF. Martin Clayton did much of the preliminary work on which the document is based. I had extremely useful discussions with Malcolm Currie and Quentin Parker. All the above and also Karl Glazebrook, Fred Watson, Don Pollacco, Jim Lewis, Harvey MacGillivray, Martin Bly and Rodney Warren-Smith either answered queries and/or provided useful comments on the draft version of the cookbook.
Any mistakes, of course, are my own.
[1] J. Allington-Smith, P. Bettess, E. Chadwick, R. Content, R. Davies, G. Dodsworth, R. Haynes, D. Lee, I. Lewis, J. Webster, E. Atad, S. Beard, R. Bennett, M. Ellis, P. Hastings, P. Williams, T. Bond, D. Crampton, T. Davidge, M. Fletcher, B. Leckie, C. Morbey, R. Murowinski, S. Roberts, L. Saddlemyer, J. Sebesta, J. Stilburn and K. Szeto, 1997, in Kontizas et al. op. cit. ([28]), pp73-79.
[2] S. Arribas, E. Mediavilla and F.G. Watson (eds), 1998, Fiber Optics in Astronomy III, Astronomical Society of the Pacific Conference Series, 152.
[3] J.A. Bailey and K. Glazebrook, 1997, 2dF User Manual (Anglo-Australian Observatory: Sydney).
[4] S.C. Barden (ed), 1988, Fiber Optics in Astronomy, Astronomical Society of the Pacific Conference Series, 3.
[5] S.C. Barden (ed), 1995, Fiber Optics in Astronomical Applications, Proc. SPIE, 2476.
[6] S.C. Barden 1998, in Arribas et al. op. cit. ([2]), pp14-19.
[7] S.C. Barden, T. Armandroff, P. Massey, L. Groves, A.C. Rudeen, D. Vaughnn and G. Muller, 1993, in Gray op. cit. ([21]), pp185-202.
[8] J. Barnes, 1993, A Beginner’s Guide to Using IRAF (National Optical Astronomy Observatories: Tucson). See SG/12 op. cit. ([34]) for details of obtaining IRAF manuals.
[9] D.V. Bowen, M. Pettini and B.J. Boyle, 1998, Mon. Not. R. Astron. Soc, 297, pp239-250.
[10] R.D. Cannon, 1997, in Kontizas et al. op. cit. ([28]), pp33-40.
[11] J.W. Chamberlain, 1961, Physics of the Aurora and Airflow, International Geophysics Series, 2, (Academic Press: New York).
[12] Y. Chu, 1997, in Kontizas et al. op. cit. ([28]), pp67-72.
[13] M.J. Clayton, 1998, SC/7.2: Simple Spectroscopy Reductions (Starlink).
[14] M.J. Currie and D.S. Berry, 1998, SUN/95.13: KAPPA – Kernel Application Package (Starlink).
[15] M.J. Currie, 1998, SC/4.2: C-shell Cookbook (Starlink).
[16] M.J. Currie, G.J. Privett, A.J. Chipperfield, D.S. Berry and A.C. Davenhall, 1998, SUN/55.10: CONVERT – A Format-conversion Package (Starlink).
[17] A.C. Davenhall, 1998, SUN/190.6: CURSA – Catalogue and Table Manipulation Applications (Starlink).
[18] A.C. Davenhall, G.J. Privett and M.B. Taylor, 1999, SC/5.2: The 2-D CCD Data Reduction Cookbook (Starlink).
[19] P.W. Draper, 1998, SUN/139.9: CCDPACK – CCD Data Reduction Package (Starlink).
[20] M. Drinkwater and B. Holman, 1996, FLAIR Data Reduction with IRAF (Anglo-Australian Observatory: Sydney).
[21] P.M. Gray (ed), 1993, Fiber Optics in Astronomy II, Astronomical Society of the Pacific Conference Series, 37.
[22] W.D. Heacox and P. Connes, 1992, Astron. Astrophys. Rev, 3, pp169-199.
[23] J.Hecht, 1998, Understanding Fiber Optics, (Prentice Hall: Saddle River, New Jersey).
[24] J.Hecht, 1999, City of Light, (Oxford University Press: Oxford).
[25] J.M. Hill, 1988, in Barden op. cit. ([4]), pp77-92.
[26] J.M. Hill, J.R.P. Angel, J.S. Scott, D. Lindley and P. Hintzen, 1980, Astrophys. J. Lett, 242, ppL69-L72.
[27] D.C. Kay and J.R. Levine, 1995, Graphics File Formats, second edition
(Windcrest/McGraw-Hill: New York). See in particular Chapter 18, pp235-244.
[28] E. Kontizas, M. Kontizas, D.H. Morgan and G.P. Vettolani (eds), 1997, Wide-Field Spectroscopy (Kluwer Academic Publishers: Dordrecht).
[29] J.R. Lewis, 1996, WYFFOS Data Reduction Manual (Royal Greenwich Observatory: Cambridge).
[30] C. Lissandrini, S. Cristiani and F. La Franca, 1994, Publ. Astron. Soc. Pacific, 106, pp1157-1164.
[31] S.J. Maddox and A. Aragón-Salamanca (eds), 1995, Wide Field Spectroscopy and the Distant Universe, the 35th Herstmonceux Conference (World Scientific: Singapore).
[32] P. Massey, 1997, A User’s Guide to CCD Reductions with IRAF (National Optical Astronomy Observatories: Tucson). See SG/12 op. cit. ([34]) for details of obtaining IRAF manuals.
[33] P. Massey, F. Valdes and J. Barnes, 1992, A User’s Guide to Reducing Slit Spectra with IRAF (National Optical Astronomy Observatories: Tucson). See SG/12 op. cit. ([34]) for details of obtaining IRAF manuals.
[34] R. Morris, G.J. Privett and A.C. Davenhall, 1998, SG/12.1: IRAF – Image Reduction Analysis Facility (Starlink).
[35] R. Morris and G.J. Privett, 1966, SUN/166.4: SAOIMAGE – Astronomical Image Display (Starlink).
[36] G.W. Nelson, 1988, in Barden op. cit. ([4]), pp2-22.
[37] Q.A. Parker, 1997, in Kontizas et al. op. cit. ([28]), pp25-31.
[38] Q.A. Parker and M. Hartley, 1997, in Kontizas et al. op. cit. ([28]), pp17-23.
[39] Q.A. Parker, F.G. Watson and S. Miziarski, 1998, in Arribas et al. op. cit. ([2]), pp80-91.
[40] I.R. Parry, 1997, in Kontizas et al. op. cit. ([28]), pp3-16.
[41] I.R. Parry, 1998, in Arribas et al. op. cit. ([2]), pp3-13.
[42] I.R. Parry and E. Carrasco, 1990, in Instrumentation in Astronomy VII, Proc. SPIE, 1235 pp702-708.
[43] K.T. Shortridge, H. Meyerdierks, M.J. Currie, M.J. Clayton, J. Lockley, A.C. Charles, A.C. Davenhall and M.B. Taylor, 1998, SUN/86.16: FIGARO – A General Data Reduction System (Starlink).
[44] F. Valdes, 1992, Guide to the Multifiber Reduction Task DOFIBERS (National Optical Astronomy Observatories: Tucson). See SG/12 op. cit. ([34]) for details of obtaining IRAF manuals.
[45] F. Valdes, 1992, Guide to the Slit Spectra Reduction Task DOSLIT (National Optical Astronomy Observatories: Tucson). See SG/12 op. cit. ([34]) for details of obtaining IRAF manuals.
[46] G. Walker, 1987, Astronomical Observations – An Optical Perspective (Cambridge University Press: Cambridge).
[47] R.F. Warren-Smith, 1998, SUN/33.6: NDF – Routines for Accessing the Extensible N-Dimensional Data Format (Starlink).
[48] F.G. Watson, 1995, in Maddox and Aragón-Salamanca op. cit. ([31]), pp25-32.
[49] F.G. Watson, A.R. Offer, I.J. Lewis, J.A. Bailey and K. Glazebrook, 1998, in Arribas et al. op. cit. ([2]), pp50-59.
[50] D.C. Wells, E.W. Greisen, and R.H. Harten, 1981, Astron. Astrophys. Suppl, 44, pp363-370.
[51] F.G. Wyse and G. Gilmore, 1992, Mon. Not. R. Astron. Soc, 257, pp1-10.