Fix runtime bug in Radius of Gyration of Doryab Location.
parent
b0cbc0a54a
commit
dcf1255b4b
|
@ -345,6 +345,8 @@ def radius_of_gyration(locationData,sampling_frequency):
|
||||||
rog = rog + (time_in_cluster * distance)
|
rog = rog + (time_in_cluster * distance)
|
||||||
|
|
||||||
time_all_clusters = valid_clusters.shape[0] * sampling_frequency
|
time_all_clusters = valid_clusters.shape[0] * sampling_frequency
|
||||||
|
if time_all_clusters == 0:
|
||||||
|
return 0
|
||||||
final_rog = (1/time_all_clusters) * rog
|
final_rog = (1/time_all_clusters) * rog
|
||||||
|
|
||||||
return np.sqrt(final_rog)
|
return np.sqrt(final_rog)
|
||||||
|
|
Loading…
Reference in New Issue