donspec

donspec.cl

Name

donspec -- rectify, extract, and calibrate NIRSPEC low-d spectra

Usage

donspec input root

Parameters

input
List of input images to process. These should be cleaned, 2-D NIRSPEC images taken in low-dispersion spectroscopy mode for a single target and instrument setting.
root
Rootname for output spectra.
xref
Name of flat image to use for xdistcor. This image will be used to generate the trace image for use in removing x distortions.
yref
Name of line image to use for ydistcor. If blank, the first input image will be used.
coordlist
Name of file listing emission lines to be identified in sky spectrum.
x1
First illuminated column to extract, as measured in the middle line of the input images.
x2
Last illuminated column to extract, as measured in the middle line of the input images.
dy=0
Change in row (y) value for features as they move from column x1 to column x2. Note that if the features move toward lower row numbers (as generally done with NIRSPEC images), the value for dy should be negative.
gain=5
(Inverse) detector gain [electrons/DN]. This is used to set noise parameters for extraction and image combining
rdnoise=30
Detector read noise [electrons/px]. This is used to set noise parameters for extraction and image combining.
thresh=-1
Threshold value which defines the flux level in the sky image which defines "bad" pixels to be removed via interpolation. The default value of -1 allows this to be defined interactively by the user on a plot of the sky image.
logfile="logfile"
File into which to write results of the S/N measurements and image summing operation.
verbose=yes
Give feedback on operations while running?

Description

This script coordinates the reduction of NIRSPEC low-dispersion spectral data. The following tasks are accomplished:
  • Generate trace image from image specified in parameter xref
  • Remove x distortions using xdistcor
  • Allow optional checking of x alignment
  • Remove y distortions using ydistcor
  • Allow optional checking of y alignment
  • Extract spectra interactively using apall
  • Measure median S/N using spec_s2n
  • Average spectra together using scombine
  • Extract sky band from first image
  • Derive wavelength solution using identify
  • Apply wavelength solution using dispcor
  • Interactively obtain sky flux threshold
  • Remove regions affected by bright night sky lines using skyinterp
The script will not do the following:
  • Cleaning of cosmic rays and bad pixels
  • Flatfielding
  • Flux calibration
The script will create the following files:
*y.fits
Fully rectified spectra
*y.ms.fits
Extracted spectra
root_trace
Trace image used for xdistcor
root_sky
Sky band extracted from first image
root_avsigclip
Average of extracted spectra with sigma clipping and median weighting enabled
root_dispcor
Wavelength-corrected spectrum
root_skyinterp
Spectrum with regions near strong background emission features removed

Example

The current directory contains cleaned images named *c.fits and a flat called flat.fits. The target name for the observations is foo. Inspection of a science image shows that in the middle line, the illuminated columns run from 500 to 700 and night sky lines change position by -25 rows from one end to the other. Determination of a flux threshold for bright night sky lines is to be done interactively. To rectify and extract spectra, type:
  donspec *c.fits foo xref=flat x1=500 x2=700 dy=-25 thresh=-1

Notes

This script requires the following:
  • Target is a point source
  • Wavelength calibration can be done from night sky lines
  • Flat image must be available for generating trace image
  • Night sky emission line list must be available (see skyplot)
  • Starting and ending columns for extraction and the shift in row shift in night sky features must have been measured and entered in the corresponding task parameters (x1, x2, and dy)

Bugs

  • The script will try to delete any files or images which would conflict with its built-in naming scheme. When no such files exist, the program will generate spurious warning messages about images which cannot be found.

See Also

mktracer xdistcor ydistcor skyinterp skyplot spec_s2n
The cl script donspec.cl
The package wmkonspec
Last modified: 07/13/2017 02:39
Send questions or comments to:NIRSPEC Support

The information on this page is the property of the W. M. Keck Observatory. The contents of this page or any part thereof shall not be copied or otherwise reproduced or transferred to other documents or used or disclosed to others for any purpose other than observing support at the W. M. Keck Observatory and the subsequent analysis and publication of scientific data obtained from observations conducted at the W. M. Keck Observatory. All rights reserved. © W. M. Keck Observatory.