function eis_bit_comp, data, a=a, b=b, c=c, Nc=Nc
;
; PURPOSE
;         bit compression in MDP for EIS data from 14 to 12 bits 
;         within each pixel
; HISTORY:
;         2005 Jan 28 by H. Hara
;

a0  =    1877.50 & if keyword_set(a)  then a0=float(a)
b0  =     341.00 & if keyword_set(b)  then b0=float(b)
c0  = -669298.   & if keyword_set(c)  then c0=float(c)
Nc0 =    2048.   & if keyword_set(Nc) then Nc0=float(Nc)

output = fix(data)

ss = where(data gt Nc0)
if ss(0) ne -1 then $
output(ss) = round( (a0*4. + sqrt( b0*float(data(ss))+c0 )*4. ) /4.)

sss = where(output gt 4095)
if sss(0) ne -1 then output(sss) = 4095

return,output

end
