	function frd_time, path, files=files, dtime=dtime, no_sort=no_sort, $
		sunset = sunset, polariz = polariz

if n_elements(sunset) le 0 then sunset = 17.

	CASE n_params() OF

0: 	begin
file=pickfile(/read)
path=subdir(file)
	end

1:
	ELSE: message, 'Too many arguments'
	ENDCASE


	CASE strlowcase(strmid(!version.OS, 0, 3)) OF

'win':	begin
wildcard='\*.fit'
	end

	ELSE: wildcard='/*.fit*'
;message, 'Not supported on this platform'
	ENDCASE


files=findfile(path+wildcard)

files = files(uniq(files))

N=n_elements(files)

h=bytarr(80,36)

polariz = (time=strarr(N))
help,time
	for j=0, N-1 do begin
openr, lun, files(j), /get
readu, lun, h
time(j)=sxpar(string(h), 'time-obs')
polariz(j)=sxpar(string(h), 'polariz')
free_lun, lun
	endfor

dtime=hmsd(time)

	if keyword_set(no_sort) ne 1 then begin

sort_index=sort(dtime)

dtime=dtime(sort_index)
time=time(sort_index)
files=files(sort_index)
polariz=polariz(sort_index)

sort_index = [where(dtime gt sunset), where(dtime lt sunset)]
sort_index = sort_index(where(sort_index ge 0))
dtime=dtime(sort_index)
time=time(sort_index)
files=files(sort_index)
polariz=polariz(sort_index)

	endif

return, time

	end