pro pr_dates_warm, ssl, outfil=outfil, guide=guide
;
;+
;NAME:
;	pr_dates_warm
;PURPOSE:
;	To list the dates that SXT CCD was warm
;SAMPLE CALLING SEQUENCE:
;	pr_dates_warm, ssl
;	pr_dates_warm, ssl, outfil='dum.dum'
;OPTIONAL INPUT/OUTPUT:
;	ssl	- The SSL structure.  If undefined, it calls RD_SSL and
;		  reads it.  It is an optional parameter since it takes so
;		  long to read it, if you want to call the routine twice,
;		  it won't have to re-read the SSL files.
;OPTIONAL KEYWORD INPUT:
;	outfil	- An output file name
;HISTORY
;	Written 16-Dec-93 by M.Morrison
;	22-Dec-93 (MDM) - Added guide option
;-
;
if (n_elements(ssl) eq 0) then rd_ssl, '1-sep-91', !stime, ssl
;
lun = -1
if (keyword_set(outfil)) then openw, lun, outfil, /get_lun
if (keyword_set(guide)) then printf, lun, '\begin{verbatim}

;
t1 = gt_temp_ccd(ssl.avg_temp_ccd)
t2 = gt_temp_ccd(ssl(1:*).avg_temp_ccd)
ss = where( (t1 le -20) and (t2 gt -20), n)        ;number of times going warm
;
printf, lun, 'PR_DATES_WARM Program Run: ', !stime
printf, lun, ' '
printf, lun, '   Date         Date          Approx #     High
printf, lun, '   Warm         Cold         days warm     Temp
printf, lun, ' '
             ; 9-JAN-92     10-JAN-92       2 days at   -0.6 C
for i=0,n-1 do begin
    ii = ss(i)+1
    j=0
    while (t1(ii+j) gt -20) do j=j+1
    ;
    ssl_temp = ssl
    temp = gt_temp_ccd(ssl(ii:ii+j-1).max_temp_ccd)
    maxtemp = max(temp)
    ;
    out = gt_day(ssl(ii), /str) + '     ' + gt_day(ssl(ii+j-1), /str) + $
		string(j) + ' days at ' + string(maxtemp, format='(f6.1)') + ' C'
    print, out
    if (lun ne -1) then printf, lun, out	;want it to come to the screen even when going to a file
end
;
if (keyword_set(guide)) then printf, lun, '\end{verbatim}
if (lun ne -1) then free_lun, lun
end
