From 5b8de6374dffcae06ab4dc6577602dfb34a6a588 Mon Sep 17 00:00:00 2001 From: shadowik Date: Tue, 26 Nov 2024 16:40:28 +0400 Subject: [PATCH] Fix generation --- server/src/routers/floris_router.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/server/src/routers/floris_router.py b/server/src/routers/floris_router.py index c0614f5..766fd53 100644 --- a/server/src/routers/floris_router.py +++ b/server/src/routers/floris_router.py @@ -114,13 +114,11 @@ async def get_windmill_data_by_wind_park( turbine_yaw_angles = [turbine.angle for turbine in turbines] - weather_info_list = [ - client.get_weather_info(start_date=data.date_start, end_date=data.date_end, latitude=lat, longitude=lon) - for lat, lon in turbine_coordinates - ] + park_centerX, park_centerY = get_absolute_coordinates(park.CenterLatitude, park.CenterLongitude) - + weather_info_list = client.get_weather_info(start_date=data.date_start, end_date=data.date_end, + latitude=park.CenterLatitude, longitude=park.CenterLongitude) turbineX = [ park_centerX + turbine.x_offset for turbine in turbines @@ -131,8 +129,8 @@ async def get_windmill_data_by_wind_park( for turbine in turbines ] - wind_speeds = np.array([item[0][0] for item in weather_info_list]) - wind_directions = np.array([item[1][0] for item in weather_info_list]) + wind_speeds = np.array(weather_info_list[0]) + wind_directions = np.array(weather_info_list[1]) print(wind_directions)