function get_indices,aa,bb

;+
; NAME
;	get_indices
; PURPOSE
; 	To return the indices of values in a large vector which 
;	equal the values in a smaller vector.  The program matchem
;	can be used to generate the smaller vector.
; CALLING SEQUENCE
;	ii = get_indices(aa,bb)
; INPUT
;	aa, bb - the two vectors, order not important.
; OUTPUT
;	ii - the desired indice array.
; HISTORY
;	1/24/96, LWA, written.
;-

naa=n_elements(aa)
nbb=n_elements(bb)

if naa ge nbb then nn=naa else nn=nbb
if naa le nbb then mm=naa else mm=nbb

if naa lt nbb then begin
   cc=bb
   dd=aa
endif else begin
   cc=aa
   dd=bb
endelse

start=0
j=0

for i=0,nn-1 do begin
   d=cc(i)-dd(j)
   if d eq 0 and start eq 1 then begin
      out=[out,i]
      j=j+1
   endif
   if d eq 0 and start eq 0 then begin
      out=i
      start=1
      j=j+1
   endif
   if j eq mm then return,out
endfor

return,out

end

