From 325fe7c6f5a036ef29d882b8457f0edf821efd2d Mon Sep 17 00:00:00 2001 From: Pavel_Sorokin Date: Sun, 1 Dec 2024 18:53:00 +0400 Subject: [PATCH] fixes 2 --- davisAPI/prediction.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/davisAPI/prediction.py b/davisAPI/prediction.py index 01bf887..094b3c9 100644 --- a/davisAPI/prediction.py +++ b/davisAPI/prediction.py @@ -138,8 +138,8 @@ def get_wind_speed_and_direction(prediction, batch: Batch, lat: float, lon: floa u_values = prediction.atmos_vars["u"][:, :, :, lat_idx, lon_idx] v_values = prediction.atmos_vars["v"][:, :, :, lat_idx, lon_idx] - wind_speed=[] - wind_direction=[] + wind_speeds=[] + wind_directions=[] for i in range(u_values.numel()): u_scalar = u_values.view(-1)[i].item() # Разворачиваем тензор в одномерный и берем элемент v_scalar = v_values.view(-1)[i].item() @@ -154,10 +154,10 @@ def get_wind_speed_and_direction(prediction, batch: Batch, lat: float, lon: floa wind_dir = metpy.calc.wind_direction(u_with_units, v_with_units) wind_speed = metpy.calc.wind_speed(u_with_units, v_with_units) - wind_speed.append(wind_speed.magnitude.item()) - wind_direction.append(wind_dir.magnitude.item()) + wind_speeds.append(wind_speed.magnitude.item()) + wind_directions.append(wind_dir.magnitude.item()) - return wind_speed,wind_direction + return wind_speeds,wind_directions def wind_direction_to_text(wind_dir_deg):