From c545b9fe801f0f7442a89eff3973271e3af6ec3c Mon Sep 17 00:00:00 2001 From: Alexander Skinner Hassan Date: Fri, 21 Apr 2023 14:19:27 -0500 Subject: [PATCH] added pressure units in mmHg --- lib/metno.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/metno.py b/lib/metno.py index 18aae75..046500c 100755 --- a/lib/metno.py +++ b/lib/metno.py @@ -177,6 +177,8 @@ def hpa_to_mb(hpa): def hpa_to_in(hpa): return round(hpa * 0.02953, 2) +def hpa_to_mmHg(hpa): + return round(hpa * 0.75006157584566 , 3) def group_hours_to_days(lat, lng, hourlies, days_to_return): tf = timezonefinder.TimezoneFinder() @@ -345,6 +347,7 @@ def _convert_hour(hour): "visibility": 'not yet implemented', # str(details['vis_km']), "visibilityMiles": 'not yet implemented', # str(details['vis_miles']), "pressure": str(hpa_to_mb(details['air_pressure_at_sea_level'])), + "pressure_mmHg": str(hpa_to_mmHg(details['air_pressure_at_sea_level'])), "pressureInches": str(hpa_to_in(details['air_pressure_at_sea_level'])), "cloudcover": 'not yet implemented', # Convert from cloud_area_fraction?? str(details['cloud']), # metno doesn't have FeelsLikeC, but we-lang.go is using it in calcs,