本文整理汇总了Python中larch.Group.k方法的典型用法代码示例。如果您正苦于以下问题:Python Group.k方法的具体用法?Python Group.k怎么用?Python Group.k使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类larch.Group
的用法示例。
在下文中一共展示了Group.k方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _ff2chi
# 需要导入模块: from larch import Group [as 别名]
# 或者: from larch.Group import k [as 别名]
def _ff2chi(pathlist, group=None, paramgroup=None, _larch=None,
k=None, kmax=None, kstep=0.05, **kws):
"""sum chi(k) for a list of FeffPath Groups.
Parameters:
------------
pathlist: a list of FeffPath Groups
paramgroup: a Parameter Group for calculating Path Parameters [None]
kmax: maximum k value for chi calculation [20].
kstep: step in k value for chi calculation [0.05].
k: explicit array of k values to calculate chi.
Returns:
---------
group contain arrays for k and chi
This essentially calls path2chi() for each of the paths in the
pathlist and writes the resulting arrays to group.k and group.chi.
"""
msg = _larch.writer.write
if (paramgroup is not None and _larch is not None and
_larch.symtable.isgroup(paramgroup)):
_larch.symtable._sys.paramGroup = paramgroup
for path in pathlist:
if not isNamedClass(path, FeffPathGroup):
msg('%s is not a valid Feff Path' % path)
return
path._calc_chi(k=k, kstep=kstep, kmax=kmax)
k = pathlist[0].k[:]
out = np.zeros_like(k)
for path in pathlist:
out += path.chi
if group is None:
group = Group()
else:
group = set_xafsGroup(group, _larch=_larch)
group.k = k
group.chi = out
return group