fixed the MHI LUT behavior when MHI=0

This commit is contained in:
Félix Boisselier
2024-05-08 22:17:22 +02:00
parent efc0b86019
commit e3a2a488b1

View File

@@ -140,11 +140,12 @@ def mhi_lut(mhi):
(15, 30, 'Likely a mechanical issue'), (15, 30, 'Likely a mechanical issue'),
(0, 15, 'Mechanical issue detected'), (0, 15, 'Mechanical issue detected'),
] ]
mhi = np.clip(mhi, 1, 100)
for lower, upper, message in ranges: for lower, upper, message in ranges:
if lower < mhi <= upper: if lower < mhi <= upper:
return message return message
return 'Error computing MHI value' return 'Unknown mechanical health' # Should never happen
###################################################################### ######################################################################