本文整理匯總了Python中pyaid.number.NumericUtils.NumericUtils.getWeightedMeanAndDeviation方法的典型用法代碼示例。如果您正苦於以下問題:Python NumericUtils.getWeightedMeanAndDeviation方法的具體用法?Python NumericUtils.getWeightedMeanAndDeviation怎麽用?Python NumericUtils.getWeightedMeanAndDeviation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyaid.number.NumericUtils.NumericUtils
的用法示例。
在下文中一共展示了NumericUtils.getWeightedMeanAndDeviation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _processGaugeData
# 需要導入模塊: from pyaid.number.NumericUtils import NumericUtils [as 別名]
# 或者: from pyaid.number.NumericUtils.NumericUtils import getWeightedMeanAndDeviation [as 別名]
def _processGaugeData(self, bundle, trackway, data):
pesCount = bundle.leftPes.count + bundle.rightPes.count
record = {'name':trackway.name, 'count':pesCount}
gaugeData = data['gauges']
try:
value = NumericUtils.getWeightedMeanAndDeviation(gaugeData.abs)
record['abs'] = value.value
record['absUnc'] = value.uncertainty
self._trackwayGauges.abs.append((pesCount, value))
except ZeroDivisionError:
return
widthValue = NumericUtils.getWeightedMeanAndDeviation(gaugeData.width)
record['width'] = widthValue.value
record['widthUnc'] = widthValue.uncertainty
self._trackwayGauges.width.append((pesCount, widthValue))
if gaugeData.pace:
value = NumericUtils.getWeightedMeanAndDeviation(gaugeData.pace)
record['pace'] = value.value
record['paceUnc'] = value.uncertainty
self._trackwayGauges.pace.append((pesCount, value))
else:
record['pace'] = ''
record['paceUnc'] = ''
if gaugeData.stride:
value = NumericUtils.getWeightedMeanAndDeviation(gaugeData.stride)
record['stride'] = value.value
record['strideUnc'] = value.uncertainty
self._trackwayGauges.stride.append((pesCount, value))
else:
record['stride'] = ''
record['strideUnc'] = ''
self._trackwayCsv.addRow(record)
plot = ScatterPlot(
data=data['points'],
title='%s Width-Normalized Gauges (%s)' % (trackway.name, widthValue.label),
xLabel='Track Position (m)',
yLabel='Gauge (AU)')
self._paths.append(plot.save(self.getTempFilePath(extension='pdf')))
analysisTrackway = trackway.getAnalysisPair(self.analysisSession)
analysisTrackway.simpleGauge = widthValue.raw
analysisTrackway.simpleGaugeUnc = widthValue.rawUncertainty