;+
; This procedure is used to select data for later processing.
;
; Data can be selected based on entries in the index file, such as source
; name, polarization type, IF number, etc. For a complete list of eligible
; parameters use the procedure listcols, or see
; search parameters.
;
; @keyword keep {in}{optional}{type=boolean} If set, the selection comes from
; the keep file. If not set, the selection comes from the input file.
;
; @uses select_data
;
; @version $Id: select.pro,v 1.5 2005/05/27 05:16:04 jbraatz Exp $
;-
PRO select, keep=keep, _EXTRA=ex
compile_opt idl2
if (keyword_set(keep)) then begin
indx = select_data(!g.lineoutio,_EXTRA=ex)
endif else begin
indx = !g.line ? select_data(!g.lineio, _EXTRA=ex) : select_data(!g.contio, _EXTRA=ex)
endelse
if (indx[0] lt 0) then begin
print,'No matching indices were found'
endif else begin
appendstack, indx
print, 'Indices added to stack :', n_elements(indx)
endelse
END