[Timepix] Store labels assigned to pixels
3 unresolved threads
3 unresolved threads
Compare changes
Note: at no point a copy of the dictionary is made, as they are mutable, the input array is changed in memory!
Note: at no point a copy of the dictionary is made, as they are mutable, the input array is changed in memory!
tpx_data: Dictionary with timepix data, all arrays behind each key must be of same length, now with key labels
_tpx_data["labels"] = clustering(_tpx_data, epsilon=clustering_epsilon, tof_scale=clustering_tof_scale, min_samples=clustering_min_samples)
fraction_centroids = np.sum(centroids["size"])/events['data.size'] if events['data.size']>0 else np.nan
If one applies the filter to the data that is returned, one loses the relation between input pixels and output labels. The function needs to return an unfiltered version of the label array.
Yes, of course you're right. The labels need to be separated before.