本文整理汇总了Python中histogram.Histogram.setup方法的典型用法代码示例。如果您正苦于以下问题:Python Histogram.setup方法的具体用法?Python Histogram.setup怎么用?Python Histogram.setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类histogram.Histogram
的用法示例。
在下文中一共展示了Histogram.setup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hist_set
# 需要导入模块: from histogram import Histogram [as 别名]
# 或者: from histogram.Histogram import setup [as 别名]
def hist_set(self):
""" A method to generate and yield (energy, histogram) pairs.
Usage: for energy, hist in fits_parser.hist_set():
... do something ...
yield:
(float, Histogram): The energy and histogram pairs. This will yield one set
for each energy in the fits file.
"""
print 'Generating hist set'
xedges = self._get_edges(self._x_ref, self._x_del)
yedges = self._get_edges(self._y_ref, self._y_del)
for i, energy in enumerate(self._energies):
print '\tHistogram for', energy
h = Histogram()
h.setup(self._data[i], xedges, yedges)
energy = energy[0]
yield (energy, h)
print 'Done'