
function get_w64, sher
;+
;  Name:
;       GET_W64
; w64 = get_w64( sher )
;
; Input - Sher - raw sher rates, not divided by channel widths.
; Output - W64 - extra width in channel 64 in 16th channel units
;
;w64 is the width of channel 64 (0-64) of the BATSE SPECs
;It is arbitrary and ranges from 1 to 2 linear channels in steps of 1/16
;The width is found by taking the value of the number of steps which
;best satisfies continuity in the derivative of the count rate/wrt channel.
;
;-

w64 = findgen(17)/16.
d = 1.+w64/16.
n = sher

;the best value makes the following difference closest to zero
test = min( abs((n(65)/2-n(63))/(1.5+d) - (n(64)/d-n(63))/(.5+d/2.)), w64s)

return, w64s
end

