filepaths = [".\S10_CF_004.glm", ".\S10_CF_005.glm", ".\S10_CF_006.glm"] # Initialisation des structures servant à stocker les vakeurs de TF/NF et NF # aux moments des glissements all_mu_points_thumb = [] all_NF_thumb = [] all_mu_points_index = [] all_NF_index = [] #%% Filtrage des donnees freqAcq = 800 # Frequence d'acquisition des donnees freqFiltForces = 20 # Frequence de coupure du filtrage des forces (peut etre modifié) for filepath in filepaths: glm_df = glm.import_data(filepath) for i in range(21, 43): glm_df.iloc[:, i] = glm.filter_signal(glm_df.iloc[:, i], freqAcq, freqFiltForces) #%% Extraction des signaux et mise a zero des forces en soustrayant la valeur # moyenne des 500 premieres ms baseline = range(0, 400) # Normal Force exerted by the thumb NF_thumb = glm_df.loc[:, 'Fygl'] - np.nanmean(glm_df.loc[baseline, 'Fygl']) # Vertical Tangential Force exerted by the thumb TFx_thumb = glm_df.loc[:, 'Fxgl'] - np.nanmean(glm_df.loc[baseline, 'Fxgl']) #Horizontal Tangential Force exerted by the thumb TFz_thumb = glm_df.loc[:, 'Fzgl'] - np.nanmean(glm_df.loc[baseline, 'Fzgl'])
"SEFRD": np.zeros((80, 4800)), "SEFRDcount": 0 } ntrials = 2 #Number of trials for each subject # Double for-loop that runs thrgough all subjects and trials subject_number = 0 for s in subjects: for exp in expe: for trial in range(1, ntrials + 1): # Set data path glm_path = "DataGroupe4/%s%s_00%d.glm" % (s, exp, trial) # Import data glm_df = glm.import_data(glm_path) baseline = range(0, 400) # Normal Force exerted by the thumb NF_thumb = glm_df.loc[:, 'Fygl'] - np.nanmean(glm_df.loc[baseline, 'Fygl']) # Vertical Tangential Force exerted by the thumb TFx_thumb = glm_df.loc[:, 'Fxgl'] - np.nanmean(glm_df.loc[baseline, 'Fxgl']) #Horizontal Tangential Force exerted by the thumb TFz_thumb = glm_df.loc[:, 'Fzgl'] - np.nanmean(glm_df.loc[baseline, 'Fzgl']) # Normal Force exerted by the index NF_index = -(glm_df.loc[:, 'Fygr'] - np.nanmean(glm_df.loc[baseline, 'Fygr']))
import glm_data_processing as glm import get_mu_points as gmp import get_mu_fit as gmf # Fermeture des figures ouvertes plt.close('all') # Chemins d'acces aux fichiers (A MODIFIER) filepath_strong = '.\S10_CF_004.glm' filepath_medium = '.\S10_CF_005.glm' filepath_weak = '.\S10_CF_006.glm' # Importation des donnes glm_strong_df = glm.import_data(filepath_strong) glm_medium_df = glm.import_data(filepath_medium) glm_weak_df = glm.import_data(filepath_weak) #%% Filtrage des donnees freqAcq=800 # Frequence d'acquisition des donnees freqFiltForces=20; # Frequence de coupure du filtrage des forces (peut etre modifié) for i in range(21,43): glm_strong_df.iloc[:,i]=glm.filter_signal(glm_strong_df.iloc[:,i],freqAcq,freqFiltForces) glm_medium_df.iloc[:,i]=glm.filter_signal(glm_medium_df.iloc[:,i],freqAcq,freqFiltForces) glm_weak_df.iloc[:,i]=glm.filter_signal(glm_weak_df.iloc[:,i],freqAcq,freqFiltForces) # Frequence de coupure du filtrage du COP (peut etre modifié) # COP = Center Of Pressure. Il s'agit de la résultante des forces appliquées # par le doigt sur le capteur. Cela donne donc une idee de la position du doigt