This commit is contained in:
Eskimue
2026-04-03 15:41:16 +02:00
parent a4e2367f33
commit 3574fb99c7
3 changed files with 161 additions and 4 deletions
+36
View File
@@ -63,6 +63,7 @@ $eclipseEvents = [];
$moonApsisEvents = [];
$sunApsisEvents = [];
$innerPlanetElongationEvents = [];
$venusPeakMagnitudeEvents = [];
$outerPlanetEvents = [];
$outerPlanetStationEvents = [];
$moonOccultations = [];
@@ -424,6 +425,23 @@ if (is_array($elongationDecoded) && ($elongationDecoded['ok'] ?? false)) {
$innerPlanetElongationEvents = is_array($elongationDecoded['events'] ?? null) ? $elongationDecoded['events'] : [];
}
$venusPeakMagnitudeOutput = [];
$venusPeakMagnitudeExitCode = 0;
$venusPeakMagnitudeArgs = [
$pythonScriptPath,
'venus_peak_magnitude_for_month',
(string) $selectedYear,
(string) $selectedMonth,
$chartTimezone,
];
$venusPeakMagnitudeCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $venusPeakMagnitudeArgs)) . ' 2>&1';
exec($venusPeakMagnitudeCommand, $venusPeakMagnitudeOutput, $venusPeakMagnitudeExitCode);
$venusPeakMagnitudeRaw = trim(implode("\n", $venusPeakMagnitudeOutput));
$venusPeakMagnitudeDecoded = json_decode($venusPeakMagnitudeRaw, true);
if (is_array($venusPeakMagnitudeDecoded) && ($venusPeakMagnitudeDecoded['ok'] ?? false)) {
$venusPeakMagnitudeEvents = is_array($venusPeakMagnitudeDecoded['events'] ?? null) ? $venusPeakMagnitudeDecoded['events'] : [];
}
$outerPlanetOutput = [];
$outerPlanetExitCode = 0;
$outerPlanetArgs = [
@@ -676,6 +694,24 @@ foreach ($innerPlanetElongationEvents as $elongationEvent) {
];
}
foreach ($venusPeakMagnitudeEvents as $venusPeakMagnitudeEvent) {
if (!is_array($venusPeakMagnitudeEvent)) {
continue;
}
$magnitudeText = isset($venusPeakMagnitudeEvent['mag'])
? number_format((float) $venusPeakMagnitudeEvent['mag'], 1, ',', '') . ' mag'
: '';
$monthEventList[] = [
'event' => trim('Venus in groesster Helligkeit' . ($magnitudeText !== '' ? ' (' . $magnitudeText . ')' : '')),
'date' => (string) ($venusPeakMagnitudeEvent['local_date'] ?? ''),
'time' => (string) ($venusPeakMagnitudeEvent['local_time'] ?? ''),
'local_iso' => (string) ($venusPeakMagnitudeEvent['local_iso'] ?? ''),
'type' => 'venus_peak_magnitude',
];
}
foreach ($outerPlanetEvents as $outerPlanetEvent) {
if (!is_array($outerPlanetEvent)) {
continue;