;+ ; Function to return scan numbers for the input data file. ; Useful for error checking. Unless unique is set, this returns the ; different scan numbers in the order they appear in the current line ; data source (!g.lineio). Duplicate scan numbers will be shown in ; this list. Useful for error checking. ; ; @keyword unique {in}{optional}{boolean} If set, the unique scan ; numbers are returned. This is a sorted list and it is impossible to ; tell if there are any duplicate scan numbers. ; ; @examples ;
;    a = get_scan_numbers()
;    print,a
; 
; ; @version $Id: get_scan_numbers.pro,v 1.4 2005/05/29 21:34:23 bgarwood Exp $ ;- function get_scan_numbers, unique=unique compile_opt idl2 if (not keyword_set(unique)) then begin ; reduce this to as small a list as is reasonable result = !g.lineio->get_index_values("scan",int=0,ifnum=0,plnum=0,fdnum=0) oldscan = -1 count = 0 for i=0,n_elements(result)-1 do begin if result[i] ne oldscan then begin result[count] = result[i] count += 1 oldscan = result[i] endif endfor if count gt 0 then begin result = result[0:(count-1)] endif else begin result = -1 endelse endif else begin result = !g.lineio->get_index_scans() endelse return, result end