Commits

Olivier Debeir committed d48545a

put hdf5 reading autside feature extraction

Comments (0)

Files changed (1)

ivctrack/measurement.py

 
 #----------------------------------------------------------------------------------------------
 
-def speed_feature_extraction(hdf5_filename):
+def speed_feature_extraction(c_data):
 
-    features,data = get_hdf5_data(hdf5_filename,fields=['center'])
     measures = []
     feat_name = ['path_length','avg_speed','mrdo','hull_surf','hull_dist']
-    for d in data:
+    for d in c_data:
         xy = d['center']
         fxy = filter(xy,sigma=1.)
         pl = path_length(fxy)
 
     return (feat_name,measures)
 
-def direction_feature_extraction(hdf5_filename):
+def direction_feature_extraction(c_data):
 
-    features,data = get_hdf5_data(hdf5_filename,fields=['center'])
     measures = []
     feat_name = ['scaling_exponent','scaling_exponent_r2','R','Rtot']
-    for d in data:
+    for d in c_data:
         xy = d['center']
         fxy = filter(xy,sigma=1.)
 
 
     c_feat,c_data = get_hdf5_data(hdf5_filename,fields=['center'])
 
-    s_feat,s_data = speed_feature_extraction(hdf5_filename)
+    s_feat,s_data = speed_feature_extraction(c_data)
     print s_feat
     print s_data
 
-    d_feat,d_data = direction_feature_extraction(hdf5_filename)
+    d_feat,d_data = direction_feature_extraction(c_data)
     print d_feat
     print d_data