Commit 59fdb2a5 authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

use spline intrepolation with smoothing

parent dd6aa1f5
......@@ -4,7 +4,7 @@ from __future__ import print_function
import numpy as np
import sys
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from scipy.interpolate import interp1d, Rbf,UnivariateSpline
from scipy.optimize import minimize_scalar,brentq
file=sys.argv[1]
......@@ -27,7 +27,10 @@ chi2=chi2[w]
var=var[w]
#interpolated function
f=interp1d(var,chi2,kind='quadratic')
#f=interp1d(var,chi2,kind='quadratic')
#f=Rbf(var,chi2)
f=UnivariateSpline(var,chi2)
#minimum
res=minimize_scalar(f,bounds=(var[0],var[-1]),method='bounded')
xmin=res.x
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment