function uvf_interval, times, fid=fid, strings=strings
;
;+ 
;   Name: uvf_interval
;
;   Purpose: return UV Flood interval
;
;   Calling Sequence:
;      uvfi=uvf_interval(times)		; return interval in seconds
;      uvfi=uvf_interval(times,/string) ; return as string from common table
;      uvfi=uvf_interval(fid=fid)	; Specify file id's instead of time
;
;
;   Input Parameters:
;      times - scaler or vector of desired dates
;   
;   RETURNS:
;      Output is UV flood interval in seconds (if /string is not specified)
;
;   OPTIONAL INPUT KEYWORDS:
;      fid	- Times may be specified by file id
;      strings - if set, return as string (default is integer seconds)
;
;   PROCEDURE:
;      Calls gtab_comm to get the common table output and "greps" it.
;   Restrictions: assumes fixed format for string (output from gtab_comm)
;
;   History:
;     12-Jul-1994 (SLF) Written.
;     12-jul-1994 (JRL) Added the fid=fid keyword option
;-

if n_elements(times) ne 0 then begin			; Time format input
   npts = n_elements(times)
   qflag = 1
endif else if n_elements(fid) ne 0 then begin		; Fid format input
   npts = n_elements(fid)
   qflag = 0
endif else message,'Must specify times or fid'   	; No input specified

mirecs=strarr(npts)					; Set up the output array
   
; read the common tables and extract the morning interval string
for i=0,npts-1 do begin
   if qflag then comtab=gtab_comm(times(i)) else comtab=gtab_comm(fid=fid(i))
   morn_int_recs=wc_where(comtab,'SXT Morn Interv:*',/case_ignore,count)
   if count gt 0 then mirecs(i)=comtab(morn_int_recs(0))
endfor

retval=strmid(mirecs,0,45)			; assign string output

; if output in seconds , break and 'fix' the array
if not keyword_set(strings) then begin		; default is interval in seconds
   breakit=strtrim(str2cols(mirecs),2)		; array operation
   retval=reform((fix(breakit(3,*))*60) + fix(breakit(5,*)))
endif

if n_elements(retval) eq 1 then retval=retval(0) ; one element? make scaler

return,retval
end
