From 9b25dc66f33c2d2e6ef881c16b9f616e38d8159e Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Tue, 23 Apr 2024 10:47:20 -0700 Subject: [PATCH] keypoint timestamps using rate instead of np.arange --- .../markowitz_gillis_nature_2023_keypoint/keypointinterface.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py index 00eacd9..187f72a 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py @@ -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 @@ -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"], )