Order Graphs
This commit is contained in:
parent
2e5dc27055
commit
5b1bf0eedb
41
main.py
41
main.py
@ -397,33 +397,15 @@ def genGraph(gData: dict, showPlot: bool = True, doLimits: bool = True, forcePlo
|
||||
|
||||
lims = []
|
||||
|
||||
for label in gData["info"]["pcb-refs"]: # + ["trigbox"]:
|
||||
if not forcePlots and label in gData["info"]["no-graph"]: continue
|
||||
graphData["plots"].append({
|
||||
"x": gData["time"]["x2"],
|
||||
"y": gData["data"]["x2"][label],
|
||||
"label": label
|
||||
})
|
||||
|
||||
if label in gData["info"]["pcb-refs"]:
|
||||
graphData["plots"].append({
|
||||
"type": "axvLine",
|
||||
"x": gData["shock-point"][label][1],
|
||||
"label": f"{label} - Shock Point {gData['shock-point'][label][1]:.2f}$\\mu$s",
|
||||
"colour": "gray",
|
||||
"args":{"zorder":2, "linestyle":"--", "alpha":0.5}
|
||||
})
|
||||
lims.append(gData["shock-point"][label][1]) # [TODO this but better]
|
||||
|
||||
|
||||
for label, d in [("1 [V]", "Gauge 1"),("2 [V]", "Gauge 2")]: #, ("4 [V]", "Gauge Trigger")]:
|
||||
graphData["plots"].append({
|
||||
"x": gData["time"]["scope"],
|
||||
"y": gData["data"]["scope"][label],
|
||||
"label": d
|
||||
"label": d,
|
||||
"args":{"zorder":1}
|
||||
})
|
||||
|
||||
for i, probe in enumerate(gData["info"]["probe-info"]["locations"]):
|
||||
for _, probe in enumerate(gData["info"]["probe-info"]["locations"]):
|
||||
if f"{probe}-g1" in gData["shock-point"]:
|
||||
graphData["plots"].append({
|
||||
"type": "axvLine",
|
||||
@ -445,6 +427,23 @@ def genGraph(gData: dict, showPlot: bool = True, doLimits: bool = True, forcePlo
|
||||
|
||||
lims.append(gData["shock-point"][f"{probe}-g2"][1])
|
||||
|
||||
for label in gData["info"]["pcb-refs"]: # + ["trigbox"]:
|
||||
if not forcePlots and label in gData["info"]["no-graph"]: continue
|
||||
graphData["plots"].append({
|
||||
"x": gData["time"]["x2"],
|
||||
"y": gData["data"]["x2"][label],
|
||||
"label": label
|
||||
})
|
||||
|
||||
if label in gData["info"]["pcb-refs"]:
|
||||
graphData["plots"].append({
|
||||
"type": "axvLine",
|
||||
"x": gData["shock-point"][label][1],
|
||||
"label": f"{label} - Shock Point {gData['shock-point'][label][1]:.2f}$\\mu$s",
|
||||
"colour": "gray",
|
||||
"args":{"zorder":2, "linestyle":"--", "alpha":0.5}
|
||||
})
|
||||
lims.append(gData["shock-point"][label][1]) # [TODO this but better]
|
||||
|
||||
if addShockInfo:
|
||||
probeText = ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user