;+
; NAME:
;     QUICKSTRAY
; PURPOSE:
;     look at last few days of SLS data for new leaks
; CATEGORY:
; CALLING SEQUENCE:
;     main program
; INPUTS:
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
;     side, output image size
;     qstop, stops for debugging
; OUTPUTS:
; COMMON BLOCKS:
; SIDE EFFECTS:
;     makes a plot in the current window
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     5-mar-98, written (HSH)
;    18-jul-98, converted to procedure (HSH)
;    13-aug-98, changed hard paths to environment paths (DA)
;    22-aug-98, revised same (HSH)
;    17-apr-1999 - S.L.Freeland - subselect recent 14 days
;     9-may-1999, incorporated new WDBAN monitor images, along
;                 with an empirical factor to match (HSH)
;     6-aug-1999, fixed bug in xrange (HSH)
;-
pro quickstray, side = side, qstop = qstop
if n_elements(side) eq 0 then side = 512 
wdef,0,side
sfrs=newfiles(/sfr)
infil=sel_filetimes(reltime(days=-14),reltime(/now),sfrs)
rd_roadmap,infil,rm
rm1 = rm
ss = where((gt_filta(rm1) eq 2 or gt_filta(rm1) eq 5) $
  and gt_filtb(rm1) eq 1 and $
  gt_percentd(rm1) eq 100 and gt_expmode(rm1) eq 1 and gt_res(rm1) eq 2)
rd_xda,infil,ss,index,data
naban = where(gt_filta(index) eq 2)
wdban = where(gt_filta(index) eq 5)
tots = reform(total(total(sxt_decomp(data),1),1))
nagood = where(tots(naban) gt 1e8)
wdgood = where(tots(wdban) gt 3.5e7)
utplot,index(naban(nagood)),tots(naban(nagood)),index(0),psym=2,$
  yr=[1e8,2e8],tit='Stray light monitor (+ = WDBAN)',$
  xr=int2secarr(index)
factor = 1.29e8/4.29e7*1.015
outplot,index(wdban(wdgood)),tots(wdban(wdgood))*factor,psym=1
timestamp
if n_elements(qstop) ne 0 then stop
end
