Sflats

Sflats constructs a spectroscopic flat field image for use with biasflat. Sflat does the following:


USAGE
Sflat -m mapfile -f flatfile[s] [-b biasfile] [-o outputfile]
            [-z badpixfile]
INPUT
mapfile is the name of the mapfile which describes the data
flatile[s] is the name[s] of a spectroscopic flatfield set
biasfile is the name of a bias file set
outputfile is  the name of the output file if more than two input files
badpixfile
is the name of a non-standard bad pixel file
OUTPUT
flatfile_flat_cn.fits  or outputfile_cn.fits are the processed flats
PARAMETERS
minlambda
minimum wavelength
maxlambda
maximum wavelength
telscale
telescope scale arcsec/mm
bias_file
bias frame to use (or blank or "none")
shuffled
distance, in pixels, to shuffle the spectra
siglimit
sigma clipping limit for CR removal
noise
CCD read noise
gain
CCD gain
fit_mode
continuum fitting method (median or poly)
order
order of fit if polynomial fitting
med_box
width of sliding box if median fitting




Details:

Sflats first removes the bias level from each input file, using a bias frame if provided, or otherwise using the overscan areas. Mulitple frames are summed. The spectral response of the flat field continuum lamp is fit in each spectrum, either by polynomial fitting or by a running median, and the fit is used to normalize each spectrum to unity. If a bad pixel file is specified, it is used to mask out regions before the spectral response is fit. Otherwise, the standard, dewar-specific bad pixel file is used.

The choice of continuum fitting method to use depends on the data. For long camera grating spectra, the polynomial fitting method works well. However, for short camera grism spectra, where the spectra are often contaminated by the zero order images, the median fit is much more reliable, if a bad pixel mask for the zero order image is not specified.

if minlambda and maxlambda are both set to 0, Sflats uses the values from the map file.

The output is a file or files called filename_flat. If there is only one input flat file, its name is used for filename. If there are two input file, filename is constructed from the two input file names. If there are more than two input files, filename must be specified.

If the observations were taken in nod&shuffle mode and the spectral flats were not themselves shuffled during the exposure, a shuffled flat frame can be produced by setting shuffled to the shuffle distance, in pixels. If however, the spectral flats are already shuffled, the shuffled parameter must be set to zero.

Back to programs