function fmt_pass,contacts
;+								(5-aug-92)
;  Name:
;    fmt_pass
;  Purpose:
;    Produce a text string array containing the information about Yohkoh
;    station contacts contained in the structure contacts.
;
; Calling sequence:
;    A = fmt_pass( contacts )
;
; Inputs:
;     contacts  =  Structure written by the function contact_sum
;
; Modification History:
;    Written, 10-dec-91, J. R. Lemen
;    Modified, 5-aug-92, JRL:  Add KSC Ant=10 deg time.  Change the format
;			       so that 5 text lines are now produced.
;    28-mar-95, JRL, Changed one tag name slightly
;-

npts = n_elements(contacts)
pass_sum_str = replicate(' ',5,npts)		; Set up output string array
for i=0,npts-1 do begin
; ------------------------
;  Line 0: Pass ID, D/N, NOP or BDR (DSN)
; ------------------------
  daynight = strtrim(contacts(i).daynight,2)
  pass_sum_str(0,i) = contacts(i).station+' '+contacts(i).passid+' '	$
		    + gt_time(contacts(i).aos_time,/str)+' '		$
		    + gt_day(contacts(i).aos_time,/str) +' - '		$
		    + gt_time(contacts(i).los_time,/str)+'  '		$
		    + daynight
  jj = 15-strlen(daynight)		;15=Field width
  if (daynight eq 'D/N') or (daynight eq 'N/D') then tmp = ' at '	$
		    + strmid(gt_time(contacts(i).DN_time,/str),0,8)	$
		    else tmp = strmid('            ',0,jj)
  if contacts(i).station eq 'U' then 					$
	tmp = tmp + '    NOP: ' + gt_time(contacts(i).nop_time,/str)	$
				else					$
	tmp = tmp + 'BDR REP: ' + gt_time(contacts(i).bdr_rep,/str)
  pass_sum_str(0,i) = pass_sum_str(0,i) + tmp
		    
; ------------------------
;  Line 1: JST time (KSC), A/B
; ------------------------
  tmp = contacts(i).antenna
  if (tmp eq 'A/B') or (tmp eq 'B/A') then tmp = tmp + ' at ' +		$
			strmid(gt_time(contacts(i).AB_time,/str),0,8) +	$
		'    (Ant El='+string(contacts(i).ant_elv_AB,		$
		format='(f4.1)') + ') ' 				$
  	else tmp = tmp + '                   '
  if contacts(i).station eq 'U' then begin
     jst_aos = addtime(contacts(i).aos_time,del=+9.*60)
     jst_los = addtime(contacts(i).los_time,del=+9.*60)
     tmp1 = '             ('+ gt_time(jst_aos,/str)+' '+		$
			      gt_day( jst_aos,/str)+' - '+		$
			      gt_time(jst_los,/str)+') '
  endif else tmp1 = string(' ',format='(44x,a)')
  pass_sum_str(1,i) = tmp1 + tmp

; ------------------------
;  Line 2:  Max Ant time
; ------------------------
  tmp = string(' ',format='(44x,a)')
  tmp = tmp + 'Max Ant='+string(contacts(i).ant_max,format='(f4.1)')
  tmp = tmp + '         at ' + strmid(gt_time(contacts(i).ant_max_time,/str),0,8)
  pass_sum_str(2,i) = tmp

; ------------------------
;  Line 3:  10 Degree time
; ------------------------
  if contacts(i).station eq 'U' then begin
    tmp1 = string(' ',format='(44x,a)')
    tmp = 'Ant El = 10 deg      at '+	$
		strmid(gt_time(contacts(i).ant_10_time,/str),0,8)
    pass_sum_str(3,i) = tmp1 + tmp
    next_j = 4
  endif else next_j = 3

; ------------------------
;  Line 4:  LOS (QT H or QT M)
; ------------------------
  pass_sum_str(next_j,i) = string(' ',format='(44x,a)')
  tmp = contacts(i).comment
  if i le npts-2 then tmp = tmp + '       ('+				$
		strtrim(fix(contacts(i+1).day_elaps+0.5),2)+' min)'
  pass_sum_str(next_j,i) = pass_sum_str(next_j,i) + tmp
endfor

return,pass_sum_str
end
