From ce1781624a7df3343a89c82eda5b906dee1d98e2 Mon Sep 17 00:00:00 2001 From: Eskimue Date: Fri, 15 May 2026 16:15:15 +0200 Subject: [PATCH] Satellitenhimmer verbessert --- public/satellitenhimmel.php | 57 ++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/public/satellitenhimmel.php b/public/satellitenhimmel.php index 90878e0..38a7ec9 100644 --- a/public/satellitenhimmel.php +++ b/public/satellitenhimmel.php @@ -429,7 +429,7 @@ if (!empty($currentLocation) && is_array($currentLocation)) {
-
Lade Ueberfluege...
+
Lade Überflüge...
@@ -599,7 +599,7 @@ if (!empty($currentLocation) && is_array($currentLocation)) { } function azToDirectionName(az) { - const dirs = ['Norden','Nordosten','Osten','Suedosten','Sueden','Suedwesten','Westen','Nordwesten']; + const dirs = ['Norden','Nord Osten','Osten','Süd Osten','Süden','Süd Westen','Westen','Nord Westen']; return dirs[Math.round(az/45) % 8]; } @@ -625,7 +625,7 @@ if (!empty($currentLocation) && is_array($currentLocation)) { function classifySkyBrightness(sunAltDeg) { if (sunAltDeg > -4) return {key:'day', label:'Tag'}; - if (sunAltDeg >= -12) return {key:'twilight', label:'Daemmerung'}; + if (sunAltDeg >= -12) return {key:'twilight', label:'Dämmerung'}; return {key:'night', label:'Nacht'}; } @@ -670,7 +670,7 @@ if (!empty($currentLocation) && is_array($currentLocation)) { function getDarknessCondition(sunAltDeg, visiblePeak) { if (sunAltDeg > -4) return { key: 'daylight', score: 0.05, label: 'Tageshimmel' }; - if (sunAltDeg >= -12) return { key: 'twilight', score: 0.65, label: 'Daemmerung' }; + if (sunAltDeg >= -12) return { key: 'twilight', score: 0.65, label: 'Dämmerung' }; if ((visiblePeak?.elevationDeg ?? -1) < 0) return { key: 'deep_night', score: 0.20, label: 'Nicht sichtbar / Erdschatten' }; return { key: 'ideal', score: 1.00, label: 'Dunkler Himmel, Satellit sonnenbeschienen' }; } @@ -785,8 +785,43 @@ if (!empty($currentLocation) && is_array($currentLocation)) { }).filter((v,i,a) => i===0 || v!==a[i-1]) : descriptors; if (limited.length === 1) return `Sie ist dabei ${limited[0]} zu beobachten.`; - if (limited.length === 2) return `Sie ist zunaechst ${limited[0]} zu beobachten und zuletzt ${limited[1]}.`; - return `Sie ist zunaechst ${limited[0]} zu beobachten, spaeter ${limited.slice(1,-1).join(', ')} und zuletzt ${limited[limited.length-1]}.`; + if (limited.length === 2) return `Sie ist zunächst ${limited[0]} zu beobachten und zuletzt ${limited[1]}.`; + return `Sie ist zunächst ${limited[0]} zu beobachten, später ${limited.slice(1,-1).join(', ')} und zuletzt ${limited[limited.length-1]}.`; + } + + function buildFlightNarrative(satName, visiblePhase, visiblePeak) { + if (!visiblePhase.visiblePath.length) return ''; + const startPoint = visiblePhase.visiblePath[0]; + const endPoint = visiblePhase.visiblePath[visiblePhase.visiblePath.length - 1]; + const startDir = azToDirectionName(startPoint.azimuthDeg); + const endDir = azToDirectionName(endPoint.azimuthDeg); + + let peakText = `steigt bis auf etwa ${visiblePeak.elevationDeg.toFixed(0)}° Höhe im ${azToDirectionName(visiblePeak.azimuthDeg)}`; + if (visiblePeak.elevationDeg >= 75) { + peakText = 'steigt bis nahe an den Zenit'; + } else if (visiblePeak.elevationDeg >= 55) { + peakText = `steigt hoch über den ${azToDirectionName(visiblePeak.azimuthDeg)} auf`; + } + + return `${satName} taucht gegen ${formatTime(visiblePhase.visibleStartTime)} Uhr am ${startDir}horizont auf, ${peakText} und zieht dann weiter Richtung ${endDir}, wo sie um ${formatTime(visiblePhase.visibleEndTime)} Uhr wieder verschwindet.`; + } + + function buildObservationSummaryClean(satName, pass, visibility) { + if (visibility.darkness.key === 'daylight') return `${satName} ist bei diesem Überflug am Tageshimmel praktisch nicht zu sehen.`; + const visiblePhase = getVisiblePhase(pass); + if (!visiblePhase.visiblePath.length) { + return `${satName} liegt bei diesem Überflug während der gesamten Passage im Erdschatten und ist deshalb nicht sichtbar.`; + } + const visiblePeak = visibility.visiblePeak ?? getVisiblePeak(pass, visiblePhase); + const flightText = buildFlightNarrative(satName, visiblePhase, visiblePeak); + const shadowText = pass.shadowEntry + ? ` Sie tritt um ${formatTime(pass.shadowEntry.time)} Uhr in den Erdschatten ein.` : ''; + const magText = pass.peakMag !== null + ? ` Ihre maximale Helligkeit beträgt ${formatMag(pass.peakMag)} mag.` : ''; + return `Der Überflug der ${satName} am ${formatDateLocal(pass.aosTime)} (${formatWeekdayShort(pass.aosTime)}) um ${formatTime(pass.aosTime)} Uhr ist ${visibility.label} (${visibility.scorePercent} von 100 Punkten). ` + + `Der Überflug ist ${formatDurationLong(visiblePhase.visibleDurationMs)} lang und bis ${formatTime(visiblePhase.visibleEndTime)} Uhr zu sehen. ` + + `${flightText} Die maximale Horizonthöhe der Raumstation ${satName} beträgt ${visiblePeak.elevationDeg.toFixed(0)}°.` + + `${shadowText}${magText}`; } function getVisiblePhase(pass) { @@ -842,14 +877,14 @@ if (!empty($currentLocation) && is_array($currentLocation)) { return `${satName} liegt bei diesem Überflug waehrend der gesamten Passage im Erdschatten und ist deshalb nicht sichtbar.`; } const visiblePeak = visibility.visiblePeak ?? getVisiblePeak(pass, visiblePhase); - const pathText = buildPathDescription(visiblePhase.visiblePath); + const flightText = buildFlightNarrative(satName, visiblePhase, visiblePeak); const shadowText = pass.shadowEntry ? ` Sie tritt um ${formatTime(pass.shadowEntry.time)} Uhr in den Erdschatten ein.` : ''; const magText = pass.peakMag !== null - ? ` Ihre maximale Helligkeit betraegt ${formatMag(pass.peakMag)} mag.` : ''; - return `Die Beobachtungsqualitaet von ${satName} am ${formatDateLocal(pass.aosTime)} (${formatWeekdayShort(pass.aosTime)}) um ${formatTime(pass.aosTime)} Uhr ist ${visibility.label} (${visibility.scorePercent} von 100 Punkten). ` + ? ` Ihre maximale Helligkeit beträgt ${formatMag(pass.peakMag)} mag.` : ''; + return `Der Überflug der ${satName} am ${formatDateLocal(pass.aosTime)} (${formatWeekdayShort(pass.aosTime)}) um ${formatTime(pass.aosTime)} Uhr ist ${visibility.label} (${visibility.scorePercent} von 100 Punkten). ` + `Der Überflug ist ${formatDurationLong(visiblePhase.visibleDurationMs)} lang und bis ${formatTime(visiblePhase.visibleEndTime)} Uhr zu sehen. ` - + `${pathText} Die fuer die Bewertung relevante maximale sichtbare Horizonthoehe betraegt ${visiblePeak.elevationDeg.toFixed(0)}°.` + + `${flightText} Die maximale Horizonthöhe der Raumstation ${satName} beträgt ${visiblePeak.elevationDeg.toFixed(0)}°.` + `${shadowText}${magText}`; } @@ -1084,7 +1119,7 @@ if (!empty($currentLocation) && is_array($currentLocation)) { lastSelectedSatelliteName = satResult.name; lastSelectedPass = pass; const visibility = classifyVisibility(pass); - const observationSummary = buildObservationSummary(satResult.name, pass, visibility); + const observationSummary = buildObservationSummaryClean(satResult.name, pass, visibility); passInfoEl.innerHTML = `