Gute Merkursichtbarkeit rein
This commit is contained in:
@@ -17,8 +17,26 @@ $starLabelMagnitudeLimit = 2.0;
|
||||
$messierDatabaseMagnitudeLimit = 4.0;
|
||||
$messierDisplayMagnitudeLimit = 1.0;
|
||||
$moonPlanetMaxSeparationDeg = 1.5;
|
||||
$moonDeepSkyMaxSeparationDeg = 1.0;
|
||||
$planetConjunctionMaxSeparationDeg = 1.0;
|
||||
$moonOccultationMaxMag = 2.0;
|
||||
// Gute Merkur-Sichtbarkeit wird nicht nur über Elongation, sondern über echte
|
||||
// Beobachtbarkeit am Himmel definiert: Wir prüfen pro Tag zu einem festen
|
||||
// Zeitpunkt relativ zu Sonnenauf- oder -untergang, ob Merkur hoch genug steht
|
||||
// und die Sonne bereits tief genug unter dem Horizont ist.
|
||||
$mercuryGoodVisibilitySampleOffsetMinutes = 45;
|
||||
// Morgens: so viele Minuten VOR Sonnenaufgang prüfen.
|
||||
// Abends: so viele Minuten NACH Sonnenuntergang prüfen.
|
||||
$mercuryGoodVisibilityMinAltitudeDeg = 7.0;
|
||||
// Merkur muss bei diesem Prüfzeitpunkt mindestens so hoch über dem Horizont
|
||||
// stehen, damit wir die Sichtbarkeit als "gut" einstufen.
|
||||
$mercuryGoodVisibilityMaxSunAltitudeDeg = -3.0;
|
||||
// Die Sonne muss gleichzeitig mindestens 4 Grad unter dem Horizont stehen.
|
||||
// So vermeiden wir Treffer, bei denen Merkur zwar formal da ist, aber noch zu
|
||||
// stark in der hellen Dämmerung untergeht.
|
||||
$mercuryGoodVisibilityMinConsecutiveDays = 3;
|
||||
// Einzelne gute Tage sind oft zu zufällig. Erst ab dieser Anzahl
|
||||
// aufeinanderfolgender Tage erzeugen wir ein Monatsereignis.
|
||||
|
||||
$years = range($currentYear - 2, $currentYear + 5);
|
||||
$months = [
|
||||
@@ -59,6 +77,8 @@ $moonData = null;
|
||||
$moonPhaseEvents = [];
|
||||
$goldenHandleEvents = [];
|
||||
$moonPlanetApproaches = [];
|
||||
$moonDeepSkyApproaches = [];
|
||||
$mercuryGoodVisibilityEvents = [];
|
||||
$planetConjunctions = [];
|
||||
$eclipseEvents = [];
|
||||
$moonApsisEvents = [];
|
||||
@@ -655,6 +675,27 @@ if (is_array($moonPlanetDecoded) && ($moonPlanetDecoded['ok'] ?? false)) {
|
||||
$moonPlanetApproaches = is_array($moonPlanetDecoded['approaches'] ?? null) ? $moonPlanetDecoded['approaches'] : [];
|
||||
}
|
||||
|
||||
$moonDeepSkyOutput = [];
|
||||
$moonDeepSkyExitCode = 0;
|
||||
$moonDeepSkyArgs = [
|
||||
$pythonScriptPath,
|
||||
'moon_deep_sky_approaches_for_month',
|
||||
(string) $chartLatitude,
|
||||
(string) $chartLongitude,
|
||||
(string) $chartElevation,
|
||||
(string) $selectedYear,
|
||||
(string) $selectedMonth,
|
||||
$chartTimezone,
|
||||
(string) $moonDeepSkyMaxSeparationDeg,
|
||||
];
|
||||
$moonDeepSkyCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $moonDeepSkyArgs)) . ' 2>&1';
|
||||
exec($moonDeepSkyCommand, $moonDeepSkyOutput, $moonDeepSkyExitCode);
|
||||
$moonDeepSkyRaw = trim(implode("\n", $moonDeepSkyOutput));
|
||||
$moonDeepSkyDecoded = json_decode($moonDeepSkyRaw, true);
|
||||
if (is_array($moonDeepSkyDecoded) && ($moonDeepSkyDecoded['ok'] ?? false)) {
|
||||
$moonDeepSkyApproaches = is_array($moonDeepSkyDecoded['approaches'] ?? null) ? $moonDeepSkyDecoded['approaches'] : [];
|
||||
}
|
||||
|
||||
$planetConjunctionOutput = [];
|
||||
$planetConjunctionExitCode = 0;
|
||||
$planetConjunctionArgs = [
|
||||
@@ -676,6 +717,30 @@ if (is_array($planetConjunctionDecoded) && ($planetConjunctionDecoded['ok'] ?? f
|
||||
$planetConjunctions = is_array($planetConjunctionDecoded['conjunctions'] ?? null) ? $planetConjunctionDecoded['conjunctions'] : [];
|
||||
}
|
||||
|
||||
$mercuryGoodVisibilityOutput = [];
|
||||
$mercuryGoodVisibilityExitCode = 0;
|
||||
$mercuryGoodVisibilityArgs = [
|
||||
$pythonScriptPath,
|
||||
'mercury_good_visibility_for_month',
|
||||
(string) $chartLatitude,
|
||||
(string) $chartLongitude,
|
||||
(string) $chartElevation,
|
||||
(string) $selectedYear,
|
||||
(string) $selectedMonth,
|
||||
$chartTimezone,
|
||||
(string) $mercuryGoodVisibilitySampleOffsetMinutes,
|
||||
(string) $mercuryGoodVisibilityMinAltitudeDeg,
|
||||
(string) $mercuryGoodVisibilityMaxSunAltitudeDeg,
|
||||
(string) $mercuryGoodVisibilityMinConsecutiveDays,
|
||||
];
|
||||
$mercuryGoodVisibilityCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $mercuryGoodVisibilityArgs)) . ' 2>&1';
|
||||
exec($mercuryGoodVisibilityCommand, $mercuryGoodVisibilityOutput, $mercuryGoodVisibilityExitCode);
|
||||
$mercuryGoodVisibilityRaw = trim(implode("\n", $mercuryGoodVisibilityOutput));
|
||||
$mercuryGoodVisibilityDecoded = json_decode($mercuryGoodVisibilityRaw, true);
|
||||
if (is_array($mercuryGoodVisibilityDecoded) && ($mercuryGoodVisibilityDecoded['ok'] ?? false)) {
|
||||
$mercuryGoodVisibilityEvents = is_array($mercuryGoodVisibilityDecoded['events'] ?? null) ? $mercuryGoodVisibilityDecoded['events'] : [];
|
||||
}
|
||||
|
||||
$moonOccultationStars = [];
|
||||
try {
|
||||
if (isset($pdo)) {
|
||||
@@ -986,6 +1051,24 @@ foreach ($moonPlanetApproaches as $approachEvent) {
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($moonDeepSkyApproaches as $approachEvent) {
|
||||
if (!is_array($approachEvent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$distanceText = isset($approachEvent['separation_deg'])
|
||||
? number_format((float) ($approachEvent['separation_deg']), 2, ',', '') . ' Grad'
|
||||
: '';
|
||||
|
||||
$monthEventList[] = [
|
||||
'event' => trim((string) ($approachEvent['label'] ?? 'Mond nahe Sternhaufen') . ($distanceText !== '' ? ' (' . $distanceText . ')' : '')),
|
||||
'date' => (string) ($approachEvent['local_date'] ?? ''),
|
||||
'time' => (string) ($approachEvent['local_time'] ?? ''),
|
||||
'local_iso' => (string) ($approachEvent['local_iso'] ?? ''),
|
||||
'type' => 'moon_deep_sky',
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($planetConjunctions as $conjunctionEvent) {
|
||||
if (!is_array($conjunctionEvent)) {
|
||||
continue;
|
||||
@@ -1004,6 +1087,20 @@ foreach ($planetConjunctions as $conjunctionEvent) {
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($mercuryGoodVisibilityEvents as $visibilityEvent) {
|
||||
if (!is_array($visibilityEvent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$monthEventList[] = [
|
||||
'event' => (string) ($visibilityEvent['label'] ?? 'Gute Merkur-Sichtbarkeit'),
|
||||
'date' => (string) ($visibilityEvent['local_date'] ?? ''),
|
||||
'time' => (string) ($visibilityEvent['local_time'] ?? ''),
|
||||
'local_iso' => (string) ($visibilityEvent['local_iso'] ?? ''),
|
||||
'type' => 'mercury_good_visibility',
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($moonOccultations as $occultationEvent) {
|
||||
if (!is_array($occultationEvent)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user