Back to Table of Contents

Introduction

Description

COSMOS is a set of programs for the reduction of multislit spectra obtained with the IMACS and LDSS3 spectrographs on the Magellan Telescopes. It can be used for the quick-look analysis of data at the telescope as well as for pipeline reduction of large data sets. COSMOS is based on a precise optical model of the spectrographs, which allows (after alignment and calibration) an accurate prediction of the location of spectra features. This eliminates the line search procedure which is fundamental to many spectral reduction programs and allows a robust data pipeline to be run in an almost fully automatic mode, so that large amounts of data can be reduced with minimal intervention. The COSMOS reduction process consists of three steps:

  1. Alignment of the slitmask relative to the CCD focal plane. After proper alignment, the COSMOS optical model can predict the location of slit position/wavelength points on the CCD images to an accuracy of 1 to 2 pixels. If the optical models were perfect, the accuracy of these predictions would be even better. Since they are not, they must be improved by the following step. This alignment need only be done once for each mask in each observing run,
  2. Production of an accurate spectral map, during which the optical model predictions are corrected using one or more comparison arcs. This step reduces the errors in predicted positions to a small fraction of a pixel. The map created in this step forms the basis of all following data reduction steps. This step is normally performed for each science exposure, using adjacent comparison arc exposures.
  3. Spectral reduction.

Each of these steps consists of several procedures, which are summarized below.

 

Input Data

The COSMOS reduction process requires the following input data:

  1. A mask definition file which describes the slitmask used. This file was produced by the program maskgen which was used to produce the mask, and will have the name maskname.SMF
  2. A dewar offset file, which describes the positional zero-point of a particular slitmask + instrumental configuration. Default dewar offset files exist for each of the principal configurations and can be used as starting points for the alignment process
  3. An observation definition file which defines the observational setup, including instrument, slitmask (i.e. SMF file), camera, disperser element (and tilt, if a grating), and dewar offset file. These files are created by the program defineobs.
  4. Input data frames, including bias, flat field, comparison arc, and object spectra.

 

Stitching

LDSS3 data needs to be stitched together before the alignment. The program stitch will combine the LDSS3 CCD files into one FITS file and makes bias and gain corrections for all the chips.

 

Alignment

Although the spectral mapping routines described below are able to correct errors in the COSMOS optical model, they need a reasonably accurate starting point. Variations in the way that masks are mounted in their frames, and season-to-season variations in the ambient temperature inevitably produce some errors in the predicted positions of slit images. The program align-mask uses either a direct or dispersed mask image to correct for errors in x and y position, position angle, and scale of the mask image, by adjusting the values of these parameters in the dewar offset file. Corrections to the dewar offset file can also be made manually using the program adjust-mask.

 

Spectral mapping

The process of generating and calibrating a spectral map serves two purposes:

  1. It creates a polynomial representation of the mapping from the science coordinate system of slit position and wavelength to the observing coordinate system of CCD coordinates, using the program map-spectra. This polynomial representation allows the data analysis to proceed without the computational machinery involved in the optical model.
  2. It uses one or more comparison arcs to calibrate the spectral map to high precision, using the program adjust-map.

 

Spectral reduction

Once an accurate spectral map has been produced, reduction of science exposures proceeds in the following steps:

  1. Subtraction of bias, and division by flats, using the programs Sflats and biasflat.
  2. Optional masking of bad pixels and different order spectral features using badorders.
  3. Subtraction of sky, using the program subsky.
  4. Extraction of individual 1 or 2 dimensional spectral exposures using extract-spec or 1dspec. Multiple sets of extracted spectra can be combined, with optional cosmic ray removal, using sumspec

 

Reduction Pipeline

Execution of the spectral mapping and spectral reduction steps described above can be pipelined together for a set of spectral exposures from a single night using the script-generator process-spec.

 

Display and visualization

A number of programs help to display the data and compare them with the predictions of the optical model and spectral map, including display, mark-slits, and whatsthat, which allow one to compare spectral and direct images with the predictions of the model, and viewspectra, which provides some spectral visualization and analysis features.

 

Next: Data Files

Back to Table of Contents