API: stability tool (daily corr_y medians per target), only cited target names on camera images
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8ba75b92fa
commit
5052a3940d
7 files changed
+91
-8
No files matched your search
@@ -13,6 +13,9 @@ import matplotlib; matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt, matplotlib.image as mi
|
||||
|
||||
args = sys.argv[1:]
|
||||
nommees = None # --cibles A,B : seulement ces noms écrits (les autres encombrent l'image) ; sans : tous
|
||||
if "--cibles" in args:
|
||||
i = args.index("--cibles"); nommees = set(args[i + 1].split(",")); del args[i:i + 2]
|
||||
demi = 350
|
||||
if "--demi" in args:
|
||||
i = args.index("--demi"); demi = int(args[i + 1]); del args[i:i + 2]
|
||||
@@ -26,6 +29,8 @@ from donnees import charger # noqa: E402
|
||||
t0 = datetime.strptime(instants[0].partition("=")[0], "%Y%m%dT%H%MZ").replace(tzinfo=timezone.utc)
|
||||
positions = {}
|
||||
for capteur, ms in charger(dossier).items():
|
||||
if nommees is not None and capteur not in nommees:
|
||||
continue
|
||||
proches = [m for m in ms if m.get("x") is not None and m.get("y") is not None and abs(m["t"] - t0) <= timedelta(hours=2)]
|
||||
if proches:
|
||||
m = min(proches, key=lambda m: abs(m["t"] - t0))
|
||||
@@ -42,7 +47,8 @@ for ax, inst in zip(axs[0], instants):
|
||||
ax.add_patch(plt.Circle((x - x0, y - y0), 28, fill=False, color="red", lw=1.5))
|
||||
for capteur, (cx, cy) in positions.items():
|
||||
if x0 <= cx < x0 + img.shape[1] and y0 <= cy < y0 + img.shape[0]:
|
||||
ax.text(cx - x0, cy - y0 - 22, capteur, color="yellow", fontsize=7, ha="center", va="bottom")
|
||||
ax.text(cx - x0, cy - y0 - 22, capteur, color="yellow", fontsize=8, ha="center", va="bottom",
|
||||
bbox={"facecolor": "black", "alpha": 0.5, "pad": 1, "edgecolor": "none"})
|
||||
ax.set_title(lab, fontsize=11); ax.axis("off")
|
||||
fig.suptitle("Image éclaircie ; en jaune, le nom des cibles", fontsize=12) # pas de nom de station : il va au client
|
||||
fig.tight_layout(); fig.savefig(sortie, dpi=100); print(sortie)
|
||||
Reference in new issue
Block a user