diff options
Diffstat (limited to 'waterspout_radar/_radar.py')
-rw-r--r-- | waterspout_radar/_radar.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/waterspout_radar/_radar.py b/waterspout_radar/_radar.py index c8cca1f..380c70b 100644 --- a/waterspout_radar/_radar.py +++ b/waterspout_radar/_radar.py @@ -2,6 +2,7 @@ import dataclasses import datetime import typing +import numpy as np import pint import szilagyi from geopy import geocoders @@ -75,7 +76,9 @@ def calculate(config) -> typing.List[Prediction]: swi = szilagyi.calculate_swi(dt, ccd) except ValueError: swi = -10 - wind = 0.0 * units.kts + wind = [cast.at("wind_u", _L.H850), cast.at("wind_v", _L.H850)] + wind = np.array([x.m_as("kts") for x in wind]) + wind = np.linalg.norm(wind) * units.kts yield Prediction(cast.timestamp, latitude, longitude, dt, ccd, wind, clouds, swi) predictions = [] |