	FUNCTION getwid, prefix, dir
;	----------------------------------------------------------------
;+							1-Apr-93
;	NAME: getwid
;
;	PURPOSE:
;
;	Calling Sequence:
;		wids = getwid(prefix, directory)
;		
;		prefix	a file prefix to get fileIDs for.
;		dir...	the directory to check for files.
;
;-
;	--------------------------------------------------------------

	cd, '', current=olddir			;save old dir

	cd, dir
	fns = findfile(prefix+'*')		;get files names

	IF fns(0) ne '' then begin
	  len = MAX(strlen(fns))
	  ids = strmid(fns, 3, len-3)

	  tim2orbit, (fid2ex(ids)), wid=wids	;get the wids

	  wids = wids(uniq(wids, sort(wids)))	;just list of unique
	ENDIF ELSE BEGIN
	  wids = ''
	ENDELSE

	cd, olddir				;return to original dir

	return, wids

	end
