Skip to content

Commit

Permalink
Merge pull request #1 from samuelbray32/old_trodes_conversion
Browse files Browse the repository at this point in the history
Old trodes conversion
  • Loading branch information
samuelbray32 authored Jan 24, 2024
2 parents 1ee4f4f + 2cc060e commit 09155e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rec_to_nwb/processing/builder/nwb_file_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def __init__(
self.is_old_dataset = is_old_dataset
self.link_to_notes = self.metadata.get("link to notes", None)
data_types_for_scanning = {
"pos": True,
# "pos": True,
"time": True,
"mda": process_mda,
"DIO": process_dio,
Expand Down
15 changes: 14 additions & 1 deletion rec_to_nwb/processing/builder/originators/position_originator.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,20 @@ def get_video_info(position_tracking_path):
video_info = readTrodesExtractedDataFile(
position_tracking_path.replace(".pos_online.dat", ".pos_cameraHWFrameCount.dat")
)
return pd.DataFrame(video_info["data"]).set_index("PosTimestamp")
try:
return pd.DataFrame(video_info["data"]).set_index("PosTimestamp")
except:
video_info_2 = readTrodesExtractedDataFile(
position_tracking_path
)
video_info = pd.DataFrame(video_info["data"])
video_info = video_info.rename(columns={"frameCount": "HWframeCount"})
video_info_2 = pd.DataFrame(video_info_2["data"])
video_info_2 = video_info_2.rename(columns={'time':"PosTimestamp"})

video_info = pd.concat([video_info, video_info_2],axis=1)
video_info = video_info.set_index("PosTimestamp")
return video_info


def get_mcu_neural_timestamps(position_tracking_path):
Expand Down

0 comments on commit 09155e0

Please sign in to comment.