From 3206950f5e958f434573794c169a4b2d62c49118 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Fri, 21 Feb 2025 08:20:56 +0100 Subject: [PATCH] trackingdata more documentation --- fixtracks/utils/trackingdata.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/fixtracks/utils/trackingdata.py b/fixtracks/utils/trackingdata.py index c9c7c17..7592f1f 100644 --- a/fixtracks/utils/trackingdata.py +++ b/fixtracks/utils/trackingdata.py @@ -102,18 +102,18 @@ class TrackingData(QObject): # embed() pass - def assignTracks(self, tracks): - """assignTracks _summary_ + def assignTracks(self, tracks:np.ndarray): + """assigns the given tracks to the user-selected detections. If the sizes of + provided tracks and the user selection do not match and error is logged and the tracks are not set. Parameters ---------- - tracks : _type_ - _description_ + tracks : np.ndarray + The track information. Returns ------- - _type_ - _description_ + None """ if len(tracks) != self.numDetections: logging.error("DataController: Size of passed tracks does not match data!") @@ -285,13 +285,13 @@ def main(): tracks = data["track"] cogs = all_cogs[tracks==1] all_dists = neighborDistances(cogs, 2, False) - plt.hist(all_dists[1:, 0], bins=1000) - print(np.percentile(all_dists[1:, 0], 99)) - print(np.percentile(all_dists[1:, 0], 1)) - plt.gca().set_xscale("log") - plt.gca().set_yscale("log") + # plt.hist(all_dists[1:, 0], bins=1000) + # print(np.percentile(all_dists[1:, 0], 99)) + # print(np.percentile(all_dists[1:, 0], 1)) + # plt.gca().set_xscale("log") + # plt.gca().set_yscale("log") # plt.hist(all_dists[1:, 1], bins=100) - plt.show() + # plt.show() # def compute_neighbor_distances(cogs, window=10): # distances = [] # for i in range(len(cogs)): @@ -305,7 +305,5 @@ def main(): # neighbor_distances = compute_neighbor_distances(cogs) embed() - - if __name__ == "__main__": main() \ No newline at end of file