NAME: clscan PURPOSE: Scan a group of raw OSIRIS XD frames and find rough spectral location. DESCRIPTION: CATEGORY: Spectroscopy CALLING SEQUENCE: clscan,calib,root,start,last,frno,mate,RANGE=range,PATH=path INPUTS: calib- Anonymous structure containing all pertinent calibration information. This structure is usually loaded beforehand using the routine, "ldcalir" root - string containing the root of the file name (with leading path if desired). DO NOT include the . between the root and suffix. start - First spectrum number of sequence to scan. last - Last spectrum number of sequence to scan, if negative, this number is taken to be the number of spectra to scan. OPTIONAL INPUT PARAMETERS: KEYWORD INPUT PARAMETERS: PATH - optional string that points to the directory containing the data. This information is not used if the root already begins with '/'. If root is not an absolute pathname, then PATH is prepended to root for READ operations. This path is not used for saving. This allows reading from one directory (possible a read only area) and then saving to the current directory. XRANGE - range of column numbers to average in extracted spectral slice to find rough location of spectrum. Default is all columns. YRANGE - range of rows that are valid locations. Default is all rows but the first and last. EXCLUDE- List of frames in the indicated range that should be excluded from consideration. OUTPUTS: frno - A vector of frame numbers. mate - A vector that gives a suggested frame number from this set for a sky pair match that does not overlap the object. Also, information on location for each spectrum is printed to the console. KEYWORD OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: Specifically written for OSIRIS cross-dispersed spectral data. PROCEDURE: MODIFICATION HISTORY: 95/09/27, Written by Marc W. Buie, Lowell Observatory 96/05/29, MWB, changed 4th argument from NSPEC to LAST. 97/08/07, MWB, removed RANGE (buggy) and added XRANGE and YRANGE 97/12/10, MWB, fixed a really nasty bug that corrupt the location for very high signal-to-noise data. 98/07/01, MWB, added code to skip over missing files in sequence.