Skip to content
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

Timestamps index mismatch in optogenetic data #40

Open
CodyCBakerPhD opened this issue Sep 9, 2024 · 0 comments
Open

Timestamps index mismatch in optogenetic data #40

CodyCBakerPhD opened this issue Sep 9, 2024 · 0 comments

Comments

@CodyCBakerPhD
Copy link
Member

Only occurs for a single session

import json
import numpy
import pathlib
import pandas

base_path = pathlib.Path("G:/Leifer")
pump_probe_folder_path = base_path / "20220330" / "pumpprobe_20220330_110253"

optogenetic_stimulus_file_path = pump_probe_folder_path / "pharosTriggers.txt"
optogenetic_stimulus_table = pandas.read_table(
    filepath_or_buffer=optogenetic_stimulus_file_path, index_col=False
)

timestamps_file_path = pump_probe_folder_path / "framesDetails.txt"
timestamps_table = pandas.read_table(filepath_or_buffer=timestamps_file_path, index_col=False)
timestamps = numpy.array(timestamps_table["Timestamp"])

aligned_timestamp_indices = list(optogenetic_stimulus_table["frameCount"] - timestamps_table["frameCount"][0])

assert len(timestamps) >= aligned_timestamp_indices[-1], "Aligned timestamps indices exceed total length of timestamps."

@emosb Any suggestions for this? Or should I just ignore this session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant