TRES spectra

TRES Reduction Tasks
Doug Mink, 2009-Mar-30

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

[Definitions] [Preparation] [Observing Protocols] [Quicklook] [Quick Pipeline)] [Full Pipeline)] [Reduction Software] [Software Packages] [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.
    This can also be done by running tres.ftres with sumspec=yes.

  2. tres.tmakeref flatxx12.fits
    or tres.tmakeref flatxx3.fits
    Example
    run aptrace on summed dome flat field file using a specified standard template, and then apflatten to create a normalization file which is used by tres.tflat to remove IR fringing and other pixel to pixel variation, more or less. The new apflattening file is renamed flat[lms][b][12|3].flat.fits and is then used by tres.tflat on the summed dome flat field file, after which aptrace is run again to create extraction templates for all of the apertures in the file. If the input file includes fibers 1 and 2, the database/apflat* file is then split to create database/apflat*1 and database/apflat*2.
  3. tres.textract flatxx.fits and
    tres.tarith flatxx_f2.ec.fits / flatxx_f1.ec.fits flatxxf2df1.ec.fits
    makes a normalization file which can be used to scale the sky fiber to the object fiber for sky removal.

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+ calls
    tres.tproc on each image to trim, remove overscan, merge, and flatten all COMP image files,
    tres.tcosmic on the list of images to remove particle hits by comparing similar images region by region,
    tres.textract1 on each image to extract the spectra based on the FLAT template set above, and
    tres.tcal1 on each extracted spectrum to add the correct dispersion function by fitting or cross-correlating as below:

  3. Run ttres on each group of COMP files. For each configuration, there should be a reference for the night.
  4. Run
    tres.ttres COMPfffxnnn.list compstd="" compid-
    on each of the lists for which you have set up a reference spectrum interactively. Each spectrum will be cross-correlated against the night's reference for that configuration, and the resulting shift will be applied to the reference database/ec* dispersion function, which will be refit and added to the spectrum header for each fiber. The shifts will be tabulation with the times of exposures in files named compfff.shift where fff is the configuration (APFIB) code. Shifts for object spectra will be interpolated from the shifts in these files.

    In more detail, for each image file:
    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.

    For all files with same observing parameters:
    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.

    For each image file:
    tres.textract1 compfile extracts the calibration spectra, using flatxx.ec.fits as apref. [Turn off *all* processing except extraction to produce comp.ec.fits.]
    tres.tcal1 compfile 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.

    For each image file:
    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.

    For all files with same observing parameters:
    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.

    For each image file:
    tres.textract1 object.fits extracts the object spectra, using the appropriate dome flat, flat[size][binning][fiber].flat.fits as the aperture reference.
    tres.tdisp1 object_f*.ec.fits adds dispersion functions for each order to each spectrum
    refspec file.ec.fits references="comp.ec",
    dispcor file.ec.fits filed.ec.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 (Software)] [Distribution] [Archiving]
[Instruments] [TRES]