本文整理汇总了Python中scipy.interpolate.UnivariateSpline.__call__方法的典型用法代码示例。如果您正苦于以下问题:Python UnivariateSpline.__call__方法的具体用法?Python UnivariateSpline.__call__怎么用?Python UnivariateSpline.__call__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.interpolate.UnivariateSpline
的用法示例。
在下文中一共展示了UnivariateSpline.__call__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: xs_interp
# 需要导入模块: from scipy.interpolate import UnivariateSpline [as 别名]
# 或者: from scipy.interpolate.UnivariateSpline import __call__ [as 别名]
def xs_interp (inp_ene, inp_xs, inp_ene_interp, plot_cs):
inp_ene = inp_ene # energies from Talys
inp_xs = inp_xs # xs from talys
inp_ene_interps = inp_ene_interp # energies for interpolation
out_xs_A = []
out_xs = np.array([]) # iterpolated xs
plot_fig = plot_cs
x_ene = np.linspace (0,660,3301)
spl = UnivariateSpline(inp_ene, inp_xs, s = 0.25)
y_xs = spl(x_ene)
for inp_ene_interp in inp_ene_interps:
out_xs_A.append(spl.__call__(inp_ene_interp))
out_xs = np.append(out_xs, out_xs_A)
# optional_plot
if plot_fig:
plt.plot (inp_ene, inp_xs, 'ro', ms = 5)
plt.plot (x_ene, y_xs, lw = 3, c = 'g', alpha = 0.6)
plt.plot (inp_ene_interps, out_xs, 'o', ms = 3)
plt.show()
return out_xs
示例2: thermCond_fit_UnivariateSpline_model
# 需要导入模块: from scipy.interpolate import UnivariateSpline [as 别名]
# 或者: from scipy.interpolate.UnivariateSpline import __call__ [as 别名]
def thermCond_fit_UnivariateSpline_model(T, data=[]):
# This is a fitting model for creating an equation when given a list of x,y values
x = data[0]
y = data[1]
if len(x) <= 5:
order = len(x)-1
else:
order = 5
fit = UnivariateSpline(x, y, k=order)
thermCond = fit.__call__(T)
return thermCond
示例3: __call__
# 需要导入模块: from scipy.interpolate import UnivariateSpline [as 别名]
# 或者: from scipy.interpolate.UnivariateSpline import __call__ [as 别名]
def __call__(self, x):
outside = self.is_outside_domain(x)
return np.where(outside, self.fill_value,
UnivariateSpline.__call__(self, x))
示例4: __call__
# 需要导入模块: from scipy.interpolate import UnivariateSpline [as 别名]
# 或者: from scipy.interpolate.UnivariateSpline import __call__ [as 别名]
def __call__(self, x):
"""Overloaded call method.
"""
return numpy.power(10., UnivariateSpline.__call__(self, numpy.log10(x)))