NIRSPEC Extracted Spectra Products

This document describes the files produced by the Keck Observatory Archive's automated NIRSPEC data reduction pipeline (NSDRP), designed to extract spectra from observations acquired in high-dispersion mode. The products include flux and noise spectra, spatial profiles for each order, and wavelength calibration line identification tables in ASCII and FITS formats. The spatial profile plots and the log files include estimates of a signal-to-noise ratio (SNR), found by comparing the spatial peak height with background levels, and a peak width, found by Gaussian fitting. A detailed description is given in the NIRSPEC Extracted Data Products Specification document.

DISCLAIMER: The extracted spectra available from KOA are intended to be used as a browse product only. The extracted spectra are produced by a fully automated pipeline, and may not be suitable for publishable quality science. KOA recommends that you reduce the raw images into extracted spectra yourself, paying attention to the specific kind of data that you are reducing (point source vs. extended source, the types and quantities of calibration frames, etc.).


Directory Structure

When the user retrieves NIRSPEC data, the resulting package will contain a directory tree with extracted as the parent directory. The extracted directory will contain subdirectories with the extracted spectra and related products when available. The directory structure is shown below:


extracted/
  |--ascii/     
  | 	|
  |  	|--flux/     Flux tables as formatted ASCII tables
  |   	|--profile/  Profile tables as formatted ASCII tables
  |   	|--wavecal/  Wavelength calibration tables as formatted ASCII tables
  |
  |--fits/     
  |     |
  |  	|--flux/     Object spectrum 1-D FITS files
  |   	|--order/    Two-dimensional rectified order as FITS images
  |   	|--profile/  Mean flux along slit 1-D FITS files
  |  	|--sky/      Sky spectrum 1-D FITS files
  |   	|--snr/      Signal-to-noise ration spectrum 1-D FITS files
  |   	|--trace/    Order trace 1-D FITS file
  |
  |--fitstbl/           
  |   	|
  |   	|--flux/     Flux tables as binary FITS tables
  |   	|--profile/  Profile tables as binary FITS tables
  |  	|--wavecal/  Wavelength calibration tables as binary FITS tables
  |
  |--previews/      
  |   	|
  |   	|--flux/     Flux versus wavelength preview plots as PNG images
  |   	|--order/    Rectified orders as PNG images 
  |   	|--profile/  Profile preview as PNG images
  |  	|--sky/      Sky background versus wavelength preview plots as PNG images
  |   	|--snr/      Signal-to-noise ratio versus wavelength preview plots as PNG images
  |   	|--trace/    Trace preview plots as PNG images

NOTE: if no extracted products of a particular type are available for any of the KOAIDs selected for download, that directory will not be present in your download package.


File Types

FITS
Each FITS data file contains a single HDU. The header portion of the HDU (HDU 0) contains keywords from the original science frame plus keywords added by NSDRP, as described in the FITS Keywords section, added by KOA. The data portion of the HDU contains a 1 or 2-dimensional array. Preview plots are generated for each of the FITS files.

PREVIEWS
The "previews" subdirectory contains PNG plots per order per reduced FITS file of the flux, order, profile, sky, signal-to-noise (snr), and trace.

TABLES
Tables are generated in both Binary FITS table and ASCII formats.

Each FITS binary table contains two HDUs (Header Data Unit). HDU 0 is type PrimaryHDU and contains keywords from the original science frame plus keywords added by NSDRP. HDU 1 is type BinTableHDU and contains table data. The header portion of HDU 1 contains table column metadata. Metadata used are column name (TTPE), column format (TFORM), and units (TUNIT). All column values are scalars. ASCII tables are written as fixed width tables with a single header line containing column names and units where applicable. The '|' character is used to delineate columns and space characters are used for padding.


Table Descriptions

The standard naming convention for data products is KOAID_NN_TYPE_FILE.gz where:

KOAID is the standard KOA file identifier and begins with NS for NIRSPEC files
NN is the order number
TYPE is either 'flux', 'order', 'profile', 'sky', 'snr', 'trace', or 'wavecal'
FILE is either 'tbl.fits' ( or '.txt'

FLUX TABLES

Flux tables for evaluating spectra are produced for each spectral order.

FITS format: fitstbl/flux/KOAID_NN_flux_tbl.fits
ASCII format: ascii/flux/KOAID_NN_flux.txt

Each flux table row corresponds to a pixel column in the raw image and has the following columns:

Column Description
col Column number of raw image, where '0' is the first column.
wave Wavelength in Angstroms (vacuum) of this column based on wavelength calibration using OH sky emission lines.
flux Relative flux in counts of extracted spectrum after division by a normalized flat image.
error One-sigma error of the flux in counts.
sky Background level in counts, scaled to match the total background in the region of object extraction.
synth_sky Relative intensity of the synthesized sky spectrum used for wavelength calibration.
sig_to_noise Signal-to-noise ratio, flux divided by error.
flat Level of the flat field in counts, not normalized. (The normalization scale factor is given by the FLATSCAL header keyword.)
trace_upper Upper edge of the order in pixels, determined from the flat field.
trace_lower Lower edge of the order in pixels, determined from the flat field.
trace_mean The average of the upper and lower trace edges, in pixels.
trace_fit Average of upper and lower traces smoothed by fitting to a third degree polynomial, in pixels.
fit_res Difference between trace_mean and trace_fit, in pixels.

PROFILE TABLES

Profile tables containing mean flux profile along the slit are produced for each spectral order.

FITS format: fitstbl/profile/KOAID_NN_profile_tbl.fits
ASCII format: ascii/profile/KOAID_NN_profile.txt

Each profile table row represents a row in the spatially rectified spectral order and contains the following columns:

Column Description
row Row offset in pixels in the spatial direction relative to the shifted trace fit.
prof_flux Mean flux of the spatial profile in counts.

WAVELENGTH CALIBRATION TABLES

A single wavelength calibration identification table is produced for each object frame and lists the sky emission lines used for wavelength calibration.

FITS format: fitstbl/cal/KOAID_NN_wavecal_tbl.fits and
ASCII format: ascii/cal/KOAID_NN_wavecal.txt

Each row of the table represents one emission line used in the calibration and contains the following columns:

Column Description
order The Echelle order number in which this line appears.
source 'Sky' for OH emission lines
col Measured column of the line in pixels.
wave_exp Expected wavelength of the line in Angstroms.
wave_fit Wavelength in Angstroms of the measured column from the wavelength fit.
peak Peak intensity of this line in counts.
disp Dispersion of the fit at this wavelength in Angstroms/pixel.

FITS Keywords Added to NIRSPEC Headers

The following is an example of the header keywords added to KOA tables by NSDRP.

Keyword Description
FLATSCAL flat field normalization
DARK /KOA image ID of dark used, if any
FLAT1...FLATN /KOA image ID of flat images used
FIT1..WFITN Polynomial fit coefficients determined for wavelength calibration equation.
WFITRMS RMS of wavelength fit residual.
ECHL_ORD Echelle order number (where appropriate).
OBJEXTRW Width of object extraction window in pixels.
SKYEXTRW Width of sky extraction window in pixels.