Changed accumulation metric names
This commit is contained in:
@@ -383,8 +383,9 @@ def read_luna(c, temp_c):
|
|||||||
if strength < 100 or dist <= 0 or dist > c['LUNA_MAX_DIST_CM']:
|
if strength < 100 or dist <= 0 or dist > c['LUNA_MAX_DIST_CM']:
|
||||||
write(c, 'accumulation', null); return
|
write(c, 'accumulation', null); return
|
||||||
|
|
||||||
fields = {'ground_distance': dist, 'lidar_strength': strength}
|
fields = {'ground_distance': dist, 'ground_calibration': luna_baseline_cm, 'lidar_strength': strength}
|
||||||
|
|
||||||
|
kind = 'none'
|
||||||
if luna_baseline_cm and (luna_baseline_cm - dist) >= c['LUNA_MIN_DEPTH_CM']:
|
if luna_baseline_cm and (luna_baseline_cm - dist) >= c['LUNA_MIN_DEPTH_CM']:
|
||||||
t = temp_c
|
t = temp_c
|
||||||
depth = round(luna_baseline_cm - dist, 1)
|
depth = round(luna_baseline_cm - dist, 1)
|
||||||
@@ -393,11 +394,10 @@ def read_luna(c, temp_c):
|
|||||||
'slush' if t is not None and t > c['SLUSH_TEMP_THRESHOLD'] else
|
'slush' if t is not None and t > c['SLUSH_TEMP_THRESHOLD'] else
|
||||||
'snow' if strength > c['SNOW_STRENGTH_MIN'] else 'ice'
|
'snow' if strength > c['SNOW_STRENGTH_MIN'] else 'ice'
|
||||||
)
|
)
|
||||||
fields['ground_calibration'] = luna_baseline_cm
|
|
||||||
fields['accumulation'] = depth
|
fields['accumulation'] = depth
|
||||||
write(c, 'accumulation', fields, tags={'accumulation_type': kind})
|
|
||||||
else:
|
else:
|
||||||
write(c, 'accumulation', fields)
|
fields['accumulation'] = 0
|
||||||
|
write(c, 'accumulation', fields, tags={'accumulation_type': kind})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[TF-Luna] {e}")
|
print(f"[TF-Luna] {e}")
|
||||||
write(c, 'accumulation', null)
|
write(c, 'accumulation', null)
|
||||||
|
|||||||
Reference in New Issue
Block a user