[relacs] adaptations of find methods
This commit is contained in:
parent
56b2622383
commit
333db5c8f9
@ -27,7 +27,7 @@ class BaselineData:
|
|||||||
def _get_data(self):
|
def _get_data(self):
|
||||||
if not self.__dataset:
|
if not self.__dataset:
|
||||||
return
|
return
|
||||||
self.__repros = RePro.find("BaselineActivity", cell_id=self.__cell.id)
|
self.__repros, _ = RePro.find("BaselineActivity", cell_id=self.__cell.id)
|
||||||
for i in tqdm(range(len(self.__repros)), desc="loading data"):
|
for i in tqdm(range(len(self.__repros)), desc="loading data"):
|
||||||
r = self.__repros[i]
|
r = self.__repros[i]
|
||||||
sd = self.__read_spike_data(r)
|
sd = self.__read_spike_data(r)
|
||||||
@ -311,7 +311,7 @@ class FIData:
|
|||||||
def _get_data(self):
|
def _get_data(self):
|
||||||
if not self.__dataset:
|
if not self.__dataset:
|
||||||
return
|
return
|
||||||
self.__repros = RePro.find("FICurve", cell_id=self.__cell.id)
|
self.__repros,_ = RePro.find("FICurve", cell_id=self.__cell.id)
|
||||||
for r in self.__repros:
|
for r in self.__repros:
|
||||||
sd, c, eods, time = self.__read_spike_data(r)
|
sd, c, eods, time = self.__read_spike_data(r)
|
||||||
if sd is not None and len(sd) > 1:
|
if sd is not None and len(sd) > 1:
|
||||||
@ -365,8 +365,8 @@ class FIData:
|
|||||||
eods = []
|
eods = []
|
||||||
time = []
|
time = []
|
||||||
contrasts = []
|
contrasts = []
|
||||||
stimuli = Stimulus.find(cell_id=repro.cell_id, repro_id=repro.id)
|
stimuli, count = Stimulus.find(cell_id=repro.cell_id, repro_id=repro.id)
|
||||||
if len(stimuli) == 0:
|
if count == 0:
|
||||||
return spikes, contrasts, eods, time
|
return spikes, contrasts, eods, time
|
||||||
data_source = os.path.join(self.__dataset.data_source, self.__dataset.id + ".nix")
|
data_source = os.path.join(self.__dataset.data_source, self.__dataset.id + ".nix")
|
||||||
if not os.path.exists(data_source):
|
if not os.path.exists(data_source):
|
||||||
@ -376,7 +376,7 @@ class FIData:
|
|||||||
b = f.blocks[0]
|
b = f.blocks[0]
|
||||||
self.__all_spikes = b.data_arrays["Spikes-1"][:]
|
self.__all_spikes = b.data_arrays["Spikes-1"][:]
|
||||||
mt = None
|
mt = None
|
||||||
for i in tqdm(range(len(stimuli)), desc="Loading data"):
|
for i in tqdm(range(count), desc="Loading data"):
|
||||||
s = stimuli[i]
|
s = stimuli[i]
|
||||||
if not mt or mt.id != s.multi_tag_id:
|
if not mt or mt.id != s.multi_tag_id:
|
||||||
mt = b.multi_tags[s.multi_tag_id]
|
mt = b.multi_tags[s.multi_tag_id]
|
||||||
@ -539,12 +539,18 @@ class FIData:
|
|||||||
|
|
||||||
|
|
||||||
class FileStimulusData:
|
class FileStimulusData:
|
||||||
|
"""The FileStimulus class provides access to the data recorded and the stimulus presented (if accessible)
|
||||||
|
during runs of the FileStimulus repro. Since the FileStimulus repro can put out any stimulus this class does not
|
||||||
|
provide any further analyses.
|
||||||
|
|
||||||
|
As any other relacs class it is instantiated with a Dataset entity.
|
||||||
|
"""
|
||||||
def __init__(self, dataset: Dataset):
|
def __init__(self, dataset: Dataset):
|
||||||
"""
|
"""
|
||||||
Constructor.
|
Constructor.
|
||||||
|
|
||||||
:param dataset: The dataset entity for which the filestimulus repro data should be loaded.
|
Args
|
||||||
|
fishbook.Dataset: The dataset entity for which the filestimulus repro data should be loaded.
|
||||||
"""
|
"""
|
||||||
self.__spike_data = []
|
self.__spike_data = []
|
||||||
self.__contrasts = []
|
self.__contrasts = []
|
||||||
@ -557,7 +563,7 @@ class FileStimulusData:
|
|||||||
def _get_data(self):
|
def _get_data(self):
|
||||||
if not self.__dataset:
|
if not self.__dataset:
|
||||||
return
|
return
|
||||||
self.__repros = RePro.find("FileStimulus", cell_id=self.__cell.id)
|
self.__repros, _ = RePro.find("FileStimulus", cell_id=self.__cell.id)
|
||||||
for r in self.__repros:
|
for r in self.__repros:
|
||||||
sd, c, stims = self.__read_spike_data_from_nix(r) if self.__dataset.has_nix else self.__read_spike_data_from_directory(r)
|
sd, c, stims = self.__read_spike_data_from_nix(r) if self.__dataset.has_nix else self.__read_spike_data_from_directory(r)
|
||||||
if sd is not None and len(sd) > 1:
|
if sd is not None and len(sd) > 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user