Skip to content

Commit

Permalink
Change end of loop to soft coded
Browse files Browse the repository at this point in the history
Changing from hard coded, eg. 26 to lenght of raw csv files
 - So we don't have to worry about the end of loop. It will read automatically
 - This is for cleaning up EEG data
  • Loading branch information
ihgumilar committed Nov 3, 2022
1 parent 2e8661c commit a619b0b
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions EEG/analysis/hyperscanning_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ def convert(seconds):
return "%d:%02d:%02d" % (hour, minutes, seconds)


# %% [markdown]
# ### Count how many available raw csv files
# This will be used as an input for end in the loop

# %%
# Number of raw csv files
path_2_raw_csv_files = "/hpc/igum002/codes/Hyperscanning2-redesign/data/EEG/"
number_of_files = os.listdir(path_2_raw_csv_files)
number_of_files = [csv_file for csv_file in number_of_files if "csv" in csv_file]
number_of_files = len((number_of_files))

# %% markdown [markdown]
# ## Direct eye(Pre - training)
# %%
Expand Down Expand Up @@ -158,9 +169,8 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)
begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -551,9 +561,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -943,9 +953,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -1333,9 +1343,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -1727,9 +1737,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -2118,9 +2128,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -2509,9 +2519,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down Expand Up @@ -2896,9 +2906,9 @@ def convert(seconds):
# To loop subject number.
# Every loop there are two files that are taken (odd-even subject)

# TODO : Adjust the loop number. Now it is only up to 16 files (so far)

begin = 0
end = 26
end = number_of_files
step = 2

for i in tqdm(
Expand Down

0 comments on commit a619b0b

Please sign in to comment.