HELP · SEE_ALSO

## NAME

yfind -- Find Y-deflections of GHRS spectral orders.

## USAGE

`yfind input cctab profile ypostab newtable `

## DESCRIPTION

Using a Y-scan of an GHRS spectrum, the Y-deflection locations of each order of the spectrum are determined using the following procedure:

1) The total counts in each input frame (or bin) of data between
diodes `dfirst` and `dlast` is tabulated as a function of
the Y-deflection.

2) The table of total counts per Y-deflection is sorted in ascending Y-deflection order.

3) Approximate Y-deflections for each order between `m1` and `m2`
are computed using previous Y-deflection calibrations in the
table specified by `cctabin`; the following function computes these
approximate Y-deflections:

yapp = a + (b * w) + (c * w * w) + (d * m * w) where: a, b, c, and d - are coefficients stored in the 'cctabin' in the columns 'LIT_A', 'LIT_B', 'LIT_C', and 'LIT_D', m - is the spectral order, w - is the wavelength computed by the equation w = A / m * sin((C - carpos) / B) carpos - is the carrousel position of the Y-scan, and A, B, and C - are carrousel calibration coefficients stored in 'cctabin'.

4) The peak of the spectral order is found by searching the total counts in the range (yapp - YTOL) to (yapp + YTOL). The minimum total counts in the same range is also determined.

5) A more precise location of the peak is determined by
averaging the positions `y1` and `y2`
where the total counts equals one half the peak counts
plus the minimum counts in the range specified in step 4. Linear interpolation
in the table of total counts versus Y-deflection is used
to determine `y1` and `y2` to a fraction of a data point.
The Y-deflection of the order is then computed as the
average of `y1` and `y2`.

6) The order is reported as not found if either the maximum in the range (yapp - YTOL) to (yapp + YTOL) is less then twice the minimum in the range, or the found position is greater then (YTOL - yapp).

## PARAMETERS

- input [file name template]
- Raw input data files; these images must have been obtained at the same carrousel position giving a Y-scan of the spectral data.

- cctab [file name]
- Input table containing the carrousel calibration
and previous Y-deflection calibration. This table has the following
columns,
`GRATING`,`CAP_A`,`CAP_B`,`CAP_C`(these are the carrousel coefficients) and`LIT_A`,`LIT_B`,`LIT_C`, and`LIT_D`(these are the Y-deflection coefficients). If the table has multiple rows, then the first row in which the grating mode matches that of the input observations will be used. This table is updated by GHRS routines`yfit`and`carrousel`.

- profile = "profile" [file name]
- Name of the output table containing the Y-deflection profile.
This table will have the following columns:
'YDEF' - Y-deflection (double). 'TOTAL' - Total counts for the Y-deflection between diodes 'dfirst' and 'dlast' (double).

- ypostab = "yfind" [file name]
- Name of the output table that will contain the spectral order Y-positions
tabulated as a function of carrousel position and
spectral order. This table is used as input to the
`yfit`task; it has the following columns:'YDEF' - Spectral order Y-position (double). 'CARPOS' - Carrousel position (integer). 'ORDER' - Spectral order (integer).

- newtable = "yes" [boolean]
- Create a new table for the output file specified by
`ypostab`? If set to "no", then the results will be added to an existing table specified by`ypostab`.

- (ytol = 64.0) [real]
- Tolerance---in deflection units---used when searching for the new Y-deflection of the spectral orders.

- (thresh = 2.0) [real]
- Peak detection threshold. The maximum counts in a peak must be at least
`thresh`times the background (i.e., this is the minimum counts measured) in order to be detected.

- (dfirst = 1) [integer, min=1, max=500]
- First diode in the range in which counts are summed for each Y-deflection

- (dlast = 500) [integer, min=1, max=500]
- Last diode in the range in which counts are summed for each Y-deflection.

- (m= 0) [integer]
- First order to process. If
`m1`is not specified (i.e., it is set to 0) then the following ranges are used:first order grating m1=1 m2=1 Echelle A m1=33 m2=50 Echelle B m1=17 m2=33

- (m= 0) [integer]
- Last diode in the range of orders to process.

## EXAMPLES

1. Create a table of spectral order Y-positions, writing it to a
table called `ypos`; and create a table of Y-deflection profiles,
writing it to a table called `prof`. Use raw data from all images having
a rootname of "yscan" in the current directory. Previous calibration
and Y-deflection coefficients are stored in a table called `cctab`.

hr> yfind yscan* cctab prof ypos "yes"

## BUGS

## REFERENCES

## 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

yfit, carrousel