refine re dss script correction
[django_unres.git] / files / matplotlib_fit_hist.py
index e08d110..f431e31 100755 (executable)
@@ -11,9 +11,11 @@ import sys
 
 def prob_T(x,a):
     gg=np.float128(g)
-    aa=np.float128(10**(-gg-2)*a)
+#    aa=np.float128(10**(-gg-2)*a)
+    aa=np.float128(a)
     Tr=np.float128(t_bath)
-    return np.exp( np.log(aa) + (gg-2)/2*np.log(x) - gg*x/(2*Tr) )
+    return np.exp( aa + (gg-2)/2*np.log(x) - gg*x/(2*Tr) )
+#    return np.exp( np.log(aa) + (gg-2)/2*np.log(x) - gg*x/(2*Tr) )
 #    return aa * (  x**((gg-2)/2) * np.exp( -gg*x/(2*Tr) ) )
 
 #x,y= np.loadtxt('1L2Y_L_GB000.stat',usecols=(0,10),skiprows=30,unpack=True)
@@ -44,7 +46,8 @@ plt.xlabel('temperature')
 center = (bin[:-1] + bin[1:]) / 2
 #print bin
 #print center
-popt, pcov = curve_fit(prob_T, center, h)
+start = (g-2)/2*np.log(t_bath) - g*t_bath/(2*t_bath)
+popt, pcov = curve_fit(prob_T, center, h, p0=-start)
 xfine = np.linspace(min(bin), max(bin), 100)
 #print popt