Skip to content

Commit

Permalink
BUG: wrong columns for reponse angles
Browse files Browse the repository at this point in the history
  • Loading branch information
jungheejung committed Aug 25, 2024
1 parent 19037cb commit 3d7fafb
Showing 1 changed file with 9 additions and 41 deletions.
50 changes: 9 additions & 41 deletions spacetop_prep/events/bidsify_social_ENH.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,8 @@ def parse_args():
expect['trial_type'] = 'expectrating'
expect['trial_index'] = beh_df.index +1
expect['rating_value'] = beh_df['event02_expect_angle'].round(2)
expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating)
# expect['rating_glmslabel'] = pd.cut(expect['rating_value'],
# bins=bins, labels=labels, right=True)
expect['rating_value_fillna'] = (beh_df['event02_expect_fillna']).round(2)
# expect['rating_glmslabel_fillna'] = pd.cut(expect['rating_value_fillna'],
# bins=bins, labels=labels, right=True)
expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating)
expect['rating_glmslabel_fillna'] = expect['rating_value_fillna'].apply(categorize_rating)
expect['rating_mouseonset'] = (traj_df['expect_motiononset']).round(2)
expect['rating_mousedur'] = (traj_df['expect_motiondur']).round(2)
Expand Down Expand Up @@ -547,13 +543,9 @@ def parse_args():
outcome['trial_type'] = 'outcomerating'
outcome['trial_index'] = beh_df.index +1
outcome['rating_value'] = (beh_df['event04_actual_angle']).round(2)
# outcome['rating_glmslabel'] = pd.cut(outcome['rating_value'],
# bins=bins, labels=labels, right=True)
outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating)
outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating)
# outcome['rating_glmslabel_fillna'] = pd.cut(outcome['rating_value_fillna'],
# bins=bins, labels=labels, right=True)
outcome['rating_glmslabel_fillna'] = outcome['rating_value_fillna'].apply(categorize_rating)
outcome['rating_mouseonset'] = (traj_df['outcome_motiononset']).round(2)
outcome['rating_mousedur'] = (traj_df['outcome_motiondur']).round(2)
outcome['cue'] = beh_df['event01_cue_type']
Expand Down Expand Up @@ -785,17 +777,10 @@ def parse_args():
expect['run_type'] = task_name
expect['trial_type'] = 'expectrating'
expect['trial_index'] = beh_df.index +1

expect['rating_value'] = beh_df['event02_expect_angle'].round(2)
# expect['rating_glmslabel'] = pd.cut(expect['rating_value'],
# bins=bins, labels=labels, right=True)

expect['rating_value_fillna'] = (beh_df['event02_expect_fillna']).round(2)
# expect['rating_glmslabel_fillna'] = pd.cut(expect['rating_value_fillna'],
# bins=bins, labels=labels, right=True)
expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating)
# outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating)
expect['rating_glmslabel_fillna'] = expect['rating_value_fillna'].apply(categorize_rating)
expect['rating_mouseonset'] = (traj_df['expect_motiononset']).round(2)
expect['rating_mousedur'] = (traj_df['expect_motiondur']).round(2)
expect['cue'] = beh_df['event01_cue_type'] # if same as param_cue_type
Expand Down Expand Up @@ -879,16 +864,10 @@ def parse_args():
outcome['run_type'] = task_name
outcome['trial_type'] = 'outcomerating'
outcome['trial_index'] = beh_df.index +1
outcome['rating_value'] = (beh_df['event04_actual_angle']).round(2)
# outcome['rating_glmslabel'] = pd.cut(outcome['rating_value'],
# bins=bins, labels=labels, right=True)
outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
# outcome['rating_glmslabel_fillna'] = pd.cut(outcome['rating_value_fillna'],
# bins=bins, labels=labels, right=True)

outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating)
# outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
outcome['rating_value'] = beh_df['event04_actual_angle'].round(2)
outcome['rating_value_fillna'] = (beh_df['event04_outcome_fillna']).round(2)
outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating)
outcome['rating_glmslabel_fillna'] = outcome['rating_value_fillna'].apply(categorize_rating)
outcome['rating_mouseonset'] = (traj_df['outcome_motiononset']).round(2)
outcome['rating_mousedur'] = (traj_df['outcome_motiondur']).round(2)

Expand Down Expand Up @@ -1107,15 +1086,10 @@ def parse_args():
expect['trial_index'] = beh_df.index +1

expect['rating_value'] = beh_df['event02_expect_angle'].round(2)
# expect['rating_glmslabel'] = pd.cut(expect['rating_value'],
# bins=bins, labels=labels, right=True)
expect['rating_value_fillna'] = (beh_df['event02_expect_fillna']).round(2)
# expect['rating_glmslabel_fillna'] = pd.cut(expect['rating_value_fillna'],
# bins=bins, labels=labels, right=True)

expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating)
# outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating)
expect['rating_glmslabel_fillna'] = expect['rating_value_fillna'].apply(categorize_rating)

expect['rating_mouseonset'] = (traj_df['expect_motiononset']).round(2)
expect['rating_mousedur'] = (traj_df['expect_motiondur']).round(2)
expect['cue'] = beh_df['event01_cue_type'] # if same as param_cue_type
Expand Down Expand Up @@ -1163,15 +1137,9 @@ def parse_args():
outcome['trial_type'] = 'outcomerating'
outcome['trial_index'] = beh_df.index +1
outcome['rating_value'] = (beh_df['event04_actual_angle']).round(2)
# outcome['rating_glmslabel'] = pd.cut(outcome['rating_value'],
# bins=bins, labels=labels, right=True)
outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
# outcome['rating_glmslabel_fillna'] = pd.cut(outcome['rating_value_fillna'],
# bins=bins, labels=labels, right=True)

outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating)
# outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna']
outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating)
outcome['rating_glmslabel_fillna'] = outcome['rating_value_fillna'].apply(categorize_rating)
outcome['rating_mouseonset'] = (traj_df['outcome_motiononset']).round(2)
outcome['rating_mousedur'] = (traj_df['outcome_motiondur']).round(2)
outcome['cue'] = beh_df['event01_cue_type']
Expand Down

0 comments on commit 3d7fafb

Please sign in to comment.