##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Lance Simms, Stanford University 2009
#PURPOSE:
#  To attempt to fit a curve to the persistence in the HxRG detectors
#
from numpy import *
import scipy
FitFunc = lambda p, x: p[0]*cos(p[1]*x)*exp(-x/p[2])
ErrFunc = lambda p, x, y: FitFunc(p,x)-y

p0 = [110.,0.5,3.5]
p1, success = scipy.optimize.leastsq(ErrFunc, p0[:], args = (Radii, IntArrs[:,:,4]))
p1, success = scipy.optimize.leastsq(ErrFunc, p0[:], args = (Rad1d, IntArr1d))
