[bugfix] no quality set if else was hit

This commit is contained in:
Marcel Paffrath 2017-08-14 11:40:22 +02:00
parent c20ea78e52
commit b585f571da

View File

@ -1078,24 +1078,22 @@ def getQualityfromUncertainty(uncertainty, Errors):
regarding adjusted time errors Errors. regarding adjusted time errors Errors.
''' '''
if uncertainty == None or uncertainty == 'None': # set initial quality to 4 (worst) and change only if one condition is hit
quality = 4 quality = 4
else:
if uncertainty <= Errors[0]: if uncertainty <= Errors[0]:
quality = 0 quality = 0
elif (uncertainty > Errors[0]) and \ elif (uncertainty > Errors[0]) and \
(uncertainty < Errors[1]): (uncertainty < Errors[1]):
quality = 1 quality = 1
elif (uncertainty > Errors[1]) and \ elif (uncertainty > Errors[1]) and \
(uncertainty < Errors[2]): (uncertainty < Errors[2]):
quality = 2 quality = 2
elif (uncertainty > Errors[2]) and \ elif (uncertainty > Errors[2]) and \
(uncertainty < Errors[3]): (uncertainty < Errors[3]):
quality = 3 quality = 3
elif uncertainty > Errors[3]: elif uncertainty > Errors[3]:
quality = 4 quality = 4
else:
pass
return quality return quality