Points: the plots rx, ry, error value (its threshold dashed) and image quality, stacked; the points from rx, ry, rejected measurements included
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
810e349b42
commit
7ef808eee3
2 files changed
+49
-20
No files matched your search
+19
-8
@@ -30,29 +30,40 @@ def listing(st=""):
|
||||
return [summary(n) for n in points.datasets(st or None)]
|
||||
|
||||
|
||||
def measured(st, a, b):
|
||||
"""-> {sensor: [t]}: the points of [a, b), every measurement with a relative position, the rejected ones included
|
||||
(labeling/scripts/points.py)."""
|
||||
return {s: [m["t"] for m in ms if a <= m["t"] < b and m["relative_x"] is not None and m["relative_y"] is not None]
|
||||
for s, ms in data.load(station.folder(st)).items()}
|
||||
|
||||
|
||||
@refused
|
||||
def create(body):
|
||||
st, start, end = body.get("station", ""), body.get("start", ""), body.get("end", "")
|
||||
n = points.name(st, start, end)
|
||||
a, b = station.bounds(start, end)
|
||||
points.create(n, {s: [m["t"] for m in ms if a <= m["t"] < b and m["corr_x"] is not None and m["corr_y"] is not None]
|
||||
for s, ms in data.load(station.folder(st)).items()})
|
||||
points.create(n, measured(st, *station.bounds(start, end)))
|
||||
return summary(n)
|
||||
|
||||
|
||||
# the plots of the page, in their order: rx, ry, the recognition error and its threshold, the image quality
|
||||
COLUMNS = ("relative_x", "relative_y", "error_value", "error_threshold", "peak", "flux", "sharpness", "fwhm", "dominance", "snr")
|
||||
|
||||
|
||||
@refused
|
||||
def dataset(n):
|
||||
"""-> {name, station, start, end, sensors: {sensor: {t, x, y, valid}}}: corr_x, corr_y (px, the curves labelled) of
|
||||
each point, None where the data no longer have it (a pumping again)."""
|
||||
"""-> {name, station, start, end, sensors: {sensor: {t, valid, columns: {column: [value]}}}}: the COLUMNS of each
|
||||
point, None where the data no longer have it (a pumping or a run again); a column empty for the sensor left out."""
|
||||
p, st = points.read(n), points.parts(n)[0]
|
||||
now = {(s, points.time(m["t"])): m for s, ms in data.load(station.folder(st)).items() for m in ms}
|
||||
out = {}
|
||||
for (s, t), v in sorted(p.items()):
|
||||
m, o = now.get((s, t), {}), out.setdefault(s, {"t": [], "x": [], "y": [], "valid": []})
|
||||
m, o = now.get((s, t), {}), out.setdefault(s, {"t": [], "valid": [], "columns": {c: [] for c in COLUMNS}})
|
||||
o["t"].append(t[:19].replace("T", " ")) # as Plotly shows it, UTC
|
||||
o["x"].append(m.get("corr_x"))
|
||||
o["y"].append(m.get("corr_y"))
|
||||
o["valid"].append(v)
|
||||
for c in COLUMNS:
|
||||
o["columns"][c].append(m.get(c))
|
||||
for o in out.values():
|
||||
o["columns"] = {c: vs for c, vs in o["columns"].items() if any(x is not None for x in vs)}
|
||||
return {**summary(n), "sensors": out}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user