tobac.analysis.cell_analysis.velocity_histogram#
- tobac.analysis.cell_analysis.velocity_histogram(track, bin_edges=array([0, 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]), density=False, method_distance=None, return_values=False)#
Create an velocity histogram of the tracked cells. If the DataFrame does not contain a velocity column, the velocities are calculated.
- Parameters:
track (pandas.DataFrame) –
- DataFrame of the linked features, containing the columns ‘cell’,
’time’ and either ‘projection_x_coordinate’ and ‘projection_y_coordinate’ or ‘latitude’ and ‘longitude’.
bin_edges (int or ndarray, optional) – If bin_edges is an int, it defines the number of equal-width bins in the given range. If bins is a ndarray, it defines a monotonically increasing array of bin edges, including the rightmost edge. Default is np.arange(0, 30000, 500).
density (bool, optional) – If False, the result will contain the number of samples in each bin. If True, the result is the value of the probability density function at the bin, normalized such that the integral over the range is 1. Default is False.
methods_distance ({None, 'xy', 'latlon'}, optional) – Method of distance calculation, used to calculate the velocity. ‘xy’ uses the length of the vector between the two features, ‘latlon’ uses the haversine distance. None checks wether the required coordinates are present and starts with ‘xy’. Default is None.
return_values (bool, optional) – Bool determining wether the velocities of the features are returned from this function. Default is False.
- Returns:
hist (ndarray) – The values of the histogram.
bin_edges (ndarray) – The edges of the histogram.
velocities , optional (ndarray) – Numpy array with the velocities of each feature.