Created
April 3, 2019 17:55
-
-
Save nicain/7e72c01f0bac5ef289aee02f6462bd71 to your computer and use it in GitHub Desktop.
2p_timestamp_length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import numpy as np | |
from allensdk.brain_observatory.sync_dataset import Dataset as SyncDataset # on internal branch as of 04/03/2019 | |
# ophys_experiment_id: 789359614 | |
dff_filepath = '/allen/programs/braintv/production/visualbehavior/prod0/specimen_756577249/ophys_session_789220000/ophys_experiment_789359614/789359614_dff.h5' | |
sync_filepath = '/allen/programs/braintv/production/visualbehavior/prod0/specimen_756577249/ophys_session_789220000/789220000_sync.h5' | |
with h5py.File(dff_filepath, 'r') as raw_file: | |
dff_traces = np.asarray(raw_file['data']) | |
dff_len = dff_traces.shape[1] | |
sync_dataset = SyncDataset(sync_filepath) | |
timestamps = sync_dataset.get_rising_edges('2p_vsync') | |
print(dff_len, len(timestamps)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment