Ephemeriden Karte eingebaut

This commit is contained in:
2026-04-28 10:47:55 +02:00
parent 5adca790eb
commit 33f5dce638
2 changed files with 889 additions and 11 deletions
+16
View File
@@ -347,6 +347,14 @@ def custom_altitude_deg(body_type: str, payload: dict, observer: astronomy.Obser
return float(horizontal.lat)
def custom_horizontal_coordinates(body_type: str, payload: dict, observer: astronomy.Observer, time_value: astronomy.Time) -> tuple[float, float]:
topocentric_vector = custom_topocentric_vector(body_type, payload, observer, time_value)
rotation = astronomy.Rotation_EQJ_HOR(time_value, observer)
horizontal_vector = astronomy.RotateVector(rotation, topocentric_vector)
horizontal = astronomy.HorizonFromVector(horizontal_vector, astronomy.Refraction.Normal)
return float(horizontal.lon), float(horizontal.lat)
def refine_custom_event(
body_type: str,
payload: dict,
@@ -509,14 +517,18 @@ def action_planet_ephemeris(args: list[str]) -> dict:
def row_builder(current_local: datetime, time_value: astronomy.Time, rise_label: str | None, set_label: str | None) -> dict:
eq = astronomy.Equator(body, time_value, observer, False, True)
horizontal = astronomy.Horizon(time_value, observer, float(eq.ra), float(eq.dec), astronomy.Refraction.Normal)
return {
"object_name": label,
"date_local": current_local.strftime("%d.%m.%Y"),
"time_local": current_local.strftime("%H:%M"),
"local_iso": current_local.isoformat(),
"ra": format_ra_hours(float(eq.ra)),
"ra_decimal_hours": round(float(eq.ra), 8),
"dec": format_dec_deg(float(eq.dec)),
"dec_decimal_deg": round(float(eq.dec), 8),
"azimuth_deg": round(float(horizontal.azimuth), 6),
"altitude_deg": round(float(horizontal.altitude), 6),
"rise": rise_label,
"set": set_label,
}
@@ -595,6 +607,7 @@ def action_small_body_ephemeris(args: list[str]) -> dict:
def row_builder(current_local: datetime, time_value: astronomy.Time, rise_label: str | None, set_label: str | None) -> dict:
try:
topocentric_vector = custom_topocentric_vector(body_type, payload, observer, time_value)
azimuth_deg, altitude_deg = custom_horizontal_coordinates(body_type, payload, observer, time_value)
except Exception as exc:
fail("Die Ephemeriden konnten fuer dieses Objekt nicht berechnet werden.", extra={"details": str(exc), "object": object_label})
@@ -603,10 +616,13 @@ def action_small_body_ephemeris(args: list[str]) -> dict:
"object_name": object_label,
"date_local": current_local.strftime("%d.%m.%Y"),
"time_local": current_local.strftime("%H:%M"),
"local_iso": current_local.isoformat(),
"ra": format_ra_hours(float(eq.ra)),
"ra_decimal_hours": round(float(eq.ra), 8),
"dec": format_dec_deg(float(eq.dec)),
"dec_decimal_deg": round(float(eq.dec), 8),
"azimuth_deg": round(float(azimuth_deg), 6),
"altitude_deg": round(float(altitude_deg), 6),
"rise": rise_label,
"set": set_label,
}