pro plot_evn, sttim, entim
;
;+
;NAME:
;	plot_evn
;PURPOSE:
;	To plot the data held in the EVN database 
;CALLING SEQUENCE:
;	plot_evn, '1-apr-92', '2-apr-92'
;INPUT:
;	sttim	- The starting date/time to plot
;	entim	- The starting date/time to plot
;HISTORY:
;	Written 6-Aug-92 by M.Morrison
;-
;
rd_evn, sttim, entim, evn
rd_fem, anytim2ints(sttim, off=-2*60*60), entim, fem_data	;back up two hours
;
ref_tim = evn(0)
x = int2secarr(fem_data, ref_tim)
x2 = int2secarr(evn, ref_tim)
;
ytickv = indgen(15)
ytickname = [' ', 'SC Day', 'SAA', ' ', ' ', 'FL Data', 'QT Data', ' ', ' ', 'KSC', 'Canberra', 'Madrid', 'Goldstone', '??', ' ']
utplot, x2, fltarr(n_elements(x2)), ref_tim, /nodata, $
        ystyle = 1, psym=0, $
        ytitle = '', $
        yrange = [0,14], yticks=14, ytickv=tickv, ytickname=ytickname
for i=0,n_elements(evn)-1 do begin
    xx = int2secarr(evn(i), ref_tim) + [0, evn(i).duration]
    off = 6	;quiet
    if (gt_dp_mode(evn(i)) eq 9) then off=5	;flare
    oplot, xx, [1,1]*off
end
for i=0,n_elements(fem_data)-1 do begin
    xx = int2secarr(fem_data(i), ref_tim) + [0, fem_data(i).night]
    oplot, xx, [1,1]
    if (fem_data(i).st_saa ne 0) then begin
	xx = int2secarr(fem_data(i), ref_tim) + [fem_data(i).st_saa, fem_data(i).en_saa]
	oplot, xx, [2,2]
    end
    ;for j=0,2 do if (string(fem_data(i).st$station(j)) ne '') then begin
    for j=0,2 do if (fem_data(i).st_station(j) ne 0) then begin
	case string(fem_data(i).st$station(j)) of
		'U': offset = 9
		'C': offset = 10
		'M': offset = 11
		'G': offset = 12
		else: offset = 13
	endcase
	xx = int2secarr(fem_data(i), ref_tim) + [fem_data(i).st_station(j), fem_data(i).en_station(j)]
	oplot, xx, [0,0]+offset
    end
end

end
