本文整理汇总了Python中pyaid.number.NumericUtils.NumericUtils.divideValueUncertainties方法的典型用法代码示例。如果您正苦于以下问题:Python NumericUtils.divideValueUncertainties方法的具体用法?Python NumericUtils.divideValueUncertainties怎么用?Python NumericUtils.divideValueUncertainties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyaid.number.NumericUtils.NumericUtils
的用法示例。
在下文中一共展示了NumericUtils.divideValueUncertainties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _analyzeTrack
# 需要导入模块: from pyaid.number.NumericUtils import NumericUtils [as 别名]
# 或者: from pyaid.number.NumericUtils.NumericUtils import divideValueUncertainties [as 别名]
def _analyzeTrack(self, track, series, trackway, sitemap):
if series.count < 1 or not track.pes:
return
segmentPair = None
segmentSeries = None
skipped = 0
for key, otherSeries in series.bundle.items():
if not otherSeries.pes:
continue
if otherSeries == series or otherSeries.left == series.left or otherSeries.count < 2:
# If the series isn't suitable for comparison then mark this as a skipped attempt
# and continue.
skipped += 1
continue
segment = otherSeries.cache.get('curve').getTrackSegment(track)
if segment is None:
continue
for pair in segment.pairs:
if pair['track'] != track:
continue
if segmentPair is None or pair['line'].length.raw < segmentPair['line'].length.raw:
# Store the shortest of the available gauge lengths
segmentPair = pair
segmentSeries = otherSeries
break
if skipped == 4:
# If skipped is 4 it means that no suitable series existed for calculating a gauge
# value and the method should abort quietly
self._ignoreTracks.append(track)
return
if segmentPair is None:
self._errorTracks.append(track)
return
color = 'blue' if segmentSeries.pes == series.pes else 'orange'
data = trackway.cache.get('data')
gauges = data['gauges']
line = segmentPair['line']
sitemap.cache.get('drawing').lineSegment(
line, stroke=color, stroke_width=1, stroke_opacity='0.5')
length = line.length
gauges.abs.append(length)
analysisTrack = track.getAnalysisPair(self.analysisSession)
analysisTrack.simpleGauge = line.length.raw
analysisTrack.simpleGaugeUnc = line.length.rawUncertainty
widthNormGauge = NumericUtils.divideValueUncertainties(
numeratorValue=length,
denominatorValue=series.cache.get('referenceWidth'))
gauges.width.append(widthNormGauge)
point = PositionValue2D(
x=analysisTrack.curvePosition, xUnc=0.0,
y=widthNormGauge.value, yUnc=widthNormGauge.uncertainty)
data['points'].append(point)
if analysisTrack.paceLength:
gauges.pace.append(NumericUtils.divideValueUncertainties(
length, analysisTrack.paceLengthValue))
if analysisTrack.strideLength:
gauges.stride.append(NumericUtils.divideValueUncertainties(
length, analysisTrack.strideLengthValue))
self._count += 1