AAOmega file format
When analysing data from an AAOmega run, one needs to be able to map the combined spectra returned from the reduction task back to individual objects from the input catalogue. All of the relevant information is contained within the combined output file(s). This page describes how to recover this information.
Contents:
- Summary of the 2dfdr output file format
- An important note on 2dF Fibre-Pivot number and 2dfdr Fibre number
- Binary Table columns
- Examples for accessing the fits Binary table information
Summary of the 2dfdr output file format
The table below gives a summary of the 2dfdr output file content, for either the individual frame *red.fits files or a combined_frames.fits file. The file is a standard Multi-Extension FITS file (FITS MEF).
| IRAF format | Contents | |
| Primary image | .fits[0] | The primary extension in the .fits file is a WxN image containing the number of pixels in each spectrum and N is the number of spectra represented. This is 400 for AAOmega data (392 science fibres and 8 guide fibres). Unused science fibres and Sky spectra, are included in the output file along with the guide fibre spectra, even though the spectra contain no information. In the case where multiple sets of AAOmega datasets, which contained a subset of common objects, have been combined, the format is a little more complex. |
| First Extension | .fits[1] | The variance extension is also a WxN array identical in size to the primary extension. Each member contains the variance for the corresponding element in the primary extension. |
| Second Extension | .fits[2] | FITS binary table, with N rows, one for each fibre. Each Row contains information for each object such as RA, Dec, 2dF Pivot number and more |
| Other Extensions | ... | The files contain several other extensions which are generally only used when deeper analysis of the data is required. They are not necessarily in order and are accessed by name. |
| For example: | Sky spectrum Stored as a FITS binary table, with W rows. Each row contains the one element of the 'typical' sky spectrum used in the data reduction ('typical' because for a combined frame it is not obvious how the final sky spectrum for each fibre should be represented here). Note: The variance information is correctly propagated, the sky spectrum is not presented here for this purpose. |
These extensions can be accessed in a number of ways. A number of examples are provided below.
An important note on 2dF Fibre-Pivot number and 2dfdr Fibre number
There are two very important, and very different, numbers which one must understand in order to recover the information on which object each fibre was allocated to. Fibre slit position AND 2dF Fibre-Pivot position. For the most part there is a one-to-one correspondence between these number. Usually the fibre at AAOmega slit position 1 (bottom of the CCD image) will map directly to 2dF Pivot position 1, and 400 will map to 400 (note, 400 is a guide fibre and so maps to a blank space at the top of the CCD image). However, during manufacture or repair of each of the AAOmega slit units, it is sometimes possible for the order of fibres in each of the AAOmega slits to fall out of synchronization with the 2dF Pivot numbering. It is not practical to mechanically alter either position so each of the two fibre numbers (slit position and Pivot position) are propagated in the binary table extension.
In the primary image (and also the variance array, stored in the first extension) the fibre at the bottom of the image, which is the fibre at slit position 1, corresponds to the first row in the binary table extension (the second fits extension). The table contains a column entry, PIVOT, which gives the 2dF pivot position for this fibre. This is the fibre number seen by the Configure software. The very top fibre in a CCD image corresponds to the very last entry in the binary table (which will be an AAOmega guide fibre in the case of a single AAOmega data set). There is ALWAYS a one-to-one correspondence between each spectrum position in the image and the binary table. There is typically a one-to-one correspondence between slit position and 2dF pivot position but with a number of known mismatches and discontinuities which are tracked via the PIVOT column of the binary table.
Binary Table columns
The binary table lists, for each fibre, the columns listed in the table below:
| Column | Column name | Description |
| 1 | Name | Object name, as given in the .fld file |
| 2 | RA | Right Ascension from the .fld file |
| 3 | Dec | Declination from the .fld file |
| 4 | X | 2dF field plate X co-ordinate (in microns) |
| 5 | y | 2dF field plate Y co-ordinate (in microns) |
| 6 | Xerr | Reported error in X in final fibre placement |
| 7 | Yerr | Reported error in Y in final fibre placement |
| 8 | Theta | Angle of fibre on field plate |
| 9 | Type | Fibre type (P-program, S - Sky, U-unused etc...) |
| 10 | Pivot | 2dF fibre pivot number |
| 11 | Magnitude | Object magnitude, as given in the .fld file |
| 12 | PID | |
| 13 | Comment | Comment from the .fld file |
| 14 | Retractor | 2dF retractor number |
| 15 | Switch Field | |
| 16 | Switch Partner | For cross beam switched data, the paired fibre is indicated (fibre slit position number) |
| 17 | Wlen |
Examples for accessing the fits Binary table information
This list is not exhaustive.
With Configure
One can save a list file (file menu -> ..list) which contains the allocated 2dF Fibre-Pivot number for each allocated fibre. Note, this is the Pivot number for 2dF NOT the fibre number in the reduced 2D spectra file.
2dfinfo
The 2dfinfo procedure comes packaged with 2dfdr. It can be used to recover information on the fibre from the .fits file. The syntax for the command is:
2dfinfo file.fits <option>
If the <option> is omitted then the list of options is given. To recover the fibre table information one would use:
2dfinfo file.fits fibres
IRAF
The IRAF/STSDAS package TABLES has a number of routines designed for manipulating tables. A simple example might be:
IRAF> tdump combined_frame.fits[2] > output.txt
This would create a complete listing of the fibre info binary table and pipe it to an ascii text file. Formatting the output can be achieved with:
IRAF> tprint combined_frame.fits[2] columns="NAME,RA,DEC" > output.txt
IDL
For users of IDL, the NASA IDL astronomy library has some excellent fits data access routines
Starting from a combined fits frame, combined_frame.fits, one might use the following code extracts to manipulate AAOmega data. Note, there are cleverer (and quicker) ways to perform the operations below with the NASA astrolib tasks, the code here is given as a simple example.
file='combined_frame.fits'
;; Read in the spectral image, store the header information
spec=mrdfits(dir+file_comb,0,header0)
;; And the variance array
spec_var=mrdfits(dir+file_comb,1)
;; Make a wavelength vector, note the use of CRPIX1, which is often not expected by many users.
;; If missed, the wavelength solution will tend to be wrong by half a CCD width
crpix=fxpar(header0,'crpix1')-1.0 ; The -1.0 is needed as IDL is ZERO indexed
crval=fxpar(header0,'crval1')
cdelt=fxpar(header0,'cdelt1')
wave=((findgen(n_elements(spec[*,0]))-crpix)*cdelt)+crval
;; Read in the object identification information
fxbopen,unit,file,2
fxbreadm,unit $
,['name','ra','dec','x','y','xerr','yerr','theta','type','pivot','magnitude'] $
,id,ra,dec,x,y,xerr,yerr,theta,type,pivot,mag
fxbclose,unit
;; And read a copy of the sky spectrum subtracted from the data.
;; Note, for a combined frame, this is the sky spectrum from the first file in the list of combined frames.
;; It is a good representative sky spectrum, but should be used with caution for the combined spectral data.
fxbopen,unit,file,7
fxbreadm,unit,['SKY'],sky
fxbclose,unit
Sarah Brough (sb@aao.gov.au)