Skip to content

Commit

Permalink
Fixes surface-fixation export crash
Browse files Browse the repository at this point in the history
  • Loading branch information
domstoppable committed Aug 20, 2024
1 parent f8ce5c9 commit fb092e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pupil_src/shared_modules/surface_tracker/background_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ def _export_fixations_on_surface(self, fixations_on_surf, surface, surface_name)
for fix in fixs_for_frame:
dataset.append({
"fixation id": fix["id"],
"start timestamp [ns]": f'{fix["start timestamp [ns]"]:0.0f}',
"end timestamp [ns]": f'{fix["end timestamp [ns]"]:0.0f}',
"start timestamp [ns]": fix["start timestamp [ns]"],
"end timestamp [ns]": fix["end timestamp [ns]"],
"duration [ms]": fix["duration [ms]"],
"fixation detected on surface": fix["on_surf"],
"fixation x [normalized]": fix["norm_pos"][0],
Expand All @@ -643,4 +643,7 @@ def _export_fixations_on_surface(self, fixations_on_surf, surface, surface_name)

fixation_df = pd.DataFrame(dataset)
mean_df = fixation_df.groupby(['fixation id']).mean()
mean_df["start timestamp [ns]"] = mean_df["start timestamp [ns]"].map(lambda v: f"{v:0.0f}")
mean_df["end timestamp [ns]"] = mean_df["end timestamp [ns]"].map(lambda v: f"{v:0.0f}")

mean_df.to_csv(file_path)

0 comments on commit fb092e7

Please sign in to comment.