function valid_pass3, event, KSC_tim1, KSC_tim2, str_remove_=str_remove
;+							(15-nov-91)
;  Name:
;    valid_pass3
;  Purpose:
;    Eliminate KSC passes from op selection between times KSC_tim1 and KSC_tim2
;
;  Inputs:
;    event	= Event structure
;    KSC_tim1	= Starting time (external format)
;    KSC_tim2	= Ending time   (external format)
;
;  Outputs:
;    Function returns an edited version of event.
;
;  Optional Output Keyword:
;    str_remove = String array of KSC contacts eliminated
;
;  Method:
;    if (total(KSC_tim1) eq 0) or (total(KSC_time2) eq 0), no action is taken.
;
;  History:
;    15-nov-91, Written, J. Lemen
;-

event2 = event
nmax = max(event.pass_num)			; Max number of passes
str_remove = '-1'                               ; Return this string array
; Don't do anything if both times are undefined:
if (total(KSC_tim1) eq 0) or (total(KSC_tim2) eq 0) then return,event2

for i=0,nmax do begin
  jj = where( event.pass_num eq i, npts )
  if npts gt 0 then begin
     if strtrim(event(jj(0)).station) eq 'U' then begin	; Only do KSC contacts
	
	timdiff1 = addtime(event(jj(0)).timarr,diff=KSC_tim1)
	timdiff2 = addtime(event(jj(0)).timarr,diff=KSC_tim2)
                                               ; pass_remove = 1 means remove
 	if (timdiff1 ge 0.) and (timdiff2 lt 0.) then pass_remove = 1 $
						 else pass_remove = 0

; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       if pass_remove then begin
       	 for j=0,npts-1 do begin
   ; Take abs() in case already eliminated:
           event2(jj(j)).og = - abs(event(jj(j)).og )
	   if event2(jj(j)).og eq 0 then event2(jj(j)).og = -99
	 endfor
         temp_str = '  KSC  '+fmt_tim(event2(jj(0)).timarr)+    $
                                '  '+event2(jj(0)).station
         str_remove = [str_remove, temp_str]
       endif
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     endif					; event(jj(0).station eq 'U'
  endif						; npts gt 0
endfor

if n_elements( str_remove ) gt 1 then begin
  str_remove = str_remove(1:*)
  print,' '
  print,' Eliminated KSC Station times:'
  print,str_remove,format='(x,a)'
endif
 
return,event2
end
