Fix mm/cm bug
authorAlexander Vasarab <alexander@wylark.com>
Wed, 21 Dec 2022 03:53:46 +0000 (19:53 -0800)
committerAlexander Vasarab <alexander@wylark.com>
Wed, 21 Dec 2022 03:53:46 +0000 (19:53 -0800)
infoex-autowx.py

index 54fab3999df1e507ab83fdee6535878e5b6be718..46ca9296f45daf5a8431f9a478168c2ce3fbe663 100755 (executable)
@@ -813,9 +813,9 @@ def convert_units_to_american(element_cd, value):
     # if element_cd in ['TMAX', 'TMIN', 'TOBS', 'air_temp', 'air_temp_high_24_hour', 'air_temp_low_24_hour']:
     #     value = c_to_f(value)
 
     # if element_cd in ['TMAX', 'TMIN', 'TOBS', 'air_temp', 'air_temp_high_24_hour', 'air_temp_low_24_hour']:
     #     value = c_to_f(value)
 
-    # # snow values
-    # if element_cd in ['SNWD', 'snow_depth']:
-    #     value = cm_to_in(mm_to_cm(value))
+    # mesowest provides HS in mm, not cm; we want cm
+    if element_cd == 'snow_depth':
+        value = mm_to_cm(value)
 
     # baro values also arrive in metric, so convert to imperial
     if element_cd in ['PRES', 'pressure']:
 
     # baro values also arrive in metric, so convert to imperial
     if element_cd in ['PRES', 'pressure']: