Goldener Henkel ist drin

This commit is contained in:
Eskimue
2026-04-03 16:17:29 +02:00
parent 3574fb99c7
commit 4f1c06f863
4 changed files with 251 additions and 2 deletions
+36
View File
@@ -57,6 +57,7 @@ $messierData = [];
$planetData = [];
$moonData = null;
$moonPhaseEvents = [];
$goldenHandleEvents = [];
$moonPlanetApproaches = [];
$planetConjunctions = [];
$eclipseEvents = [];
@@ -337,6 +338,23 @@ if (is_array($moonPhaseDecoded) && ($moonPhaseDecoded['ok'] ?? false)) {
$moonPhaseEvents = is_array($moonPhaseDecoded['phases'] ?? null) ? $moonPhaseDecoded['phases'] : [];
}
$goldenHandleOutput = [];
$goldenHandleExitCode = 0;
$goldenHandleArgs = [
$pythonScriptPath,
'golden_handle_for_month',
(string) $selectedYear,
(string) $selectedMonth,
$chartTimezone,
];
$goldenHandleCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $goldenHandleArgs)) . ' 2>&1';
exec($goldenHandleCommand, $goldenHandleOutput, $goldenHandleExitCode);
$goldenHandleRaw = trim(implode("\n", $goldenHandleOutput));
$goldenHandleDecoded = json_decode($goldenHandleRaw, true);
if (is_array($goldenHandleDecoded) && ($goldenHandleDecoded['ok'] ?? false)) {
$goldenHandleEvents = is_array($goldenHandleDecoded['events'] ?? null) ? $goldenHandleDecoded['events'] : [];
}
$seasonOutput = [];
$seasonExitCode = 0;
$seasonArgs = [
@@ -597,6 +615,24 @@ foreach ($moonPhaseEvents as $phaseEvent) {
];
}
foreach ($goldenHandleEvents as $goldenHandleEvent) {
if (!is_array($goldenHandleEvent)) {
continue;
}
$peakDate = (string) ($goldenHandleEvent['peak_local_date'] ?? '');
$peakTime = (string) ($goldenHandleEvent['peak_local_time'] ?? '');
$goldenHandleLabel = 'Goldener Henkel am Mond';
$monthEventList[] = [
'event' => $goldenHandleLabel,
'date' => $peakDate !== '' ? $peakDate : (string) ($goldenHandleEvent['local_date'] ?? ''),
'time' => $peakTime !== '' ? $peakTime : (string) ($goldenHandleEvent['local_time'] ?? ''),
'local_iso' => (string) ($goldenHandleEvent['peak_local_iso'] ?? $goldenHandleEvent['local_iso'] ?? ''),
'type' => 'golden_handle',
];
}
foreach ($seasonChanges as $seasonChange) {
if (!is_array($seasonChange)) {
continue;