Skip to content

Commit

Permalink
updates scripts to generate and plot preprocessed time-series data (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxochicale committed Oct 1, 2023
1 parent 9e90b02 commit 0573082
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1652,72 +1652,6 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "10f3837a-ff7a-41bd-89c9-353482490c7d",
"metadata": {},
"outputs": [],
"source": [
"# TO ADD IN UTILS on 26Sep2023\n",
"# ## Comment/uncomment any of the following lines to show however axis you would like to see in the plot\n",
"# ## TODO: https://seaborn.pydata.org/generated/seaborn.lineplot.html\n",
"\n",
"# ### Ploting all texture features \n",
"# fig, axs = plt.subplots(2,3, figsize=(12, 6))\n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Contrast', ax=axs[0,0] )\n",
"# # axs[0,0].set_ylim((0,15)) \n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Correlation', ax=axs[0,1])\n",
"# # # axs[0,2].set_ylim((0.997,0.999)) \n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Dissimilarity', ax=axs[0,2])\n",
"# # axs[0,1].set_ylim((0.75,1.5)) \n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Energy', ax=axs[1,0])\n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Homogeneity', ax=axs[1,1])\n",
"# df_texture_analysis.plot(x='frame_i', y='ASM', ax=axs[1,2])\n",
"\n",
"# plt.show()\n",
"\n",
"# ### Ploting all texture features \n",
"# fig, axs = plt.subplots(2,3, figsize=(12, 6))\n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Contrast_normalised', ax=axs[0,0] )\n",
"# # axs[0,0].set_ylim((0,15)) \n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Correlation_normalised', ax=axs[0,1])\n",
"# # # axs[0,2].set_ylim((0.997,0.999)) \n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Dissimilarity_normalised', ax=axs[0,2])\n",
"# # axs[0,1].set_ylim((0.75,1.5)) \n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Energy_normalised', ax=axs[1,0])\n",
"\n",
"# df_texture_analysis.plot(x='frame_i', y='Homogeneity_normalised', ax=axs[1,1])\n",
"# df_texture_analysis.plot(x='frame_i', y='ASM_normalised', ax=axs[1,2])\n",
"\n",
"# plt.show()\n",
"\n",
"\n",
"\n",
"# ### Ploting single texture feature\n",
"# ax = plt.gca()\n",
"# df_texture_analysis.plot(x='frame_i', y='ASM', ax=ax)\n",
"# # plt.ylim((0.003,0.005))\n",
"# plt.grid()\n",
"# plt.show()\n",
"\n",
"\n",
"# ax = plt.gca()\n",
"# df_texture_analysis.plot(x='frame_i', y='ASM_normalised', ax=ax)\n",
"# plt.grid()\n",
"# plt.show()\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
37 changes: 20 additions & 17 deletions rtt4ssa/data_analysis/A_preprocessing_data_from_multiple-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@
#print(f'skimage Version: {skimage.__version__}')


PARTICIPANTNN = 'participant01'
PARTICIPANTNN_TESTNN = 'participant01-test01-rep01-1g-5mins' #51,328
# PARTICIPANTNN_TESTNN = 'participant01-test01-rep02-1g-5mins' #51,178
# PARTICIPANTNN_TESTNN = 'participant01-test02-rep01-1g-5mins' #49,183
# PARTICIPANTNN_TESTNN = 'participant01-test02-rep02-1g-5mins' #47,577
# PARTICIPANTNN_TESTNN = 'participant01-test03-rep01-1g-5mins' #48,688
# PARTICIPANTNN_TESTNN = 'participant01-test03-rep02-1g-5mins'#48,789

# PARTICIPANTNN = participant02
# PARTICIPANTNN_TESTNN = 'participant02-test01-rep01-1g-5mins'#49,490
# PARTICIPANTNN_TESTNN = 'participant02-test01-rep02-1g-5mins'#49,219
# PARTICIPANTNN_TESTNN = 'participant02-test02-rep01-1g-5mins'#48,043
# PARTICIPANTNN_TESTNN = 'participant02-test02-rep02-1g-5mins'#49,606
# PARTICIPANTNN_TESTNN = 'participant02-test03-rep01-1g-5mins'#48,875
# PARTICIPANTNN_TESTNN = 'participant02-test03-rep02-1g-5mins'#48,050
#PARTICIPANTNN = 'participant01'
#PARTICIPANTNN_TESTNN = 'participant01-test01-rep01-1g-5mins' #51,328
#PARTICIPANTNN_TESTNN = 'participant01-test01-rep02-1g-5mins' #51,178
#PARTICIPANTNN_TESTNN = 'participant01-test02-rep01-1g-5mins' #49,183
#PARTICIPANTNN_TESTNN = 'participant01-test02-rep02-1g-5mins' #47,577
#PARTICIPANTNN_TESTNN = 'participant01-test03-rep01-1g-5mins' #48,688
#PARTICIPANTNN_TESTNN = 'participant01-test03-rep02-1g-5mins'#48,789

PARTICIPANTNN = 'participant02'
PARTICIPANTNN_TESTNN = 'participant02-test01-rep01-1g-5mins'#49,490
#PARTICIPANTNN_TESTNN = 'participant02-test01-rep02-1g-5mins'#49,219
#PARTICIPANTNN_TESTNN = 'participant02-test02-rep01-1g-5mins'#48,043
#PARTICIPANTNN_TESTNN = 'participant02-test02-rep02-1g-5mins'#49,606
#PARTICIPANTNN_TESTNN = 'participant02-test03-rep01-1g-5mins'#48,875
#PARTICIPANTNN_TESTNN = 'participant02-test03-rep02-1g-5mins'#48,050

start_frame_number = 0
end_frame_number = 39000 #(resulted samples are end_frame_number-2)
end_frame_number = 40000 #(resulted samples are end_frame_number-2)
display_factor_for_texture_analysis_array = 100000


Expand All @@ -78,7 +78,10 @@
df_texture_analysis = data_frame_of_texture_analysis(texture_analysis_array, start_frame_number, end_frame_number)
df, ndf, nqdf = get_and_plot_imu_data_analysis(FULL_PATH_AND_CSV_FILE, start_frame_number, end_frame_number, display_figures)

df_a = df_texture_analysis[['frame_i', 'Contrast_normalised', 'Correlation_normalised', 'Dissimilarity_normalised', 'Energy_normalised', 'Homogeneity_normalised', 'ASM_normalised']]
#df_a = df_texture_analysis[['frame_i', 'Contrast_normalised', 'Correlation_normalised', 'Dissimilarity_normalised', 'Energy_normalised', 'Homogeneity_normalised', 'ASM_normalised']]
df_a = df_texture_analysis[['frame_i', 'Contrast_normalised', 'Correlation_normalised', 'Dissimilarity_normalised', 'Homogeneity_normalised']]


df_b = df[['q0', 'q1', 'q2', 'q3']]
dff = pd.concat([df_a, df_b], axis=1)

Expand Down

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions rtt4ssa/data_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ mamba activate rtt4ssaVE && jupyter notebook --browser=firefox
2. Notebooks
You might like to run notebooks in the following order:
* `analysis_of_video_image_cropping_texture_features.ipynb` as starting point
* `analysis_of_data_from_multiple-files.ipynb` to analysis multitiple files
* `analysis_of_data_from_multiple_files_plotting.ipynb` to plot data of multiple files
* `analysis_of_demo-data_from_multiple-files-p01 /p02 .ipynb` for participants


0 comments on commit 0573082

Please sign in to comment.