HELP · SEE_ALSO

## NAME

linefind -- Find spectral lines for wavelength calibration.

## USAGE

`linefind input linlib table`

## DESCRIPTION

This routine finds spectral line positions in the input data; it produces
a table of found locations that can then be used by the `dispfity` task.
Wavelengths and approximate line positions are stored in
an input line library table. The location of each line in
the library is searched in an area of `swidth` pixels, centered
on the approximate location (defined by `SAPPROX`). The
spectral line position is computed using
cross correlation with a template of width `twidth`. A quadratic
equation is fit to the minimum of the correlation matrix and its two
neighbors. The line position is then given as the location of
the minimum of the quadratic. If the line is found on the
edge of the search width it is reported as not found.

Note that the approximate line position values in the input line library table must be in units of DIODES, regardless of the oversampling factor (if any) of the input spectral data. The found line positions in the output table are also in units of DIODES. The diode values are zero-indexed, i.e. the first diode has a position value of zero. The input line positions must therefore range between 0 and 511.

An average offset of the
approximate and observed line positions is also computed.
Line positions further than `maxdev` from the approximate positions
and lines with a peak counts below `minval`, are not
included in the output average offset.

## PARAMETERS

- input [file name]
- Name of input spectral data file. The input file will usually represent an observation of the internal Faint Object Spectrograph (FOS) spectral calibration lamp.

- linlib [file name]
- File name of the line library table. This table has the columns
`WAVELENGTH`,`SAMPLE`, and`WEIGHT`. The`WAVELENGTH`column specifies the wavelengths of the reference lines for which`linefind`is to search. The`SAMPLE`column contains approximate sample positions (zero-indexed). The`WEIGHT`column is copied directly to the output table for use by the`dispfity`task.

- table = "linefind" [file name]
- Name of the output table containing found sample positions.
This table contains the following columns (all of which contain
double-precision real values):
'WAVELENGTH' - Wavelength, copied from the line library. 'SAPPROX' - Approximate sample location from the line library with the input offset added. 'SFOUND' - Found line location. 'PEAK_COUNT' - Peak value of the line in 'infile'. 'WEIGHT - Weights to be used by 'dispfity'.

- (template = "scidata$lftemplate") [file name]
- Optional file containing the template for cross-correlation.
This file should normally be scaled to a maximum of 1.0. It is a
one-dimensional vector with a length less then 32. If
`template`is set to " ", then a template containing only values of 1.0 and having a width equal to`twidth`is used.

- (twidth=3) [integer, min=1, max=9]
- Cross correlation template width. This parameter is not used if
a template file is specified for the
`template`parameter.

- (swidth=13) [integer, min=3, max=51]
- Search width in data points.

- (maxdev=3.0) [real]
- Maximum distance that a found line can deviate from its approximate location for it to be included in the average offset.

- (minint=0.0) [real]
- Minimum peak intensity of the line for it to be included in the average offset.

- (offset=0.0) [real]
- An offset (in sample units), added to the approximate line locations in the line library before searching for the lines.

- (aveds = 0.0) [real]
- Output parameter giving the average offset between approximate and found locations.

## EXAMPLES

1. Compute locations of lines in the spectrum `wcspec` using
the line library `linlib`. Place the found positions in an output
table named `found`.

fo> linefind wcspec linlib found

2. Repeat the process using a smaller search area and adding an offset to the approximate positions. Use the average offset from the previous example.

fo> linefind.offset = (linefind.aveds) fo> linefind wcspec linlib found swidth=7

## BUGS

## REFERENCES

Howard Bushouse, STSDAS

## HELP

For assistance using this or any other tasks, please contact help@stsci.edu or call the help desk at 410-338-1082.

## SEE ALSO

dispfity, waveoffsety, fitoffsety