mirror of
https://github.com/Vale54321/BigData.git
synced 2025-12-13 02:49:32 +01:00
Aufgabe 2
This commit is contained in:
@@ -34,7 +34,6 @@ def read_adsb_lonlat_by_aircraft(path: str) -> Dict[str, Tuple[List[float], List
|
|||||||
raw = line.strip()
|
raw = line.strip()
|
||||||
if not raw:
|
if not raw:
|
||||||
continue
|
continue
|
||||||
# CSV mit Kommas bevorzugen, sonst whitespace
|
|
||||||
parts = [p.strip() for p in raw.split(",")] if "," in raw else raw.split()
|
parts = [p.strip() for p in raw.split(",")] if "," in raw else raw.split()
|
||||||
if len(parts) < 6:
|
if len(parts) < 6:
|
||||||
continue
|
continue
|
||||||
@@ -183,7 +182,7 @@ def aufgabe2_j(path_adsb: str = "adsbprak.txt",
|
|||||||
if not flights:
|
if not flights:
|
||||||
print(f"Keine gültigen Daten in: {p}")
|
print(f"Keine gültigen Daten in: {p}")
|
||||||
return
|
return
|
||||||
# Kombinierter Plot: Linie + Punkte
|
|
||||||
plt.figure()
|
plt.figure()
|
||||||
for ac_id, (lons, lats) in flights.items():
|
for ac_id, (lons, lats) in flights.items():
|
||||||
plt.plot(lons, lats, linewidth=1.0)
|
plt.plot(lons, lats, linewidth=1.0)
|
||||||
@@ -196,24 +195,17 @@ def aufgabe2_j(path_adsb: str = "adsbprak.txt",
|
|||||||
plt.tight_layout()
|
plt.tight_layout()
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
# Datei 1
|
|
||||||
try:
|
try:
|
||||||
plot_file(path_adsb)
|
plot_file(path_adsb)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print(f"Datei nicht gefunden: {path_adsb} bitte Pfad prüfen.")
|
print(f"Datei nicht gefunden: {path_adsb}")
|
||||||
|
|
||||||
# Datei 2
|
|
||||||
try:
|
try:
|
||||||
plot_file(path_adsb2)
|
plot_file(path_adsb2)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print(f"Datei nicht gefunden: {path_adsb2} bitte Pfad prüfen.")
|
print(f"Datei nicht gefunden: {path_adsb2}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
# ------------------------------
|
|
||||||
# Bequemer Gesamtaufruf
|
|
||||||
# ------------------------------
|
|
||||||
|
|
||||||
def run_all() -> None:
|
|
||||||
aufgabe2_a()
|
aufgabe2_a()
|
||||||
print()
|
print()
|
||||||
aufgabe2_b()
|
aufgabe2_b()
|
||||||
@@ -231,10 +223,5 @@ def run_all() -> None:
|
|||||||
aufgabe2_h()
|
aufgabe2_h()
|
||||||
print()
|
print()
|
||||||
aufgabe2_i()
|
aufgabe2_i()
|
||||||
# Pfade ggf. anpassen, falls du lokal testest
|
print()
|
||||||
aufgabe2_j()
|
aufgabe2_j()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# In Spyder kannst du alternativ einzelne Funktionen mit F9 ausführen.
|
|
||||||
run_all()
|
|
||||||
Reference in New Issue
Block a user