Fix runtime bug in Radius of Gyration of Doryab Location.

pull/104/head
nikunjgoel95 2020-10-10 13:26:06 -04:00
parent b0cbc0a54a
commit dcf1255b4b
1 changed files with 3 additions and 1 deletions

View File

@ -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)