def run(self, peaks, weights=None):
"""Get smeared values.
Args:
peaks:
weights:
Weight factors for "peaks".
Now this can be one-dimeansional and multi-dimensional arrays.
The last dimension must have the same order as the "peaks".
"""
smearing_function = self._smearing_function
xs = self._xs
sigma = self._sigma
tmp = smearing_function(xs[:, None], peaks[None, :], sigma)
if weights is not None:
values = np.inner(tmp, weights)
else:
values = np.sum(tmp, axis=1)
return values
评论列表
文章目录