import numpy as np
import matplotlib.pyplot as plt
DAS = "Diagnostics/BasicDiagnostics/Results/"
base_url = "http://golem.fjfi.cvut.cz/shots/"
ds = np.DataSource("golem_cache")
shot_nos = [51040, 51039, 51036]
identifier = "Ip.csv"
plt.figure()
for shot_no in shot_nos:
url = f"{base_url}{shot_no}/{DAS}{identifier}"
try:
with ds.open(url) as f:
data = np.loadtxt(f, delimiter=",")
plt.plot(data[:, 0], data[:, 1], label=str(shot_no))
except Exception as e:
print(f"❌ Shot {shot_no}: failed to load {identifier} ({e})")
plt.xlabel("Time [ms]")
plt.ylabel(r"$I_p$ [V]")
plt.legend(title="Shot")
plt.grid(True, alpha=0.3)
plt.savefig("compare_Ip_shots.jpg", dpi=200, bbox_inches="tight")
plt.show()