From cc674900ccfb06430a40cf03a964d29ef71e6211 Mon Sep 17 00:00:00 2001 From: Dusan Vojacek Date: Mon, 27 Apr 2026 18:12:05 +0200 Subject: [PATCH] fix azimut --- backend/services/forecast_service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/services/forecast_service.py b/backend/services/forecast_service.py index d222b21..a950487 100644 --- a/backend/services/forecast_service.py +++ b/backend/services/forecast_service.py @@ -19,8 +19,11 @@ logger = logging.getLogger(__name__) def _db_azimuth_to_pvlib(surface_azimuth_db_deg: float) -> float: - """DB: 0=jih, 90=západ, -90=východ → pvlib (N=0, E=90, S=180, W=270).""" - return float((surface_azimuth_db_deg + 180) % 360) + """ + EMS DB používá standardní azimut (kompasové stupně): + N=0, E=90, S=180, W=270 (stejně jako pvlib). + """ + return float(surface_azimuth_db_deg % 360) async def fetch_pv_forecast(site_id: int, db) -> tuple[int, int]: