Skip to content

Commit

Permalink
keypoint timestamps using rate instead of np.arange
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Apr 23, 2024
1 parent 7540d94 commit 9b25dc6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None:
SAMPLING_RATE = metadata["Constants"]["VIDEO_SAMPLING_RATE"]
keypoint_dict = joblib.load(self.source_data["file_path"])
raw_keypoints = keypoint_dict["positions_median"]
timestamps = H5DataIO(np.arange(raw_keypoints.shape[0]) / SAMPLING_RATE, compression=True)

index_to_name = metadata["Keypoint"]["index_to_name"]
camera_names = ["bottom", "side1", "side2", "side3", "side4", "top"] # as confirmed by email with authors
Expand All @@ -64,7 +63,7 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None:
name=keypoint_name,
description=f"Keypoint corresponding to {keypoint_name}",
data=H5DataIO(raw_keypoints[:, keypoint_index, :], compression=True),
timestamps=timestamps,
rate=SAMPLING_RATE,
unit="mm",
reference_frame=metadata["Keypoint"]["reference_frame"],
)
Expand Down

0 comments on commit 9b25dc6

Please sign in to comment.