---++!! !AAOmega File Format (or, which spectrum is which object?) %TOC% ---+++ Download the software 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 the relevant information is contained within the combined output file(s). The page that follows attempts to describe how to recover this information. The process is _simple_, once one follows the _logic_. However, it can seem rather convoluted at first sight. Please send any questions, comments and suggestion you may have on how to make this information more digestible, to Rob Sharp (<a href="mailto:rgs@aao.gov.au">rgs@aao.gov.au</a>). 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 >WxN image containing the spectrum (W pixels long) for each fibre of the N spectra >First Extension >.fits[1] >WxN image containing the Variance array for the data >Second Extension =.fits[2] >binary table</span>, with N rows, one for each fibre Each Row contains information for each object such as RA, Dec, 2dF Pivot number and more</td> Details to be added Seventh Extension =.fits[7]= Sky spectrum Stored as a FITS <span style="font-family: monospace;">binary table</span>, with W rows.<br /> Each row contains the one element of the <span style="font-style: italic;">'typical'</span> sky spectrum used in the data reduction (<span style="font-style: italic;">'typical' </span>because for a combined frame it is not obvious how the final sky spectrum for each fibre should be represented here).<br /> Note: The variance information is correctly propagated, the sky spectrum is not presented here for this purpose. </td> These extension can be accessed in a number of ways. A number of example are provided <a href="#Example_for_accessing_the_fits_Binary">below</a>, if you have an alternate suggestion or an example that should be added to this list (or if something does not seem to work), please contact Rob Sharp (<a href="mailto:rgs@aao.gov.au">rgs@aao.gov.au</a>).<br /> <br /> The primary image in the <span style="font-family: monospace;">MEF fits</span> file is a WxN image where N is the number of spectra which are 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 fibres spectra, even though the spectra contain no information, as this is seen to simplify book keeping, and is a small disc space overhead. 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, and is explained separately below.<br /> <br /> <h4><a name="A_important_note_on_2dF_Fibre-Pivot"></a><span style="font-weight: bold;">An important note on 2dF Fibre-Pivot number and 2dfdr Fibre number</span></h4> There are two very important, and very different, number which one must understand in order to recover the information on which object each fibres was allocated to. <span style="font-weight: bold;">Fibre slit position</span> AND <span style="font-weight: bold;">2dF Fibre-Pivot position</span>. 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 some times possible for the order of fibres in each of the AAOmega slits to fall out of synchronization with the 2dF Pivot numbering (2 slit block on each plate currently (April 2007) are like this). 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 <span style="font-family: monospace;">binary table extension</span>.<br /> <span style="font-weight: bold;"><br /> </span>In the primary image (and also the variance array, stored in the first <span style="font-family: monospace;">extension</span>) the fibre at the bottom of the image, which is the fibre at <span style="font-weight: bold;">slit position 1</span>, corresponds to the first row in the <span style="font-family: monospace;">binary table extension</span> (the second <span style="font-family: monospace;">fits</span> extension). The table contains a column entry, <span style="font-weight: bold;">PIVOT</span>, which gives the <span style="font-weight: bold;">2dF pivot position</span> for this fibre. This is the <span style="font-style: italic;">fibre number</span> seen be the <span style="font-family: monospace;">Configure</span> software. The very top fibre in a CCD image corresponds to the very last entry in the <span style="font-family: monospace;">binary table</span> (which will be an AAOmega guide fibre in the case of a single AAOmega data set). There is <span style="color: rgb(255, 0, 0);">ALWAYS</span> a one-to-one correspondence between each spectrum position in the image and the <span style="font-family: monospace;">binary table</span>. There is <span style="font-style: italic;">typically</span> a one-to-one correspondence between <span style="font-weight: bold;">slit position</span> and <span style="font-weight: bold;">2dF pivot position</span> but with a number of known mismatches and discontinuities which are tracked via the <span style="font-weight: bold;">PIVOT</span> column of the <span style="font-family: monospace;">binary table</span>. <h4><a name="Combining_multiple_AAOmega_data_sets_"></a>Combining multiple AAOmega data sets which contain a common subset of targets</h4> To be added <h4><a name="Binary_Table_columns"></a>Binary Table columns</h4> <table style="text-align: left; width: 747px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="width: 95px; font-weight: bold; background-color: rgb(192, 192, 192);">Column</td> <td style="width: 207px; font-weight: bold; background-color: rgb(192, 192, 192);">Column name</td> <td style="width: 419px; font-weight: bold; background-color: rgb(192, 192, 192);">Description</td> </tr> <tr> <td style="width: 95px;">1</td> <td style="width: 207px;">Name</td> <td style="width: 419px;">Object name, as given in the <span style="font-family: monospace;">.fld</span> file</td> </tr> <tr> <td style="width: 95px;">2</td> <td style="width: 207px;">RA</td> <td style="width: 419px;"><span style="font-family: monospace;"></span>Right Ascension from the <span style="font-family: monospace;">.fld</span> file</td> </tr> <tr> <td style="width: 95px;">3</td> <td style="width: 207px;">Dec</td> <td style="width: 419px;">Declination from the <span style="font-family: monospace;">.fld</span> file</td> </tr> <tr> <td style="width: 95px;">4</td> <td style="width: 207px;">X</td> <td style="width: 419px;">2dF field plate X co-ordinate (in microns)</td> </tr> <tr> <td style="width: 95px;">5</td> <td style="width: 207px;">y</td> <td style="width: 419px;">2dF field plate Y co-ordinate (in microns)</td> </tr> <tr> <td style="width: 95px;">6</td> <td style="width: 207px;">Xerr</td> <td style="width: 419px;">Reported error in X in final fibre placement</td> </tr> <tr> <td style="width: 95px;">7</td> <td style="width: 207px;">Yerr</td> <td style="width: 419px;">Reported error in Y in final fibre placement</td> </tr> <tr> <td style="width: 95px;">8</td> <td style="width: 207px;">Theta</td> <td style="width: 419px;">Angle of fibre on field plate</td> </tr> <tr> <td style="width: 95px;">9</td> <td style="width: 207px;">Type</td> <td style="width: 419px;">Fibre type (P-program, S - Sky, U-unused etc...)</td> </tr> <tr> <td style="width: 95px;">10</td> <td style="width: 207px;"><a href="#A_important_note_on_2dF_Fibre-Pivot">Pivot</a></td> <td style="width: 419px;">2dF fibre pivot number</td> </tr> <tr> <td style="width: 95px;">11</td> <td style="width: 207px;">Magnitude</td> <td style="width: 419px;">Object magnitude, as given in the <span style="font-family: monospace;">.fld</span> file</td> </tr> <tr> <td style="width: 95px;">12</td> <td style="width: 207px;">PID</td> <td style="width: 419px;"></td> </tr> <tr> <td style="width: 95px;">13</td> <td style="width: 207px;">Comment</td> <td style="width: 419px;">Comment from the <span style="font-family: monospace;">.fld</span> file</td> </tr> <tr> <td style="width: 95px;">14</td> <td style="width: 207px;">Retractor</td> <td style="width: 419px;">2dF retractor number</td> </tr> <tr> <td style="width: 95px;">15</td> <td style="width: 207px;">Switch Field</td> <td style="width: 419px;"></td> </tr> <tr> <td style="width: 95px;">16</td> <td style="width: 207px;">Switch Partner</td> <td style="width: 419px;">For cross beam switched data, the paired fibre is indicated (fibre slit position number)</td> </tr> <tr> <td style="width: 95px;">17</td> <td style="width: 207px;">Wlen</td> <td style="width: 419px;"></td> </tr> </tbody> </table> <br /> <h1><a name="Example_for_accessing_the_fits_Binary"></a><span style="font-weight: bold;"></span><a name="Example_for_acessing_the_fits_Binary"></a>Example for accessing the fits Binary table information</h1> This list is not exhaustive, if your favorite option is missing, send an e-mail to <a href="mailto:rgs@aao.gov.au">Rob Sharp (rgs@aao.gov.au)</a> and we'll add it to the list. <h4><a name="With_Configure"></a>With Configure</h4> One can save a list file (file menu -> ..list) which contains the allocated 2dF <a href="#A_important_note_on_2dF_Fibre-Pivot">Fibre-Pivot</a> number for each allocated fibre. <span style="color: rgb(255, 0, 0);">Note</span>, this is the <a href="#A_important_note_on_2dF_Fibre-Pivot">Pivot</a> number for 2dF NOT the fibre number in the reduced 2D spectra file.<br /> <br /> <h4><a name="Within_2dfdr"></a>Within 2dfdr</h4> To be added <h4><a name="2dfinfo"></a>2dfinfo</h4> The <span style="font-family: monospace;">2dfinfo</span> procedure comes packaged with <span style="font-family: monospace;">2dfdr</span>. It can be used to recover information on the fibre from either a <span style="font-family: monospace;">.fits</span> or <span style="font-family: monospace;">.sdf</span> file. The syntax for the command is :<br /> <br /> <span style="font-family: monospace;">2dfinfo file.fits <option></span><br /> <br /> If the <span style="font-family: monospace;"><option></span> is omitted then the list of options is given. To recover the fibre table information one would use:<br /> <br /> <span style="font-family: monospace;">2dfinfo file.fits fibres</span><br /> <br /> <a style="font-weight: bold;" name="IRAF"></a><span style="font-weight: bold;">IRAF<br /> </span>The <span style="font-family: monospace;">IRAF/STSDAS</span> package <span style="font-family: monospace;">TABLES</span> has a number of routines designed, unsurprisingly, for manipulating tables. A simple example might be:<br /> <br /> <span style="font-family: monospace;">IRAF> tdump combined_frame.fits[2] > output.txt</span><br /> <br /> This would create a complete, if rather inelegant, listing of the <span style="font-family: monospace;">fibre info binary table</span> and pipe it to a <span style="font-family: monospace;">ascii</span> text file. Formating the output can be achieved with:<br /> <br /> <span style="font-family: monospace;">IRAF> tprint combined_frame.fits[2] columns="NAME,RA,DEC" > output.txt</span><br /> <br /> <span style="font-weight: bold;"></span> <br /> <a name="IDL"></a><span style="font-weight: bold;">IDL</span><br /> For users of IDL, the <a href="http://idlastro.gsfc.nasa.gov/">NASA IDL astronomy library</a> has some excellent fits data access routines<br /> <br /> Starting from a combined fits frame, <span style="font-family: monospace;">combined_frame.fits, </span>one might use the following code extracts to manipulate AAOmega data. Notes, there are much cleverer (and quicker) ways to perform the operations below with the NASA astrolib tasks, the code here is given as a set of simple examples.<br /> <br /> <span style="font-family: monospace;">file='combined_frame.fits'</span><br style="font-family: monospace;" /> <br /> ;; Read in the spectral image, store the header information<br /> <span style="font-family: monospace;">spec=mrdfits(dir+file_comb,0,header0)</span><br style="font-family: monospace;" /> ;; And the variance array<br /> <span style="font-family: monospace;">spec_var=mrdfits(dir+file_comb,1)</span><br style="font-family: monospace;" /> <br /> ;; Make a wavelength vector, note the use of CRPIX1, which is often not expected by many users.<br /> ;; If missed, the wavelength solution will tend to be wrong by half a CCD width<br /> <span style="font-family: monospace;"> crpix=fxpar(header0,'crpix1')</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> crval=fxpar(header0,'crval1')</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> cdelt=fxpar(header0,'cdelt1')</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> wave=((findgen(n_elements(spec[*,0]))-crpix)*cdelt)+crval</span><br style="font-family: monospace;" /> <br /> ;; Read in the object identification information <br /> <span style="font-family: monospace;"> fxbopen,unit,file,2</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> fxbreadm,unit $</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> ,['name','ra','dec','x','y','xerr','yerr','theta','type','pivot','magnitude'] $</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> ,id,ra,dec,x,y,xerr,yerr,theta,type,pivot,mag</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> fxbclose,unit</span><br style="font-family: monospace;" /> <br /> ;; And read a copy of the sky spectrum subtracted from the data.<br /> ;; Note, for a combined frame, this is the sky spectrum from the first file in the list of combined frames.<br /> ;; It is a good representative sky spectrum, but should be used with caution for the combined spectral data.<br /> <span style="font-family: monospace;"> fxbopen,unit,file,7</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> fxbreadm,unit,['SKY'],sky</span><br style="font-family: monospace;" /> <span style="font-family: monospace;"> fxbclose,unit</span><br style="font-family: monospace;" /> <br /> <br /> <br /> <small>Rob Sharp (<a href="mailto:rgs@aao.gov.au">rgs@aao.gov.au</a>)</small> </div> <!--#include virtual="/AAO/libs/footer.html" --> </div> </body> </html> -- Main.RonHeald - 14 Apr 2007
This topic: Main
>
AAOmegaFileFormat
Topic revision: r1 - 2007-04-14 - RonHeald
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback