pro plot_sswfov_timeline_xx, info, plot_trange, roi_sel=roi_sel

;nytick=14 & old_range=info.trange & range=info.trange  ;???

  ytick = strarr(20)+' '
  nytick=0

sxt_chan = ['WL?','Thin AL','Dagwood','Be 119','Thick Al','Mg3Mu']
;ytick=[' ',sxt_chan]
sxtf = *info.sxtf
sxtp = *info.sxtp
if n_elements(sxtp) gt 1 then begin
   wtsx = intarr(n_elements(sxtp))
   qsxt_wave = all_vals(gt_filtb(sxtp))
   print,qsxt_wave
   for jw = 0,n_elements(qsxt_wave)-1 do wtsx(where(gt_filtb(sxtp) eq qsxt_wave(jw))) = jw
   ytick(nytick+1) = [sxt_chan(qsxt_wave-1),'SXT ->']
   info.timchan_inst(1:1+n_elements(qsxt_wave)-1) = strarr(n_elements(qsxt_wave))+'sxt'
   nytick = nytick+1+n_elements(qsxt_wave)
endif

tcat = *info.tcat
if n_elements(tcat) gt 1 then begin
   tri_off = nytick+1
   wtxx = intarr(n_elements(tcat))
   if have_tag(tcat, 'filter_name') then begin
     trace_wave = all_vals(tcat.filter_name) 
     trace_time = tcat.time_start
     for jw=0,n_elements(trace_wave)-1 do wtxx(where(tcat.filter_name eq trace_wave(jw))) = jw
   endif else begin
     trace_wave=all_vals(tcat.wave_len)
     trace_time = fmt_tim(tcat)
     for jw=0,n_elements(trace_wave)-1 do wtxx(where(tcat.wave_len eq trace_wave(jw))) = jw
   endelse

   print,trace_wave
;;;   ;ytick = [ytick,' ',trace_wave,' ']
   ytick(tri_off) = [trace_wave,'TRACE ->']
;;;   ;nytick = 1+n_elements(qsxt_wave)+1+n_elements(trace_wave)+1
   info.timchan_inst(tri_off:tri_off+n_elements(trace_wave)-1) = strarr(n_elements(trace_wave))+'tri'
   nytick = nytick+1+n_elements(trace_wave)+1

endif else begin
   tri_off = 0
endelse

nytick=nytick+1
nytick = max([14,nytick])
info.timchan_txt = ytick

   !p.noerase=1
   !p.region=[0.0,0.38,1.0,1.0]
   utplot,plot_trange,[0,0],/nodata, $
        yrange=[0,nytick],yst=1,timer=plot_trange,xst=1+4, $
        tit='Times of TRACE, SXT PFI, etc. Images', $
        ytickname=ytick,yticks=nytick, xtit=' '


   loadct,3
   if n_elements(sxtp) gt 1 then outplot,sxtp,wtsx+1,psym=1,color=140
   if n_elements(tcat) gt 1 then outplot,trace_time,wtxx+tri_off,psym=1

   if n_elements(tcat) gt 1 and keyword_set(roi_sel) then begin
 ;              set pointing filter
        filter=''
        if total(info.fovlim) ne 0 then begin
           lims = strtrim(string(info.fovlim,format='(i12)'),2)
           pointx='xcen='+lims(0)+'~'+lims(2)
           pointy='ycen='+lims(1)+'~'+lims(3)
           filter=[filter,pointx,pointy]
;;	   point_filter = string(pointx,pointy,format='(a,t25,a)')
        endif
        if n_elements(filter) gt 1 then begin
           filter = filter(1:*)
           ss_tri = struct_where(tcat,test=filter)
           if ss_tri(0) ge 0 then begin
              help, tcat, ss_tri
              outplot,trace_time(ss_tri),wtxx(ss_tri)+tri_off,psym=1, color=180
           endif else message,'** No TRACE records within this ROI',/info
        endif
   endif

;       plot spacecraft night-times
   ycrange = !y.crange

   if n_elements(sxtp) gt 1 and not info.network then begin
     !y.crange = [0.0,n_elements(qsxt_wave)+1]
     fem_grid,/fillnight                                                ;Yohkoh nights
   endif

   if n_elements(tcat) gt 1 and not info.network then begin
     !y.crange=[tri_off-1,tri_off+n_elements(trace_wave)]
     trace_goodobs,info.trange(0),info.trange(1),gt0,gt1,dtmin,/noatm   ;TRACE atmospheric absorption
     evt_grid,gt0,gt1,linestyle=1,/quiet
   endif

   !y.crange = ycrange

!p.noerase=0

end

;---------------------------------------------------------------
pro plot_sswfov_timeline,info, zoom=zoom, goes_only=goes_only, roi_sel=roi_sel

common sswfov_info,sxt_chan

if keyword_set(zoom) then message,'ZOOM********',/info

wset, info.wid

plot_trange = info.trange
if keyword_set(zoom) then begin
   print,fmt_tim(info.trange)
   print,fmt_tim(info.sel_trange)
   plot_trange = info.sel_trange
endif

!p.region=[0.0,0.0,1.0,0.46]

if not info.network then begin
  plot_goes,plot_trange(0),plot_trange(1),xst=1, $
      ytit='GOES X-ray Class',tit='',/nodeftit
endif else begin
  eau_plot_goes, plot_trange
endelse

if keyword_set(goes_only) then return

plot_sswfov_timeline_xx, info, plot_trange, roi_sel=roi_sel

savesys,/aplot
*info.wid_sys = !ys_idlsys_temp

!p.region=0
end
