当前位置: 首页>>代码示例>>Python>>正文


Python UnivariateSpline.__call__方法代码示例

本文整理汇总了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
开发者ID:lukawr,项目名称:flux,代码行数:30,代码来源:flux.py

示例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
开发者ID:JohnRuhl,项目名称:cmbtools,代码行数:13,代码来源:Material_Database_Functions.py

示例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))
开发者ID:llimeht,项目名称:refnx,代码行数:7,代码来源:bounded_splines.py

示例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)))
开发者ID:lucabaldini,项目名称:ximpol,代码行数:6,代码来源:spline.py


注:本文中的scipy.interpolate.UnivariateSpline.__call__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。