-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brezovec conversion #2
Comments
To-do:
|
Code to extract the datetime of fictract @alessandratrapani: from pathlib import Path
from datetime import datetime
from zoneinfo import ZoneInfo
folder_path = Path("/home/heberto/Clandinin-CN-data-share/brezovec_example_data/fictrac")
file_path = folder_path / "fictrac-20200620_122048.dat"
assert file_path.is_file(), f"File path {file_path} does not exist."
def read_first_timestamp_from_file(file_path):
with open(file_path, 'r') as file:
# Read the first data line
first_line = file.readline()
# Split by comma and extract the timestamp (the 22nd column)
timestamp = float(first_line.split(',')[21]) / 1000.0 # Transform to seconds
return timestamp
def convert_to_los_angeles_time(utc_timestamp):
# Convert the timestamp to a UTC datetime object
utc_time = datetime.utcfromtimestamp(utc_timestamp).replace(tzinfo=ZoneInfo("UTC"))
# Convert the UTC time to Los Angeles local time
los_angeles_tz = ZoneInfo('America/Los_Angeles')
los_angeles_time = utc_time.astimezone(los_angeles_tz)
return los_angeles_time
timestamp = read_first_timestamp_from_file(file_path)
la_time = convert_to_los_angeles_time(timestamp)
print(la_time) We should have similar functions to extract the session_start_time from the xml in bruker. Once we have all the starting times we should follow the proceedure here to set those times right: |
We need additional information before proceeding with this, correct? For instance, the VoltageRecording_00x.csv file, that should contain the TTL signals for synchronization. |
That would be better, but we can improve on what we have right now by using the information that we already have available. Specially critical is to adjust the starting_time of the anatomy so it is after the functional one. That is, the start time of the functional anatomy should be around 30 minutes from the |
Linking here for provenance: |
This is to organize the conversion. Some general resources.
Fictrac:
https://github.com/rjdmoore/fictrac/tree/master
The paper:
https://www.biorxiv.org/content/10.1101/2022.03.20.485047v1
I will update as more information comes
The text was updated successfully, but these errors were encountered: