Elongation von Veuns und Merkur drin

This commit is contained in:
Eskimue
2026-04-03 14:44:59 +02:00
parent a915e38367
commit 8c51076fc1
4 changed files with 330 additions and 2 deletions
+43
View File
@@ -62,6 +62,7 @@ $planetConjunctions = [];
$eclipseEvents = [];
$moonApsisEvents = [];
$sunApsisEvents = [];
$innerPlanetElongationEvents = [];
$moonOccultations = [];
$seasonChanges = [];
$monthEventList = [];
@@ -404,6 +405,23 @@ if (is_array($sunApsisDecoded) && ($sunApsisDecoded['ok'] ?? false)) {
$sunApsisEvents = is_array($sunApsisDecoded['events'] ?? null) ? $sunApsisDecoded['events'] : [];
}
$elongationOutput = [];
$elongationExitCode = 0;
$elongationArgs = [
$pythonScriptPath,
'inner_planet_elongations_for_month',
(string) $selectedYear,
(string) $selectedMonth,
$chartTimezone,
];
$elongationCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $elongationArgs)) . ' 2>&1';
exec($elongationCommand, $elongationOutput, $elongationExitCode);
$elongationRaw = trim(implode("\n", $elongationOutput));
$elongationDecoded = json_decode($elongationRaw, true);
if (is_array($elongationDecoded) && ($elongationDecoded['ok'] ?? false)) {
$innerPlanetElongationEvents = is_array($elongationDecoded['events'] ?? null) ? $elongationDecoded['events'] : [];
}
$moonPlanetOutput = [];
$moonPlanetExitCode = 0;
$moonPlanetArgs = [
@@ -597,6 +615,31 @@ foreach ($sunApsisEvents as $sunApsisEvent) {
];
}
foreach ($innerPlanetElongationEvents as $elongationEvent) {
if (!is_array($elongationEvent)) {
continue;
}
$elongationPlanet = (string) ($elongationEvent['planet_label'] ?? 'Planet');
$elongationKind = (string) ($elongationEvent['kind'] ?? '');
$elongationText = isset($elongationEvent['elongation_deg'])
? number_format((float) $elongationEvent['elongation_deg'], 2, ',', '') . ' Grad'
: '';
$elongationLabel = $elongationKind === 'western'
? $elongationPlanet . ' größte westliche Elongation'
: ($elongationKind === 'eastern'
? $elongationPlanet . ' größte östliche Elongation'
: (string) ($elongationEvent['label'] ?? 'Elongation'));
$monthEventList[] = [
'event' => trim($elongationLabel . ($elongationText !== '' ? ' (' . $elongationText . ')' : '')),
'date' => (string) ($elongationEvent['local_date'] ?? ''),
'time' => (string) ($elongationEvent['local_time'] ?? ''),
'local_iso' => (string) ($elongationEvent['local_iso'] ?? ''),
'type' => 'planet_elongation',
];
}
foreach ($moonPlanetApproaches as $approachEvent) {
if (!is_array($approachEvent)) {
continue;