fixes and new read_baseline_spikes, which does not work on broken
files...
This commit is contained in:
parent
5b6f2bd967
commit
e951d2df03
@ -4,20 +4,31 @@ from IPython import embed
|
||||
|
||||
def read_baseline_eod(dataset):
|
||||
base = dataset.split(os.path.sep)[-1] + ".nix"
|
||||
nix_file = nix.File.open(os.path.join(dataset, base))
|
||||
nix_file = nix.File.open(os.path.join(dataset, base), nix.FileMode.ReadOnly)
|
||||
b = nix_file.blocks[0]
|
||||
for t in b.tags():
|
||||
if "baseline" in t.name:
|
||||
break;
|
||||
t = b.tags["BaselineActivity_1"]
|
||||
eod_da = b.data_arrays["LocalEOD-1"]
|
||||
eod = t.retrieve_data("LocalEOD-1")
|
||||
time = eod_da.dimensions[0].axis(len(eod))
|
||||
nix_file.close()
|
||||
return time, eod
|
||||
|
||||
|
||||
def read_baseline_spikes(dataset):
|
||||
base = dataset.split(os.path.sep)[-1] + ".nix"
|
||||
nix_file = nix.File.open(os.path.join(dataset, base), nix.FileMode.ReadOnly)
|
||||
b = nix_file.blocks[0]
|
||||
t = b.tags["BaselineActivity_1"]
|
||||
embed()
|
||||
spike_times = t.retrieve_data("Spikes-1")
|
||||
|
||||
nix_file.close()
|
||||
return spike_times
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
data_dir = "../data"
|
||||
dataset = "2018-11-09-ad-invivo-1"
|
||||
time, eod = read_baseline_eod(os.path.join(data_dir, dataset))
|
||||
|
||||
spike_times = read_baseline_spikes(os.path.join(data_dir, dataset))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user