From f488160294b701c749d2f74b62ed3f5ef7f4594a Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 1 Jun 2020 14:17:34 +0200 Subject: [PATCH] even preciser wind direction visualization (#455) --- lib/view/line.py | 2 +- lib/view/v2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/view/line.py b/lib/view/line.py index e701bdf..571d756 100644 --- a/lib/view/line.py +++ b/lib/view/line.py @@ -145,7 +145,7 @@ def render_wind(data, query): degree = "" if degree: - wind_direction = WIND_DIRECTION[((degree+22)%360)//45] + wind_direction = WIND_DIRECTION[int(((degree+22.5)%360)/45.0)] else: wind_direction = "" diff --git a/lib/view/v2.py b/lib/view/v2.py index b3baefb..c9d8ed6 100644 --- a/lib/view/v2.py +++ b/lib/view/v2.py @@ -350,7 +350,7 @@ def draw_wind(data, color_data): degree = int(degree) if degree: - wind_direction = constants.WIND_DIRECTION[((degree+22)%360)//45] + wind_direction = constants.WIND_DIRECTION[int(((degree+22.5)%360)/45.0)] else: wind_direction = ""