DAQ Sync Merge Datasets

DAQ Sync Merge Datasets

Align and synchronize data acquisition systems

Herein is an expansion of the DAQ Synchronization project for merging aligned datasets from Numpy-formatted data. This can be a standalone project or can be considered part of the overall DAQ Synchronization Project. With this part of the project, we have just aligned the data from the secondary DAQ device to match the timestamps used by the primary DAQ device. This Python script can be used to seek out the spike data generated by the primary DAQ device (in this case, the code has been structured to search through an OpenEphys-formatted data directory and pull out relevant spike data), and then merge it into the secondary DAQ’s data, generating new rows as needed to ensure all data from the primary DAQ are included into secondary DAQ data where it is appropriate.

All DAQ Synchronization project code (with example data!) can be found within this zip file. Simply download and extract. Or, if you want just the code for this part of the project, see here.


User Input

Most of the code need not be altered. However, we encourage users to take a look under the hood and learn some coding, email us here if you find issues (Note: We are sharing this code, which works for our needs, but comes with no guarantees. It probably has issues and definitely is sloppy), make your boss think you are a hacker by using this as a wallpaper, or update the code to fit your needs. The most important variables that a user could change are listed up at the top of the code. An explanation of them can be found below:

USER INPUTS EXPLAINED:

Input Variables

  • start_index = (float) The first timestamp value that is listed in the aligned secondary data. This value is printed as an output by the alignment_barcodes.py at the end of the alignment process, but it can also be found by outputting a .csv file of the aligned secondary data and looking at the very first value in the first row. If the timestamp ends in float format (x.0), be sure to include the .0 at the end.
  • final_index = (float) The last timestamp value that is listed in the aligned secondary data. This value is printed as an output by the alignment_barcodes.py at the end of the alignment process, but it can also be found by outputting a .csv file of the aligned secondary data and looking at the very first value in the last row. If the timestamp ends in float format (x.0), be sure to include the .0 at the end.

Output Variables

  • merger_name = (str) The name of the merged data file(s) in which the output will be saved in the chosen directory.
  • save_npy = (bool) Set to “True” if you want the output saved as a .npy file.
  • save_csv = (bool) Set to “True” if you want the output saved as a .csv file.

ONE Core acknowledgment

Please acknowledge the ONE Core facility in your publications. An appropriate wording would be:

“The Optogenetics and Neural Engineering (ONE) Core at the University of Colorado School of Medicine provided engineering support for this research. The ONE Core is part of the NeuroTechnology Center, funded in part by the School of Medicine and by the National Institute of Neurological Disorders and Stroke of the National Institutes of Health under award number P30NS048154.”