;+
;NAME:
pro plotogonalgd,ogtime,og,femtime,femflg,starttime=starttime,endtime=endtime,ps=ps
;KEYWORDS:	Yohkoh Operation
;PURPOSE:
;	show og on X window
;CALLING SEQUENCE:
;       loadopfem,'op61021d.txt',time,og,fem,/verbose
;	interpretfem,fem,femtime,femflg,/verbose
;	plotogonalgd,time,og,femtime,femflg
;INPUTS:
;	ogtime:		time array
;	og:		og ID
;	femtime:	time array
;	femflg:		event flag
;OPTIONAL INPUTS:
;	starttime: start time of the plot
;	endtime: end time of the plot
;HISTORY:
;	Ver 0.50 96-10-28	Prelim. Ver. Created by TY
;-
	common aoslosgdXw,wdth,hght,xoff,yoff,windowid,clms
	common aoslosgdtm,sttime,endsec,endns,sec
	common shalgdcol,cbk,cfg,csaa,cdsn,cdsn2,cksc,cnt,chr,chs

	nm=n_elements(og)
	if not keyword_set(starttime) then begin
		starttime=anytim2ints(ogtime(0),off= -15l*60l)
	endif else starttime=anytim2ints(starttime)
	if not keyword_set(endtime) then endtime=ogtime(nm-1) else endtime=anytim2ints(endtime)

	showaoslosgd,femtime,femflg,starttime=starttime,endtime=endtime

	t=rd_tfile('/ys/ucon/soft/tyoshida/oglist.txt',nocomment='#')
	if n_elements(t) eq 1 then t=rd_tfile('oglist.txt',nocomment='#')
	if n_elements(t) eq 1 then message,/trace,'Cannot find ogfile'
	tnm=fix(strmid(t,0,3))
	tcmt=strmid(t,4,8)
	txt='<'+strtrim(string(indgen(128)),2)+'>'
	for i=0,127 do begin
		wh=where(tnm eq i)
		if wh(0) ne -1 then txt(i)=tcmt(wh(0))
	endfor
	cog=4

	for i=0,nm-1 do if timeinterval(ogtime(i),sttime) lt endns then begin
		showalgdpos,ogtime(i),psec,pclm,/timestr
		plots,/device,[psec,psec],[pclm,pclm+hght*0.55],color=cog
		xyouts,/device,psec+1,pclm+hght*0.55,txt(og(i)),color=cog,chars=1.0*chs
	endif
end
