-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtractTPEsXml.py
32 lines (26 loc) · 1.2 KB
/
ExtractTPEsXml.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 15 11:17:01 2018
@author: Raluca Sandu
"""
from ElementExistsXml import elementExists
def extractTPES(measurement):
""" extract the TPEs (target positioning errors) values.
:param measurement: singleTrajectory.Measurements.Measurement.TPEErrors
:return: target errors as tuple of 5
"""
tpes = measurement.TPEErrors
if elementExists(tpes, 'targetLateral'):
entryLateral = tpes['entryLateral'][0:5]
targetLateral = tpes['targetLateral'][0:5]
targetLongitudinal = tpes['targetLongitudinal'][0:5]
targetAngular = tpes['targetAngular'][0:5]
targetEuclidean = tpes['targetResidualError'][0:5]
else:
# the case where the TPE errors are 0 in the TPE<0>. instead they are attributes of the measurement
entryLateral = measurement['entryLateral'][0:5]
targetLateral = measurement['targetLateral'][0:5]
targetLongitudinal = measurement['targetLongitudinal'][0:5]
targetAngular = measurement['targetAngular'][0:5]
targetEuclidean = measurement['targetResidualError'][0:5]
return entryLateral, targetLateral, targetAngular, targetLongitudinal, targetEuclidean