Personal tools
You are here: Home / COSMOS2 / Writing routines for COSMOS

Writing routines for COSMOS

Back to Table of Contents

Writing routines for COSMOS

The COSMOS software does not do everything, and may very well not do the things it does the way you would like. If you would like to customize the processing, a good starting place would be with the output of adjust-map. The mapfile produced by adjust-map provides all the information you need to extract the spectral data, using any method you may chose. The information necessary to locate any wavelength and slit position is given as a set of polynomials.


The mapfile has the following format:

Xdispersion = dirflat
Fit orders = ord_disp ord_sag ord_tilt ord_sagit ord_len
Scale ~     telscale
Lambda  =  lamin lamax

SLIT slitnum  objectname
LENGTH = slitlength
CHIP chipnum slmax slmin lammin lammax nfint
dispersion polynomial
inverse-dispersionn polynomial
sag polynomial
tilt polynomial
sagitta polynomial
slit-length polynomial
CHIP chipnum slmin slmax lammin lammax nfint
.
.
.

SLIT slitnum  objectname
.
.
.
END


The first 4 lines give general parameters:

Xdispersion = dirflat

dirflat = 1 if the dispersion is along the x direction of the chips (i.e. along the rows), otherwise dirflat = 0.


Fit orders = ord_disp ord_sag ord_tilt ord_sagit ord_leni

ord_disporder of the dispersion fit, and the inverse dispersion fit
ord_sagorder of the spectrum "sag" fit
ord_tiltorder of the spectrum tilt fit
ord_sagittaorder of the slit curvature fit
ord_lenorder of the slit length fit

Scale ~ telscale

Image scale at CCD focal plane. (Hard-wired into map-spectra.)


Lambda = lamin lamax

Minimum and maximum wavelengths of spectrum fits in this file


For each slit, there is a line:

SLIT slitnum objectname

slitnum is the sequence number, and objectname the name given in the SMF file.


Only well-behaved slits have the following data. A well--behaved slit is one in which both ends of the slit fall onto the same chip (the spectrum may well span several slits in the dispersion direction).


LENGTH = slitlength

slitlength is the nominal length of the slit, in pixels


For each chip that the spectrum traverses, the following data are given:

CHIP chipnum slmax slmin lammin lammax nfint

chipnum chip number
slmindistance to "left" end of slit from object, in pixels
slmaxdistance to "right" end of slit from object, in pixels
lamminminimum wavelength of spectrum on this chip
lammaxmaximum wavelength of spectrum on this chip
nfintan almost useless number; ignore


Then for each chip that the spectrum traverses, SIX polynomial coefficients are given:

  1. The dispersion solution (wavelength as a polynomial function of pixel coordinate in the dispersion direction)
  2. The inverse of the dispersion solution (pixel coordinate in the dispersion direction, as a function of wavelength)
  3. The pixel coordinate orthogonal to the dispersion direction, as a function of wavelength (Note that the pixel coordinate along the slit is equal to the slit center only if the mask design places the object midway along the slit.)
  4. The tilt of the spectrum, in pixels, (i.e., the line curvature) as a function of wavelength
  5. Unused
  6. The slit-length, in pixels, as a function of wavelength

  7. Back to Table of Contents