function dprate2sec, dprate_in
;
;+
;NAME:
;	dprate2sec
;PURPOSE:
;	Given a DP_RATE code, return the major frame rate in sec
;CALLING SEQUENCE:
;	rate = dprate2sec(roadmap)
;	rate = dprate2sec(index)
;INPUT:
;	dprate	- the "dp_rate" field in a structure
;OUTPUT:
;	returns Major frame rate in seconds
;HISTORY:
;	Written Fall 91 by M.Morrison
;	19-Feb-92 (MDM) - fixed bug.  when checking to see if 
;			  telemetry value had been /32, it was not
;			  checking properly - if initial rate was low,
;			  it thought the value had be /32 already
;	31-May-92 (MDM) - Modified so that input can be structure with
;			  .DP_RATE field (it will call GT_DP_RATE if so)
;-
;
;
siz = size(dprate_in)
typ = siz( siz(0)+1 )
if (typ eq 8) then begin
    dprate = gt_dp_rate(dprate_in)
end else begin
    dprate = dprate_in
end
;
del_dp_rate = [-1, 64.0, 16.0, -1, 2.0, -1]   ;seconds
;               100xxxxx (=4) High rate
;               010xxxxx (=2) Medium rate
;               001xxxxx (=1) Low rate
;
if (dprate(0) ge 32) then begin	;assume they did not extract bits yet	- changed from gt to ge on 19-Feb-92
    dprate0 = dprate/32		;look only at high 3 bits
end else begin
    dprate0 = dprate
end
;
dprate0 = dprate0>0<5	;make sure there is no access errors
return, del_dp_rate(dprate0)
end
