To follow up on the comparison across different time scales, here is the Python script used to generate the 1-hour trail plot (plot_1h_trails.py).
You can easily adjust the time window by changing the Timedelta hours (e.g., hours=1, 3, 6, 12, 24) to observe how the individual satellite passes accumulate into a full diurnal cycle:
Python
import json
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# 1. Load and parse data
data_file = "gps_parsed.json"
records = []
with open(data_file, "r") as f:
for line in f:
try:
obj = json.loads(line.strip())
if obj.get("class") == "SKY" and "satellites" in obj:
t = obj.get("time")
for sat in obj["satellites"]:
records.append({
"time": t,
"PRN": sat.get("PRN"),
"az": sat.get("az"),
"el": sat.get("el"),
"used": sat.get("used"),
})
except json.JSONDecodeError:
continue
df = pd.DataFrame(records)
df = df.dropna(subset=["az", "el", "time"])
df["time"] = pd.to_datetime(df["time"])
df = df.sort_values("time")
# 2. Filter for the desired time window (e.g., Past 1 Hour)
latest_time = df["time"].max()
start_time = latest_time - pd.Timedelta(hours=1) # Change hours here (1, 3, 6, 12, 24)
df_filtered = df[df["time"] >= start_time]
print(f"Latest Time: {latest_time}")
print(f"Start Time: {start_time}")
print(f"Total Records: {len(df_filtered)}")
# 3. Plotting using polar coordinates (Skyview)
fig, ax = plt.subplots(figsize=(8, 8), subplot_kw={"projection": "polar"})
ax.set_theta_zero_location("N")
ax.set_theta_direction(-1)
for prn, group in df_filtered.groupby("PRN"):
az_rad = np.deg2rad(group["az"])
r = 90 - group["el"]
ax.plot(az_rad, r, label=f"PRN {prn}", alpha=0.7, linewidth=1.5)
ax.set_ylim(0, 90)
ax.set_yticks([0, 30, 60, 90])
ax.set_yticklabels(["90°", "60°", "30°", "0°"])
ax.set_title(
f"Satellite Trails (Past 1 Hour)\n~ {latest_time.strftime('%Y-%m-%d %H:%M')}",
va="bottom",
fontsize=13,
)
ax.legend(
loc="upper right",
bbox_to_anchor=(1.3, 1.1),
fontsize=8,
ncol=1,
markerscale=0.8,
)
plt.tight_layout()
plt.savefig("satellite_trails_1h.png", dpi=300)
print("Saved plot to satellite_trails_1h.png")
Feel free to try it out and tweak it for your own station monitoring! 73, YUKIO