Created
November 7, 2019 20:19
-
-
Save APN-Pucky/b19d86e170cd848f8b99ed5fc41a6e08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.odr import * | |
def fit_curve(datax,datay,function,p0=None,yerr=None,xerr=None): | |
model = Model(lambda p,x : function(x,*p)) | |
realdata = RealData(datax,datay,sx=xerr,sy=yerr) | |
odr = ODR(realdata,model,beta0=p0) | |
out = odr.run() | |
return unp.uarray(out.beta,out.sd_beta) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment