Changed accumulation metric names

This commit is contained in:
2026-06-23 23:36:57 -04:00
parent 0c2c957dd1
commit 2985a62d7d

View File

@@ -383,8 +383,9 @@ def read_luna(c, temp_c):
if strength < 100 or dist <= 0 or dist > c['LUNA_MAX_DIST_CM']:
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']:
t = temp_c
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
'snow' if strength > c['SNOW_STRENGTH_MIN'] else 'ice'
)
fields['ground_calibration'] = luna_baseline_cm
fields['accumulation'] = depth
write(c, 'accumulation', fields, tags={'accumulation_type': kind})
else:
write(c, 'accumulation', fields)
fields['accumulation'] = 0
write(c, 'accumulation', fields, tags={'accumulation_type': kind})
except Exception as e:
print(f"[TF-Luna] {e}")
write(c, 'accumulation', null)