TRES spectra

TRES Reduction Tasks
Doug Mink, 2008-Mar-18

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

[Definitions] [Preparation] [Observation] [Reduction (Pipeline) (Software)] [Distribution] [Archiving]


Checking Data

Quick Look

There are two programs for running an approximate reduction of TRES data to see how the spectra look.

Bias and Dark Files

  1. tres.tpreproc files.fits cosmic-
    mscred.ccdproc trim+ overscan+ fixpix+ to bias-subtract, trim, and remove bad pixels from both apmlifiers of all files.
    tres.gaincorr corrects for gain variation between amplifiers. The raw files are moved to the Raw/ subdirectory, and the output files have the same names as the originals.
    tres.tampmerge is run to combine the two amps to single image FITS files.

  2. Check bias files by running tres.txstat on them.
    mscred.combine all of the bias files except those for which any amplifier stands out to an output Zero.fits file. implot it to check for missed bad columns. We are not subtracting bias images, and are relying instead on overscan removal to take care of any bias signal without adding noise from individual pixels.

  3. tres.txstat on dark files to check for light leaks.
    mscred.combine them to an output Dark.fits file.
    Check values using plot.implot.
    mscred.ccdproc dark+ on all data files if there is significant dark flux.

Flat Field Files

  1. Use tres.tflatfiles to group all of the FLAT files by fibsize, binning, and fibkey. Then break the lists up by exposure time, so the cosmic rays can be removed.

  2. tres.tpreproc @flatxx.list cosmic+
    where xx can be s sb m mb l lb, b indicating that the image has been binned by 2.
    mscred.ccdproc trim+ overscan+ fixpix+ to bias-subtract, trim, and remove bad pixels from all amplifiers of all files.
    tres.gaincorr corrects for gain variation between amplifiers. The raw files are moved to the Raw/ subdirectory, and the output files have the same names as the originals.
    tres.tampmerge flat.*.fits combines the two amps to single image FITS files.


    tres.tcosmic @flatxx.fits compares images with the same characteristics and removes cosmic rays from each exposure. Temporary median and limit files are created and my be deleted. Nelson Caldwell developed the algorithm which compares two files at a time, using statistics from the median file to figure out when to reject high pixels.

  3. tres.trssum @flatxx.list flatxx.fits combines multiple flat field exposures of the same type into a single image file.

  4. tres.tmakeflat flatxx12.fits
    tres.tmakeflat flatxx3.fits runs apfind, apedit, aptrace, and apflatten on summed dome flats to create pixel to pixel normalization files which are used in the next step to remove IR fringing, more or less.

  5. imarith flatxx12.flat.fits * flatxx3.flat.fits flatxx123.flat.fits
    Makes a flattening file for spectra with simultaneous calibration

  6. tres.tflat @flatxx.list removes fringing and pixel-to-pixel variations from flat files.

  7. Symbolically link (ln -s) flatxx12.fits to flatxx1.fits and flatxx2.fits.

  8. Copy apflatxx1.fits and apflatxx2.fits from tresdata$database/ to database/
    If the files are not there, run apfind and apedit on apflatxx1.fits and apflatxx2.fits.

  9. Run apedit and aptrace on flatxx1.fits, flatxx2.fits, and flatxx3.fits for each group to set up database files database/apflatxx1, database/apflatxx2, and database/apflatxx3 to be used for extraction.

  10. tres.textract flatxx.fits to make an aperture template and to make a pixel to pixel normalization file.

Calibration Lamp Files

  1. Use tres.tcompfiles to group all of the COMP files by fibsize, binning, and fibkey. Then break the lists up by exposure time, so the cosmic rays can be removed.
  2. tres.tproc @compxx.list flatten+ cosmic+ extract+ disperse+ to trim, remove overscan, merge, and flatten all COMP image files
    mscred.ccdproc trim+ overscan+ fixpix+ to bias-subtract, trim, and remove bad pixels from all amplifiers of all files.
    tres.gaincorr corrects for gain variation between amplifiers.
    tres.tampmerge is run to merge the two amplifiers of each comparison file to single image FITS files.
    The raw files are moved to the Raw/ subdirectory, and the output files have the same names as the originals.
    tres.tflat @compxx.list removes fringing and pixel-to-pixel variations from comparison lamp files. The original merged, unnormalized file is saved in the Unflat/ directory.
    tres.tcosmic @compxx.fits compares images with the same characteristics and removes cosmic rays from each exposure. Temporary median and limit files are created and my be deleted. Nelson Caldwell developed the algorithm which compares two files at a time, using statistics from the median file to figure out when to reject high pixels.
    tres.textract @compxx.list to extract the calibration spectra, using flatxx.ec.fits as apref. Turn off *all* processing except extraction to produce comp.ec.fits.

  3. tres.tcal comp files
    runs rvsao.pxcsao against an appropriate reference comparison lamp file to get a single dispersion-direction pixel shift which is applied to the wavelength solution with which the file is then dispersed. If interactive=yes, the dispersion function can be refined using ecidentify. The cursor "x" command cross-correlates to get a better match between features, "f" fits to the new matches, and "q" with a "y" response exits and writes the revised id file to the database directory from which it is then retrieved to add the dispersion function to the spectrum header.

Object Files

  1. tres.tproc objects.fits
    runs mscred.ccdproc trim+ overscan+ fixpix+ to bias-subtract, trim, and remove bad pixels from all amplifiers of all files.
    tres.gaincorr corrects for gain variation between amplifiers.
    tres.tampmerge is run to merge the two amplifiers of each object file to single image FITS files.
    The raw files are moved to the Raw/ subdirectory, and the output files have the same names as the originals.


    tres.tflat divides by the normalization image made by tmakeflat, removing pixel to pixel variation and fringing. The original merged, unnormalized file is saved in the Unflat/ directory.


    tres.tcosmic @objectxx.list compares images from the same object, FIBSIZE, binning, and FIBKEY and removes cosmic rays from each exposure. Temporary median and limit files are created and may be deleted. Nelson Caldwell developed the algorith which compares two files at a time, using statistics from the median file to figure out when to reject high pixels.


    tres.textract objects.fits extracts the object spectra, using the appropriate dome flat, flat[size][binning][fiber].flat.fits as the aperture reference.


    tres.tdisp objects.ms.fits adds dispersion functions for each order to each spectrum
    refspec file.ms.fits references="comp.ms",
    dispcor file.ms.fits filed.ms.fits linearize- The original .ec file is moved to Nodisp/.

  2. tres.tscombine objectsi.ms.fits objecti.ms.fits sums all exposures of a single pointing into a single set of spectra,

  3. rvsao.xcsao *.fits can be used to find the radial velocities of all of the object spectra, but there are not any good templates yet.

[Definitions] [Preparation] [Observation] [Reduction (Pipeline) (Software)] [Distribution] [Archiving]
[Instruments] [TRES]