Kleinigkeiten und codierung
This commit is contained in:
@@ -109,7 +109,7 @@ $years = range($currentYear - 2, $currentYear + 5);
|
||||
$months = [
|
||||
1 => 'Januar',
|
||||
2 => 'Februar',
|
||||
3 => 'Maerz',
|
||||
3 => 'März',
|
||||
4 => 'April',
|
||||
5 => 'Mai',
|
||||
6 => 'Juni',
|
||||
@@ -1268,7 +1268,7 @@ foreach ($venusPeakMagnitudeEvents as $venusPeakMagnitudeEvent) {
|
||||
: '';
|
||||
|
||||
$monthEventList[] = [
|
||||
'event' => trim('Venus in groesster Helligkeit' . ($magnitudeText !== '' ? ' (' . $magnitudeText . ')' : '')),
|
||||
'event' => trim('Venus in größter Helligkeit' . ($magnitudeText !== '' ? ' (' . $magnitudeText . ')' : '')),
|
||||
'date' => (string) ($venusPeakMagnitudeEvent['local_date'] ?? ''),
|
||||
'time' => (string) ($venusPeakMagnitudeEvent['local_time'] ?? ''),
|
||||
'local_iso' => (string) ($venusPeakMagnitudeEvent['local_iso'] ?? ''),
|
||||
@@ -1575,8 +1575,8 @@ $observationTipCalendarFilenameJson = json_encode(sprintf('astrotools-monatserei
|
||||
<div class="monatsvorhersage-shell">
|
||||
<form class="monatsvorhersage-form" method="get">
|
||||
<div class="monatsvorhersage-form-header">
|
||||
<h3>Zeitraum waehlen</h3>
|
||||
<p>Die Sternkarte wird fuer den 15. des gewaehlten Monats mit der festen Monatsuhrzeit erzeugt.</p>
|
||||
<h3>Zeitraum wählen</h3>
|
||||
<p>Die Sternkarte wird fuer den 15. des gewählten Monats mit der festen Monatsuhrzeit erzeugt.</p>
|
||||
</div>
|
||||
|
||||
<label class="monatsvorhersage-field">
|
||||
@@ -1629,7 +1629,7 @@ $observationTipCalendarFilenameJson = json_encode(sprintf('astrotools-monatserei
|
||||
<section class="monatskarte-card">
|
||||
<div class="monatskarte-header">
|
||||
<div>
|
||||
<h3>Südhimmel <?= htmlspecialchars($months[$selectedMonth] . ' ' . (string) $selectedYear, ENT_QUOTES, 'UTF-8') ?></h3>
|
||||
<h3>Südhimmel <?= htmlspecialchars($months[$selectedMonth] . ' ' . (string) $selectedYear, ENT_QUOTES, 'UTF-8') ?></h3>
|
||||
<p id="monatskarteSouthMeta">
|
||||
<?= htmlspecialchars($chartConfig['localTimeLabel'], ENT_QUOTES, 'UTF-8') ?>,
|
||||
<?= htmlspecialchars($chartLocationName, ENT_QUOTES, 'UTF-8') ?>
|
||||
@@ -1638,20 +1638,16 @@ $observationTipCalendarFilenameJson = json_encode(sprintf('astrotools-monatserei
|
||||
</div>
|
||||
|
||||
<div class="monatskarte-stage monatskarte-stage-south">
|
||||
<canvas id="monatskarteSouthCanvas" width="1200" height="720" aria-label="Südhimmel-Projektion"></canvas>
|
||||
<canvas id="monatskarteSouthCanvas" width="1200" height="720" aria-label="Südhimmel-Projektion"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="monatskarte-footer">
|
||||
<p id="monatskarteSouthStatus">Bereite Südhimmelkarte vor...</p>
|
||||
<p id="monatskarteSouthStatus">Bereite Südhimmelkarte vor...</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="monatskarte-card">
|
||||
<div class="monatskarte-header">
|
||||
<div>
|
||||
<h3>Mondphasen Im <?= htmlspecialchars($months[$selectedMonth] . ' ' . (string) $selectedYear, ENT_QUOTES, 'UTF-8') ?></h3>
|
||||
<p>Eine Monatszeile vom ersten bis zum letzten Tag mit der Mondtextur aus <code>moon4geocron.png</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="monatskarte-stage monatsphase-stage">
|
||||
@@ -2637,18 +2633,18 @@ const OBSERVATION_TIP_ICAL_FILENAME = <?= $observationTipCalendarFilenameJson ?:
|
||||
|
||||
drawDirectionLabel(0, 'Norden', 18, '600 13px Rajdhani, sans-serif', 0.78);
|
||||
drawDirectionLabel(90, 'Westen', 22, '600 13px Rajdhani, sans-serif', 0.78);
|
||||
drawDirectionLabel(180, 'Süden', 18, '600 13px Rajdhani, sans-serif', 0.78);
|
||||
drawDirectionLabel(180, 'Süden', 18, '600 13px Rajdhani, sans-serif', 0.78);
|
||||
drawDirectionLabel(270, 'Osten', 22, '600 13px Rajdhani, sans-serif', 0.78);
|
||||
|
||||
drawDirectionLabel(45, 'Nordosten', 18, '600 11px Rajdhani, sans-serif', 0.64);
|
||||
drawDirectionLabel(315, 'Nordwesten', 18, '600 11px Rajdhani, sans-serif', 0.64);
|
||||
drawDirectionLabel(135, 'Südosten', 18, '600 11px Rajdhani, sans-serif', 0.64);
|
||||
drawDirectionLabel(225, 'Südwesten', 18, '600 11px Rajdhani, sans-serif', 0.64);
|
||||
drawDirectionLabel(135, 'Südosten', 18, '600 11px Rajdhani, sans-serif', 0.64);
|
||||
drawDirectionLabel(225, 'Südwesten', 18, '600 11px Rajdhani, sans-serif', 0.64);
|
||||
|
||||
ctx.fillStyle = 'rgba(214, 226, 255, 0.62)';
|
||||
ctx.font = '600 11px Rajdhani, sans-serif';
|
||||
ctx.fillText('60°', cx, cy - radius * 0.66 - 6);
|
||||
ctx.fillText('30°', cx, cy - radius * 0.33 - 6);
|
||||
ctx.fillText('60°', cx, cy - radius * 0.66 - 6);
|
||||
ctx.fillText('30°', cx, cy - radius * 0.33 - 6);
|
||||
ctx.fillText('Zenit', cx, cy);
|
||||
}
|
||||
|
||||
@@ -3728,9 +3724,9 @@ const OBSERVATION_TIP_ICAL_FILENAME = <?= $observationTipCalendarFilenameJson ?:
|
||||
|
||||
const directionLabels = [
|
||||
{ az: 90, text: 'Osten' },
|
||||
{ az: 135, text: 'Südosten' },
|
||||
{ az: 180, text: 'Süden' },
|
||||
{ az: 225, text: 'Südwesten' },
|
||||
{ az: 135, text: 'Südosten' },
|
||||
{ az: 180, text: 'Süden' },
|
||||
{ az: 225, text: 'Südwesten' },
|
||||
{ az: 270, text: 'Westen' },
|
||||
];
|
||||
|
||||
@@ -3756,7 +3752,7 @@ const OBSERVATION_TIP_ICAL_FILENAME = <?= $observationTipCalendarFilenameJson ?:
|
||||
ctx.font = '600 11px Rajdhani, sans-serif';
|
||||
ctx.textAlign = 'left';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(`${alt}°`, pt.x + 8, pt.y);
|
||||
ctx.fillText(`${alt}°`, pt.x + 8, pt.y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3941,7 +3937,7 @@ const OBSERVATION_TIP_ICAL_FILENAME = <?= $observationTipCalendarFilenameJson ?:
|
||||
drawMoon(width, height);
|
||||
drawPlanets(width, height);
|
||||
drawStars(width, height);
|
||||
statusEl.textContent = 'Südhimmel für ' + MONTH_CHART_CONFIG.localTimeLabel;
|
||||
statusEl.textContent = 'Südhimmel für ' + MONTH_CHART_CONFIG.localTimeLabel;
|
||||
}
|
||||
|
||||
resizeCanvas();
|
||||
|
||||
Binary file not shown.
+47
-47
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python3
|
||||
import base64
|
||||
import json
|
||||
import math
|
||||
@@ -41,7 +41,7 @@ def fail(message: str, *, extra: dict | None = None, code: int = 1) -> None:
|
||||
payload = {"ok": False, "error": message}
|
||||
if extra:
|
||||
payload.update(extra)
|
||||
print(json.dumps(payload, ensure_ascii=False))
|
||||
print(json.dumps(payload, ensure_ascii=True))
|
||||
raise SystemExit(code)
|
||||
|
||||
|
||||
@@ -161,8 +161,8 @@ def action_sun_moon_rise_set(args: list[str]) -> dict:
|
||||
return None
|
||||
return result
|
||||
|
||||
# Morgens: Sonne steigt auf → Direction.Rise (Höhe wird größer)
|
||||
# Abends: Sonne sinkt ab → Direction.Set (Höhe wird kleiner)
|
||||
# Morgens: Sonne steigt auf -> Direction.Rise (Hoehe wird groesser)
|
||||
# Abends: Sonne sinkt ab -> Direction.Set (Hoehe wird kleiner)
|
||||
astro_dawn = search_altitude(astronomy.Direction.Rise, -18.0)
|
||||
nautical_dawn = search_altitude(astronomy.Direction.Rise, -12.0)
|
||||
civil_dawn = search_altitude(astronomy.Direction.Rise, -6.0)
|
||||
@@ -735,15 +735,15 @@ def action_planet_constellation_changes_for_month(args: list[str]) -> dict:
|
||||
"Taurus": "Stier",
|
||||
"Gemini": "Zwillinge",
|
||||
"Cancer": "Krebs",
|
||||
"Leo": "Loewe",
|
||||
"Leo": "Löwe",
|
||||
"Virgo": "Jungfrau",
|
||||
"Libra": "Waage",
|
||||
"Scorpius": "Skorpion",
|
||||
"Sagittarius": "Schuetze",
|
||||
"Sagittarius": "Schütze",
|
||||
"Capricornus": "Steinbock",
|
||||
"Aquarius": "Wassermann",
|
||||
"Pisces": "Fische",
|
||||
"Ophiuchus": "Schlangentraeger",
|
||||
"Ophiuchus": "Schlangenträger",
|
||||
"Cetus": "Walfisch",
|
||||
}
|
||||
|
||||
@@ -2307,12 +2307,12 @@ def action_inner_planet_elongations_for_month(args: list[str]) -> dict:
|
||||
break
|
||||
|
||||
if local_dt >= local_start:
|
||||
visibility_label = "westliche" if event.visibility == astronomy.Visibility.Morning else "oestliche"
|
||||
visibility_label = "westliche" if event.visibility == astronomy.Visibility.Morning else "östliche"
|
||||
events.append({
|
||||
"planet_key": key,
|
||||
"planet_label": label,
|
||||
"kind": "western" if event.visibility == astronomy.Visibility.Morning else "eastern",
|
||||
"label": f"{label} groesste {visibility_label} Elongation",
|
||||
"label": f"{label} größte {visibility_label} Elongation",
|
||||
"elongation_deg": float(event.elongation),
|
||||
"ecliptic_separation_deg": float(event.ecliptic_separation),
|
||||
"utc_iso": dt_utc.isoformat().replace("+00:00", "Z"),
|
||||
@@ -2381,7 +2381,7 @@ def action_venus_peak_magnitude_for_month(args: list[str]) -> dict:
|
||||
"planet_key": "venus",
|
||||
"planet_label": "Venus",
|
||||
"kind": "peak_magnitude",
|
||||
"label": "Venus in groesster Helligkeit",
|
||||
"label": "Venus in größter Helligkeit",
|
||||
"mag": float(event.mag),
|
||||
"utc_iso": dt_utc.isoformat().replace("+00:00", "Z"),
|
||||
"local_iso": local_dt.isoformat(),
|
||||
@@ -2590,13 +2590,13 @@ def action_outer_planet_stations_for_month(args: list[str]) -> dict:
|
||||
rate_after = planet_longitude_rate_deg_per_day(body, station_time_utc + timedelta(days=3))
|
||||
if rate_before > 0 and rate_after < 0:
|
||||
kind = "retrograde"
|
||||
text = "stationaer, dann ruecklaeufig"
|
||||
text = "stationär, dann rückläufig"
|
||||
elif rate_before < 0 and rate_after > 0:
|
||||
kind = "prograde"
|
||||
text = "stationaer, dann rechtlaeufig"
|
||||
text = "stationär, dann rechtläufig"
|
||||
else:
|
||||
kind = "stationary"
|
||||
text = "stationaer"
|
||||
text = "stationär"
|
||||
|
||||
if not any(
|
||||
item["planet_key"] == key and abs(datetime.fromisoformat(item["local_iso"]).timestamp() - local_dt.timestamp()) < 3600
|
||||
@@ -2847,10 +2847,10 @@ def action_jupiter_moons_one_side_for_month(args: list[str]) -> dict:
|
||||
|
||||
def direction_text_from_kinds(raw_kind: str | None, east_west_kind: str | None) -> str:
|
||||
if east_west_kind == "east":
|
||||
return "oestlich"
|
||||
return "östlich"
|
||||
if east_west_kind == "west":
|
||||
return "westlich"
|
||||
return "westlich" if raw_kind == "left" else "oestlich"
|
||||
return "westlich" if raw_kind == "left" else "östlich"
|
||||
|
||||
events: list[dict] = []
|
||||
current = utc_start
|
||||
@@ -3596,7 +3596,7 @@ def action_moon_star_occultations(args: list[str]) -> dict:
|
||||
}
|
||||
|
||||
|
||||
# ── satellite_passes ──────────────────────────────────────────────────────────
|
||||
# ── satellite_passes ──────────────────────────────────────────────────────────
|
||||
|
||||
import math as _math
|
||||
|
||||
@@ -3723,14 +3723,14 @@ def _apparent_magnitude(std_mag, rcs, rcs_size, r_eci, sun_eci_km, obs_ecef_km,
|
||||
if range_km < 1:
|
||||
return None
|
||||
|
||||
# Phase angle (sun → sat → observer)
|
||||
# Phase angle (sun → sat → observer)
|
||||
sx, sy, sz = sun_eci_km
|
||||
ox = -rx + obs_ecef_km[0] # obs ECI ≈ ECEF for this approximation
|
||||
ox = -rx + obs_ecef_km[0] # obs ECI ≈ ECEF for this approximation
|
||||
oy = -ry + obs_ecef_km[1]
|
||||
oz = -rz + obs_ecef_km[2]
|
||||
# to-sun from sat
|
||||
ts_x, ts_y, ts_z = sx - rx, sy - ry, sz - rz
|
||||
to_x, to_y, to_z = -rx, -ry, -rz # observer ≈ Earth center approx
|
||||
to_x, to_y, to_z = -rx, -ry, -rz # observer ≈ Earth center approx
|
||||
ts_len = _math.sqrt(ts_x*ts_x + ts_y*ts_y + ts_z*ts_z)
|
||||
to_len = _math.sqrt(to_x*to_x + to_y*to_y + to_z*to_z)
|
||||
if ts_len < 1 or to_len < 1:
|
||||
@@ -3840,7 +3840,7 @@ def action_satellite_passes(args: list[str]) -> dict:
|
||||
color = COLORS[idx % len(COLORS)]
|
||||
passes = []
|
||||
|
||||
# ── Phase 1: coarse scan to find pass windows ──
|
||||
# ── Phase 1: coarse scan to find pass windows ──
|
||||
current = window_start
|
||||
prev_el = None
|
||||
in_pass = False
|
||||
@@ -3894,7 +3894,7 @@ def action_satellite_passes(args: list[str]) -> dict:
|
||||
_, los_az_v, _ = _ecef_to_altaz(r_ecef3, obs_ecef, lat_rad, lon_rad)
|
||||
los_az = los_az_v
|
||||
|
||||
# ── Phase 2: fine trajectory (5s steps) ──
|
||||
# ── Phase 2: fine trajectory (5s steps) ──
|
||||
path = []
|
||||
shadow_entry = None
|
||||
t = aos_time
|
||||
@@ -4014,132 +4014,132 @@ def main() -> None:
|
||||
|
||||
if action == "sun_moon_rise_set":
|
||||
result = action_sun_moon_rise_set(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_star_occultations":
|
||||
result = action_moon_star_occultations(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "season_changes_for_month":
|
||||
result = action_season_changes_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "time_changes_for_month":
|
||||
result = action_time_changes_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_phase_details":
|
||||
result = action_moon_phase_details(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "satellite_passes":
|
||||
result = action_satellite_passes(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "planet_rise_set":
|
||||
result = action_planet_rise_set(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "month_sky_context":
|
||||
result = action_month_sky_context(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_phases_for_month":
|
||||
result = action_moon_phases_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "golden_handle_for_month":
|
||||
result = action_golden_handle_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_planet_approaches":
|
||||
result = action_moon_planet_approaches(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_deep_sky_approaches_for_month":
|
||||
result = action_moon_deep_sky_approaches_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "planet_bright_star_approaches_for_month":
|
||||
result = action_planet_bright_star_approaches_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "planet_conjunctions_for_month":
|
||||
result = action_planet_conjunctions_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "eclipses_for_month":
|
||||
result = action_eclipses_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_apsides_for_month":
|
||||
result = action_moon_apsides_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "sun_apsides_for_month":
|
||||
result = action_sun_apsides_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "inner_planet_elongations_for_month":
|
||||
result = action_inner_planet_elongations_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "venus_peak_magnitude_for_month":
|
||||
result = action_venus_peak_magnitude_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "outer_planet_events_for_month":
|
||||
result = action_outer_planet_events_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "outer_planet_stations_for_month":
|
||||
result = action_outer_planet_stations_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "jupiter_moons_one_side_for_month":
|
||||
result = action_jupiter_moons_one_side_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "mercury_good_visibility_for_month":
|
||||
result = action_mercury_good_visibility_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "planet_parades_for_month":
|
||||
result = action_planet_parades_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "planet_constellation_changes_for_month":
|
||||
result = action_planet_constellation_changes_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
if action == "moon_star_occultations_for_month":
|
||||
result = action_moon_star_occultations_for_month(args)
|
||||
print(json.dumps(result, ensure_ascii=False))
|
||||
print(json.dumps(result, ensure_ascii=True))
|
||||
return
|
||||
|
||||
fail("Unbekannte Aktion.", extra={"action": action, "available_actions": ["sun_moon_rise_set", "moon_star_occultations", "moon_phase_details", "satellite_passes", "planet_rise_set", "month_sky_context", "moon_phases_for_month", "golden_handle_for_month", "season_changes_for_month", "time_changes_for_month", "moon_planet_approaches", "moon_deep_sky_approaches_for_month", "planet_bright_star_approaches_for_month", "planet_conjunctions_for_month", "eclipses_for_month", "moon_apsides_for_month", "sun_apsides_for_month", "inner_planet_elongations_for_month", "venus_peak_magnitude_for_month", "outer_planet_events_for_month", "outer_planet_stations_for_month", "jupiter_moons_one_side_for_month", "mercury_good_visibility_for_month", "planet_parades_for_month", "planet_constellation_changes_for_month", "moon_star_occultations_for_month"]})
|
||||
|
||||
Reference in New Issue
Block a user