TRES spectra

TRES Reduction Tasks
Doug Mink, 2008-Sep-19

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 four programs for running an approximate reduction of TRES data to see how the spectra look.

Pipeline

The TRES pipeline adds automatic sorting of files by fiber configuration and exposure time (which matters for our cosmic ray removal algorithm).

Bias and Dark Files

  1. tres.trsproc
    runs tres.ftres to process files through cosmic ray removal:
    mscred.ccdproc trim+ overscan+ fixpix+ to bias-subtract, trim, and remove bad pixels from both 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 is run to combine the two amps to single image FITS files.
    tres.tcosmic is run to remove cosmic rays.

  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. Run tres.trsproc on trsgroup.flatlist which contains a list of lists of FLAT files grouped by fibsize, binning, fibkey, and exposure time.
    tres.ftres flatten=no is run on each list of similarly exposed flat field exposures
    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.

Since TRES is so stable, we wavelength calibrate by shifts in the dispersion direction from a reference spectrum and flatten and extract based on the same flat field which was used for that reference spectrum, all of which is in the tresdata$ directory. Here is the process used to produce new flattening images and extraction masks:
  1. To produce a new flattening file, tres.trssum @flatxx.list flatxx.fits combines multiple flat field exposures of the same type into a single image file.

  2. 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.

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

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

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

  6. 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.

  7. 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.

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

Calibration Lamp (ThAr) Files

  1. Use tres.trsgroup to group all of the COMP files by apfib and exposure, so cosmic rays can be removed.
  2. tres.ttres @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 optionally 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 extracts 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 brings up a display of residuals in which outliers can be deleted with "d" and the dispersion refit with "f" until the graph looks satisfactory, with residuals within 0.015 or so. "q" exits the residuals and another "q" followed by a "y" response exits and writes the revised id file to the database directory. It is then retrieved to add the dispersion function to the spectrum header.

Object Files

  1. tres.ctres objects.fits
    or tres.trsproc o to process all objects.
    First mscred.ccdproc trim+ overscan+ fixpix+ bias-subtracts, trims, and removes 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.

    If ctres.sumspec=yes, tres.trssum sums all exposures of a single pointing into a single set of spectra, assigning the sum a new observation sequence number and name. This file is processed just like its components through the following steps.

    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. 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]