-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_speed.py
30 lines (26 loc) · 1.32 KB
/
plot_speed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import itertools
import numpy as np
from utils.acf import autocorrelate
from utils.filegetter import afn,afns
from utils.parse_tracks import QCTracks, QCTracksArray, QCTracksDict
import matplotlib.pyplot as plt
from pathlib import Path
paths = [
("auto 50 smoothed",r"c:\Users\Harrison Truscott\Documents\GitHub\cell-tracking\gcp_transfer\Segmentation Analysis\2023.3.24 OptoTiam Exp 50\qc_tracks_smoothed.pkl"),
("manual 50 raw",r"c:\Users\Harrison Truscott\Documents\GitHub\cell-tracking\gcp_transfer\Segmentation Analysis\2023.3.24 OptoTiam Exp 50 $manual\qc_tracks_raw.pkl"),
("auto 53 smoothed",r"c:\Users\Harrison Truscott\Documents\GitHub\cell-tracking\gcp_transfer\Segmentation Analysis\2023.4.2 OptoTiam Exp 53\qc_tracks_smoothed.pkl"),
("manual 53 raw",r"c:\Users\Harrison Truscott\Documents\GitHub\cell-tracking\gcp_transfer\Segmentation Analysis\2023.4.2 OptoTiam Exp 53 $manual\qc_tracks_raw.pkl")
]
trackss = [(n,QCTracksArray(t)) for n,t in paths]
speeds = {}
for name,tracks in trackss:
plt.figure(name)
plt.title(f"{name} speeds")
for movie in tracks:
for tid,track in tracks[movie].items():
t = (movie,tid)
# print(t)
speeds[t] = np.linalg.norm(np.diff(track),axis=1)
plt.plot(speeds[t])
plt.savefig(f"out/speeds/{name}.png")
plt.show()