TRES spectra

TRES Reduction Tasks
Doug Mink, 2009-Feb-11

Telescope Data Center
TRES ThAr Image
[TDC Home]  [TDC Search] [OIR Home]

[Definitions] [Preparation] [Observing Protocol] [Quicklook)] [Quick Pipeline)] [Full Pipeline)] [Reduction Software] [Software Packages)] [Distribution] [Archiving]

0. Start IRAF and load the tres package by typing

ecl> tres

#               TRES Data Reduction Package                 |
#           Smithsonian Astrophysical Observatory           |
#                   Telescope Data Center                   |
#                Version 1.3.2 March 19, 2009               |
#                    Processing steps at                    |
#  |

      btres       tcemsao     tfset       tmodid      trsavg      trspec
      ctres       tcosmic     tharadd     tmonth      trscode     trsproc
      ftres       tdata       tharlist    tpmake      trsdate     trssum
      qtres       tdisp       tharplot    tpreamp     trsdb       tsetbcv
      skyplot     tdispref    tharset     tpreamp1    trsdecode   tskysub
      stres       textract    thartable   tpreproc    trsdump     ttres
      tapref      tfib        tidref      tproc       trsfiles    tvxcsao
      tarith      tfib1       tlog        tpxcsao     trsgroup    txdelete
      tcal        tflat       tmakeflat   tquick      trslist     txdisp
      tcal1       tflatlist   tmakeref    trelearn    trsmed      txstat


   If the banner message says  *** Run trelearn to update parameters ***

tres> trelearn

   If this task crashes, run it again.  I haven't figured out how to deal
   cleanly with deleted parameters, but added parameters will now appear
   in your parameter files with their default values.

1. Run trsdate yyyy.mmdd to put yourself in the correct working directory

tres> trsdate 2009.0509
Date for images (now=today) (2009.0311): 2009.0509
tres> pwd

   If there is data taken for this date, a working directory will be created
   if it does not already exist, and directory parameters will be set to
   automatically use raw data from this date and work only in the appropriate
   working directory.

   The date is saved as a parameter, so if you have to leave IRAF for some
   reason, or make sure that you are in the right directory, all you have to
   to is

tres> trsdate
Date for images (now=today) (2009.0311): [return]
tres> pwd

The parameters of trsdate are:
    datedir = "now"
        This is the date portion of the directory path to the data given
        as yyyy.mmdd.  This date is determined by the local date at noon
        of the  day  observing  begins.  Unlike other IRAF tasks, the 
        trailing zero for a date ending in zero, such as 2008.1230, is
        replaced after the IRAF command line interpreter deletes it, so
        quotes do not have to be used.

    instdir = "/tres/"
        This is the name of the raw data directory.  It is prepended to
        datedir to get data directory.
        The default is the directory used on the Ridge.
        This is the name of the directory to be used for quicklook date
        directories.   The default is a subdirectory of the directory
        in which IRAF has been started.

2.  Do not use "cd" to change directories!
    Always use trsdate to get to a working directory inside IRAF.
    The TRES package tries really hard to keep you from doing anything
    to the raw data files, but it has to know what you are doing.
    You can use the following command to get to the raw directory
    for the date you have set with trsdate:

tres> tdata

     To get back to the working directory, use this command:

tres> tquick

3.  qtres 101
    qtres will process a single raw TRES image to a spectrum.
    You do not have to enter the full file name, only the sequence number.
    It does not remove cosmic rays/particle hits.

4.  ctres 101-105
    ctres will process a group of raw TRES images to spectra.
    You do not have to enter the full file names, only the sequence numbers
    as a range or list ("101,102,103").
    Cosmic rays/particle hits are removed using an algorithm developed
    by Nelson Caldwell which preserves information in the individual

5.  otres 101-105
    otres, like ctres, will process a group of raw TRES images to spectra.
    You do not have to enter the full file names, only the sequence numbers
    as a range or list ("101,102,103").
    Cosmic rays/particle hits may be removed using an algorithm developed
    by Nelson Caldwell which preserves information in the individual spectra.
    Scattered light can be removed from the image before the spectra are
    extracted, and the blaze function can be removed from the extracted
6.  Calibration files
    The following calibration files are used, where "mb" means medium
    aperture binned by two.  Other options include "sb" for small fiber
    binned by two, and "s" and "m" for small and medium unbinned fibers.
    darkb.fits          Dark Frame to remove light leak at blue end
    compmb1.fits        Fiber 1 ThAr
    compmb2.fits        Fiber 2 ThAr
    flatmb12.fits       Flat Field for extraction template
    flatmb12.flat.fits  Flat Field to remove pixel to pixel variations
    flatmb12.mask.fits  Mask file for scattered light removal    Fiber 1 blaze function removal normalized flat spectrum    Fiber 2 blaze function removal normalized flat spectrum

    If the file is in the working directory, qtres or ctres will use it.
    Otherwise the program will look in the IRAF tresdata$ directory and
    use the files there.
    Those default files usually work acceptably well for quick look.
    The Telescope Data Center tries to get current run defaults into
    the tresdata$ directory as soon as possible after a run starts.

7.  Viewing images:
    TXDISP displays any raw image in the current raw data directory using
    ds9.  You only need the sequence number, and it can be run from the
    working directory wherei trsdate out you.

tres> txdisp 101

    will display 0101.FLAT.fits on 2009.0608, for example.

8.  Viewing spectra
    To view ThAr COMP spectra with bright lines labelled, use

tres> tharplot 1

    plots the spectrum starting with the first order.  Use ")" to
    move to higher orders and "(" to move to lower orders.  The
    program wraps to order 51 from order 1 and order 1 from order 51.
    You can zoom with "z" at the blue and red ends of the part you
    want to see.
    To view any spectrum, use splot or trsplot, which allows line
    labelling like tharplot using the emsao program from RVSAO.

9.  Improving dispersion functions
    Run TTRES on ThAr exposures instead of using CTRES.
    If you run it on a group of COMP exposures at the beginning of
    the night and set ttres.compstd="first", a file of shifts from
    a standard will be set up and CTRES dispersions will be more
    accurate.  This is not necessary if you just want to see whether
    you got a signal, though.  As an example:

tres> ttres 21-23 compstd="first"

    will produce a file "compmb1.shift" if the files are fiber 1 COMPs
    or "compmb2.shift" if the files are fiber 2 COMPs.
    Successive uses of TTRES with the same fiber, for example

tres> ttres 41,47,58

    will add to the appropriate shift table, and CTRES run on spectra
    with times within in the shift table will use interpolated pixel
    shifts to improve their dispersion accuracy.
[Quick Pipeline Processing]