Mond und Sonnennähe eingebaut
This commit is contained in:
@@ -60,6 +60,8 @@ $moonPhaseEvents = [];
|
||||
$moonPlanetApproaches = [];
|
||||
$planetConjunctions = [];
|
||||
$eclipseEvents = [];
|
||||
$moonApsisEvents = [];
|
||||
$sunApsisEvents = [];
|
||||
$moonOccultations = [];
|
||||
$seasonChanges = [];
|
||||
$monthEventList = [];
|
||||
@@ -368,6 +370,40 @@ if (is_array($eclipseDecoded) && ($eclipseDecoded['ok'] ?? false)) {
|
||||
$eclipseEvents = is_array($eclipseDecoded['events'] ?? null) ? $eclipseDecoded['events'] : [];
|
||||
}
|
||||
|
||||
$moonApsisOutput = [];
|
||||
$moonApsisExitCode = 0;
|
||||
$moonApsisArgs = [
|
||||
$pythonScriptPath,
|
||||
'moon_apsides_for_month',
|
||||
(string) $selectedYear,
|
||||
(string) $selectedMonth,
|
||||
$chartTimezone,
|
||||
];
|
||||
$moonApsisCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $moonApsisArgs)) . ' 2>&1';
|
||||
exec($moonApsisCommand, $moonApsisOutput, $moonApsisExitCode);
|
||||
$moonApsisRaw = trim(implode("\n", $moonApsisOutput));
|
||||
$moonApsisDecoded = json_decode($moonApsisRaw, true);
|
||||
if (is_array($moonApsisDecoded) && ($moonApsisDecoded['ok'] ?? false)) {
|
||||
$moonApsisEvents = is_array($moonApsisDecoded['events'] ?? null) ? $moonApsisDecoded['events'] : [];
|
||||
}
|
||||
|
||||
$sunApsisOutput = [];
|
||||
$sunApsisExitCode = 0;
|
||||
$sunApsisArgs = [
|
||||
$pythonScriptPath,
|
||||
'sun_apsides_for_month',
|
||||
(string) $selectedYear,
|
||||
(string) $selectedMonth,
|
||||
$chartTimezone,
|
||||
];
|
||||
$sunApsisCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $sunApsisArgs)) . ' 2>&1';
|
||||
exec($sunApsisCommand, $sunApsisOutput, $sunApsisExitCode);
|
||||
$sunApsisRaw = trim(implode("\n", $sunApsisOutput));
|
||||
$sunApsisDecoded = json_decode($sunApsisRaw, true);
|
||||
if (is_array($sunApsisDecoded) && ($sunApsisDecoded['ok'] ?? false)) {
|
||||
$sunApsisEvents = is_array($sunApsisDecoded['events'] ?? null) ? $sunApsisDecoded['events'] : [];
|
||||
}
|
||||
|
||||
$moonPlanetOutput = [];
|
||||
$moonPlanetExitCode = 0;
|
||||
$moonPlanetArgs = [
|
||||
@@ -517,6 +553,50 @@ foreach ($eclipseEvents as $eclipseEvent) {
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($moonApsisEvents as $moonApsisEvent) {
|
||||
if (!is_array($moonApsisEvent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$moonApsisKind = (string) ($moonApsisEvent['kind'] ?? '');
|
||||
$distanceText = isset($moonApsisEvent['distance_km'])
|
||||
? number_format((float) $moonApsisEvent['distance_km'], 0, ',', '.') . ' km'
|
||||
: '';
|
||||
$moonApsisLabel = $moonApsisKind === 'perigee'
|
||||
? 'Mond in Erdnähe (Perigäum)'
|
||||
: ($moonApsisKind === 'apogee' ? 'Mond in Erdferne (Apogäum)' : (string) ($moonApsisEvent['label'] ?? 'Mondabstand'));
|
||||
|
||||
$monthEventList[] = [
|
||||
'event' => trim($moonApsisLabel . ($distanceText !== '' ? ' (' . $distanceText . ')' : '')),
|
||||
'date' => (string) ($moonApsisEvent['local_date'] ?? ''),
|
||||
'time' => (string) ($moonApsisEvent['local_time'] ?? ''),
|
||||
'local_iso' => (string) ($moonApsisEvent['local_iso'] ?? ''),
|
||||
'type' => 'moon_apsis',
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($sunApsisEvents as $sunApsisEvent) {
|
||||
if (!is_array($sunApsisEvent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sunApsisKind = (string) ($sunApsisEvent['kind'] ?? '');
|
||||
$distanceText = isset($sunApsisEvent['distance_km'])
|
||||
? number_format((float) $sunApsisEvent['distance_km'], 0, ',', '.') . ' km'
|
||||
: '';
|
||||
$sunApsisLabel = $sunApsisKind === 'perihelion'
|
||||
? 'Erde erreicht sonnennächsten Punkt (Perihel)'
|
||||
: ($sunApsisKind === 'aphelion' ? 'Erde erreicht sonnenfernsten Punkt (Aphel)' : (string) ($sunApsisEvent['label'] ?? 'Sonnenabstand'));
|
||||
|
||||
$monthEventList[] = [
|
||||
'event' => trim($sunApsisLabel . ($distanceText !== '' ? ' (' . $distanceText . ')' : '')),
|
||||
'date' => (string) ($sunApsisEvent['local_date'] ?? ''),
|
||||
'time' => (string) ($sunApsisEvent['local_time'] ?? ''),
|
||||
'local_iso' => (string) ($sunApsisEvent['local_iso'] ?? ''),
|
||||
'type' => 'sun_apsis',
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($moonPlanetApproaches as $approachEvent) {
|
||||
if (!is_array($approachEvent)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user