function dark_current_fit_function, p

common FuncXY, T, S

;The funcion I am trying to fit is one for the darkcurrent on the 
;H4RG.  It looks like it has the following form (T is time; not temperature):
;
;S = MinSignal + FullRange*(1-exp(-lambda*T))
;
;p(0) = MinSignal
;p(1) = FullRange
;p(2) = Lambda
;
return, total(abs(S-(p(0)-p(1)*exp(-p(2)*T))))

end
