pro over_lineplot
tvlct, r, g, b, /get
;
; Swap black background, white foreground
; 
; Get background color (element 0)
background = r[0]
foreground = r[255]

; Swap
r[255] = background & g[255] = background & b[255] = background
r[0] = foreground & g[0] = foreground & b[0] = foreground

tvlct, r, g, b
end

;+
; NAME:
;     GO_QUICK
; PURPOSE:
;     create quick looks at Yohkoh data, software, database diagnostics
;       to be shown on the $ftp/pub/sxt_co/quick/quick.html display
; CATEGORY:
; CALLING SEQUENCE:
;     main program
; INPUTS:
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
; OUTPUTS:
; COMMON BLOCKS:
; SIDE EFFECTS:
; ROUTINES
;     runs the "quick" series of programs on this directory (/0p/sxt_co/idl)
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     August 1998, written (HSH)
;     23-Aug-98, added LASTSFD (HSH)
;     08-Oct-98, added default ftp location, recast in terms of environmentals. 
;     24-Nov-98, added LASTSFD_DIFF (HSH)
;     06-Jan-99, added FAKE_PATROL, SHOW_CONTACTS.  Commented out QUICKLIMB.
;		 (DMcK)
;     11-Jan-99, added SET_PLOT,'Z' after LATEST_SFDS_GIF, to counter the 
;		 explicit set_plot,'x' within that program. (DMcK)
;      9-Jul-99, revised the terminator display to account for
;                the new normal pointing installed 2-Jul-99.
;                Added SXT_COVERAGE_MAP. (HSH)
;      9-Jul-99, OVER_LINEPLOT (BH)
;     18-Jul-99, LASTKSC added (HSH) 
;     11-Oct-99, added spawn to 'convert' .gif for isass0/1 login banners (PGS)
;     17-Oct-99, added quick_dpe, note: reverses color table.  (PGS)
;     12-nov-99, added '/quick' to fake_patrol call. (PGS)
;     18-Apr-00, added plottrav call. (BNH)
;     23-AUg-00, wrapped separate activities in 'execute' statements & IF-blocks. (PGS)
;     09-Jul-01, edited path to 'convert' (DMcK)
;     28-Aug-01, commented out error message for latest_sfd_gifs. (PGS)
;-
get_lun,lun
openw,lun,'$DIR_SITE_FTP/pub/sxt_co/quick/lastksc.html'

pro_lastksc='lastksc,names'
stat_lastksc=execute(pro_lastksc)
IF (stat_lastksc) THEN BEGIN
   printf,lun,'<html>'
   for i = 0,6 do printf,lun,'<p>'+names(i)
   printf,lun,'</html>'
   close,lun
ENDIF

;
set_plot,'z'
loadct,0
over
tvlct,r,g,b,/get

pro_term_fids = 'term_fids'
stat_term_fids = execute(pro_term_fids)
IF (stat_term_fids) THEN BEGIN
   plottime
   img7 = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/fids.gif',img7,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/fids_thumb.gif',$
   rebin(img7,((size(img7))(1))/4,((size(img7))(2))/4),r,g,b
;  rebin(img7,160,120),r,g,b
;  rebin(img7,128,128),r,g,b
ENDIF ELSE mail, 'problem with term_fids in go_quick.pro',users='shirts'

erase
set_plot,'z'
loadct,0
over
tvlct,r,g,b,/get

pro_quickatt  = 'quickatt'
stat_quickatt = execute(pro_quickatt)
IF(stat_quickatt) THEN BEGIN
   img1 = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/att.gif',img1,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/att_thumb.gif',rebin(img1,128,128),r,g,b
ENDIF ELSE mail, 'problem with quick_att in go_quick.pro',users='shirts'

erase
set_plot,'z'
loadct,0
over
tvlct,r,g,b,/get

pro_quickdark  = 'quickdark'
stat_quickdark = execute(pro_quickdark)
IF (stat_quickdark) THEN BEGIN
   img2 = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/dark.gif',img2,r,g,b 
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/dark_thumb.gif',rebin(img2,128,128),r,g,b
ENDIF ELSE mail, 'problem with quick_dark in go_quick.pro',users='shirts'

erase
set_plot,'z'
loadct,0
over
tvlct,r,g,b,/get

pro_quickstray  = 'quickstray'
stat_quickstray = execute(pro_quickstray)
IF (stat_quickstray) THEN BEGIN
   img3 = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/stray.gif',img3,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/stray_thumb.gif',rebin(img3,128,128),r,g,b
ENDIF ELSE mail, 'problem with quickstray in go_quick.pro',users='shirts'

erase
set_plot,'z'
loadct,0
over
tvlct,r,g,b,/get


;quicklimb
;img4 = tvrd()
;write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/limb.gif',img4,r,g,b
;write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/limb_thumb.gif',rebin(img4,128,128),r,g,b

pro_weekly_goes  = 'weekly_goes'
stat_weekly_goes = execute(pro_weekly_goes)
IF (stat_weekly_goes) THEN BEGIN
   img5 = tvrd()
   tvlct,r,g,b,/get
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/weeklygoes.gif',img5,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/weeklygoes_thumb.gif',rebin(img5,128,128),r,g,b   
ENDIF ELSE mail, 'problem with weekly_goes in go_quick.pro',users='shirts'

erase
set_plot,'z'
loadct,0
over
tvlct,r,g,b,/get

pro_goes_tek= 'goes_tek'
stat_goes_tek = execute(pro_goes_tek)
IF (stat_goes_tek) THEN BEGIN
   img6 = tvrd()
   tvlct,r,g,b,/get
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/goes_tek.gif',img6,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/goes_tek_thumb.gif',$
      rebin(img6,128,128),r,g,b
ENDIF ELSE mail, 'problem with goes_tek in go_quick.pro',users='shirts'
;
;     new terminator program, installed 8-Jul-99 (HSH) 
;

erase
set_plot,'z'
wdef
linecolors
over_lineplot

pro_term_quick='term_quick'
stat_term_quick = execute(pro_term_quick)
IF (stat_term_quick) THEN BEGIN
   out_img = tvrd()
   tvlct,r,g,b,/get
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/term_quick.gif',out_img,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/term_quick_thumb.gif',$
     rebin(out_img,128,128),r,g,b   
ENDIF ELSE mail, 'problem with term_quick in go_quick.pro',users='shirts'

erase
set_plot,'z'
wdef
linecolors   
over_lineplot

pro_term_quick2='term_quick,/radius'
stat_term_quick2 = execute(pro_term_quick2)
IF (stat_term_quick2) THEN BEGIN
   out_img = tvrd()
   tvlct,r,g,b,/get
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/term_quick_rad.gif',out_img,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/term_quick_rad_thumb.gif',$
     rebin(out_img,128,128),r,g,b
ENDIF ELSE mail, 'problem with second term_quick call in go_quick.pro',users='shirts'

erase
set_plot,'z'
wdef
linecolors   
over_lineplot

pro_latest_sfds_gif='latest_sfds_gif'
stat_latest_sfds_gif=execute(pro_latest_sfds_gif)
IF (stat_latest_sfds_gif) THEN BEGIN
;   spawn, '/usr/local/bin/convert $ftp/pub/sxt_co/quick/latest_sfd_18.gif -colors 180 $ftp/pub/sxt_co/quick/latest_sfd_18.xpm'
   spawn, '/usr/X11R6/bin/convert $ftp/pub/sxt_co/quick/latest_sfd_18.gif -colors 180 $ftp/pub/sxt_co/quick/latest_sfd_18.xpm'
ENDIF; ELSE mail, 'problem with latest_sfds_gif in go_quick.pro',users='shirts'

set_plot,'z'		; Added 11-jan-99
loadct,0
wdef,0,512,512

pro_lastsfd_diff  = 'lastsfd_diff'
stat_lastsfd_diff = execute(pro_lastsfd_diff)
IF (stat_lastsfd_diff) THEN BEGIN
   plottime
   img8 = tvrd()
   tvlct,r,g,b,/get 
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/diff.gif',img8,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/diff_thumb.gif',$
     rebin(img8,((size(img8))(1))/4,((size(img8))(2))/4),r,g,b
;     rebin(img8,128,128),r,g,b
ENDIF ELSE mail, 'problem with lastsfd_diff in go_quick.pro',users='shirts'

erase
set_plot,'z'    
loadct,0
tvlct,r,g,b,/get

pro_fake_patrol  = 'fake_patrol, /quick'
stat_fake_patrol = execute(pro_fake_patrol)
IF (stat_fake_patrol) THEN BEGIN
   plottime
   pat_img=tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/fake_patrol_image.gif',pat_img,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/fake_patrol_image_thumb.gif',$
     rebin(pat_img,128,128),r,g,b
ENDIF ELSE mail, 'problem with fake_patrol in go_quick.pro',users='shirts'

erase
set_plot,'z'
loadct,0
tvlct,r,g,b,/get

outgif_show_contacts='$DIR_SITE_FTP/pub/sxt_co/quick/contacts.gif'
pro_show_contacts  = 'show_contacts,/zbuffer,outgif=outgif_show_contacts'
stat_show_contacts = execute(pro_show_contacts)
IF (stat_show_contacts) THEN BEGIN
   read_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/contacts.gif',contacts,r,g,b
   wdef,0,1200,300
   tv,contacts
   plottime
   contacts=tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/contacts.gif',contacts,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/contacts_thumb.gif',$
   rebin(contacts,400,100),r,g,b
ENDIF ELSE mail, 'problem with show_contacts in go_quick.pro',users='shirts'

;
;  PFI coverage
;
erase
set_plot,'z'
wdef,0,256
loadct,15
over
tvlct,r,g,b,/get

pro_sxt_exposure_map  = 'sxt_exposure_map'
stat_sxt_exposure_map = execute(pro_sxt_exposure_map)
IF (stat_sxt_exposure_map) THEN BEGIN
   out_img = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/coverage.gif',out_img,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/coverage_thumb.gif',$
      rebin(out_img,128,128),r,g,b
ENDIF ELSE mail, 'problem with sxt_exposure_map in go_quick.pro',users='shirts'

;
;quick_dpe
;

erase
set_plot,'z'
wdef, 0, 512, 512
loadct, 0
over
tvlct,r,g,b,/get

pro_quick_dpe  = 'quick_dpe'
stat_quick_dpe = execute(pro_quick_dpe)
!p.multi=[0,1,0]
IF (stat_quick_dpe) THEN BEGIN
   out_img = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/quick_dpe.gif',out_img,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/quick_dpe_thumb.gif',$
      rebin(out_img,((size(out_img))(1))/4,((size(out_img))(2))/4),r,g,b
ENDIF ELSE mail, 'problem with quick_dpe in go_quick.pro',users='shirts'
;
;
; plot_trav
;
erase
set_plot, 'z'
loadct, 0
tvlct, r, g, b, /get

pro_quick_plottrav  = 'quick_plottrav'
stat_quick_plottrav = execute(pro_quick_plottrav) 
IF (stat_quick_plottrav) THEN BEGIN
   imgpi = tvrd()
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/plottrav.gif',imgpi,r,g,b
   write_gif,'$DIR_SITE_FTP/pub/sxt_co/quick/plottrav_thumb.gif',rebin(imgpi,128,128),r,g,b
ENDIF ELSE mail, 'problem with quick_plottrav in go_quick.pro',users='shirts'

end


