Skip to content

Commit

Permalink
fix video timestamp units
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 committed Oct 16, 2023
1 parent a238860 commit 4669bc9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/spikegadgets_to_nwb/convert_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ def get_video_timestamps(video_timestamps_filepath: Path) -> np.ndarray:
.set_index("PosTimestamp")
.rename(columns={"frameCount": "HWframeCount"})
)
return np.asarray(video_timestamps.HWTimestamp) / NANOSECONDS_PER_SECOND
return (
np.asarray(video_timestamps.HWTimestamp, dtype=np.float64)
/ NANOSECONDS_PER_SECOND
)


def get_position_timestamps(
Expand Down Expand Up @@ -810,6 +813,8 @@ def add_associated_video_files(
session_df.file_extension == ".cameraHWSync",
)
]
if not len(video_hw_df):
raise ValueError(f"No cameraHWSync found for epoch {epoch}, video {video_index} in session_df")
video_timestamps_filepath = video_hw_df[
[
full_path.split(".")[-3] == video_index
Expand Down

0 comments on commit 4669bc9

Please sign in to comment.