function valid_pass,event,op_rules
;+							(15-nov-91)
;  Name:
;    valid_pass
;  Purpose:
;    Search through the event list and select passes which have antenna
;    elevations which exceed the minimum op_rules value for the minimum
;    op_rules time.
;  History:
;    19-oct-91, Written, J. R. Lemen
;    15-nov-91, Updated, J. R. Lemen, take abs() so subsequent
;				      application will still work
;-
n_eve = n_elements(event)
event2 = event
nmax = max(event.pass_num)

for i=0,nmax-1 do begin
  jj = where( event.pass_num eq i, npts )
  if npts gt 0 then begin
     j1 = where(event(jj).og eq 255) & j1=j1(0)	; Antenna above min elevation
     j2 = where(event(jj).og eq 256) & j2=j2(0)	; Antenna below min elevation
     if j2(0) eq -1 then j2 = npts-1		; Antenna above @ end of contact
     if (j1 eq -1) then pass_length = 0. else $
     	pass_length = addtime(event(jj(j2)).timarr,dif=event(jj(j1)).timarr)
        

     if (event(jj(0)).station eq 'U') then pass_check = op_rules.valid.a $
				      else pass_check = op_rules.valid_dsn.a
; ------------------------------------------------
;    if event(jj(0)).station ne 'U' then begin
;       print,event(jj(0)).station,pass_length
;       if (pass_length ge 9.5) and (pass_length lt 11.) then stop
;    endif
; ------------------------------------------------
     if pass_length lt pass_check then 	$
       	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
  endif
endfor

return,event2
end
