LorenFrankLab / rec_to_nwb

Data Migration REC -> NWB 2.0 Service
Other
2 stars 8 forks source link

PTP seems to not be used when available #33

Closed jguides closed 2 years ago

jguides commented 2 years ago

I git pulled the most recent version of rec to nwb this morning, and generated a nwb file for a single-epoch test recording that used PTP (J1620230614_.nwb). The .pos directory has the following files: 20230614_J16_12_r6.1.pos_cameraHWFrameCount.dat
20230614_J16_12_r6.1.pos_timestamps.dat 20230614_J16_12_r6.1.pos_online.dat

I am under the impression that if PTP is being used, there should be a cameraHWSync file in place of the cameraHWFrameCount file. @edeno, would you be able to comment on this? Thanks in advance.

lfrank commented 2 years ago

@jguides The files that get produced here are from rec_to_binaries, not from rec_to_nwb, and I don't know of any changes there. I think the HWFrameCount file has all the information that is needed, and that it is used if there isn't a HWSync file. The key question is whether the HWFrameCount data matches that in the NWB file.

jguides commented 2 years ago

Thanks @lfrank for clarifying this. I am still a bit confused about the cameraHWFrameCount file being interchangeable with the cameraHWSync file, since I had a recent exchange with @edeno (on Slack on May 3rd) that gave me the impression that having cameraHWFrameCount files in the .pos preprocessing directory instead of cameraHWSync was a sign that PTP was not being used during nwb file generation with rec_to_nwb. @edeno if possible, could you explain what I misunderstood about this, and confirm that PTP is still being used even if there are cameraHWFrameCount files in the preprocessing directories instead of cameraHWSync files? @lfrank, I have checked whether the HWFrameCount data matches that in the nwbf, and it appears to match. Thank you both.

edeno commented 2 years ago

It should note in the logs that PTP is detected or not detected. I believe cameraHWFrameCount file is always generated in the preprocessing folder for both the ptp and non-ptp case. The HWSync file should exist in the raw folder.

jguides commented 2 years ago

Thanks @edeno. In the log file, it looks like the PTP was detected. I wonder if it's worth documenting how a user can go about checking whether PTP was detected (what you described above, plus maybe a sentence about where one can search for the rec_to_nwb.log file). If you think this is worth doing I'd be happy to help.