Skip to content

Commit 8aa11e2

Browse files
author
Thinh Nguyen
committed
minor code cleanup
1 parent b5c11f0 commit 8aa11e2

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

elements_ephys/ephys.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,15 @@ class LFP(dj.Imported):
205205
---
206206
lfp_sampling_rate: float # (Hz)
207207
lfp_time_stamps: longblob # (s) timestamps with respect to the start of the recording (recording_timestamp)
208-
lfp_mean: longblob # (mV) mean of LFP across electrodes - shape (time,)
208+
lfp_mean: longblob # (uV) mean of LFP across electrodes - shape (time,)
209209
"""
210210

211211
class Electrode(dj.Part):
212212
definition = """
213213
-> master
214214
-> probe.ElectrodeConfig.Electrode
215215
---
216-
lfp: longblob # (mV) recorded lfp at this electrode
216+
lfp: longblob # (uV) recorded lfp at this electrode
217217
"""
218218

219219
# Only store LFP for every 9th channel, due to high channel density, close-by channels exhibit highly similar LFP
@@ -431,8 +431,8 @@ class Electrode(dj.Part):
431431
-> master
432432
-> probe.ElectrodeConfig.Electrode
433433
---
434-
waveform_mean: longblob # mean over all spikes
435-
waveforms=null: longblob # (spike x sample) waveform of each spike at each electrode
434+
waveform_mean: longblob # (uV) mean over all spikes
435+
waveforms=null: longblob # (uV) (spike x sample) waveform of each spike at each electrode
436436
"""
437437

438438
@property

elements_ephys/readers/openephys.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ def __init__(self, processor):
114114
@property
115115
def ap_data(self):
116116
"""
117-
AP data concatenated across recordings. Shape: (channel x sample)
117+
AP data concatenated across recordings. Shape: (sample x channel)
118118
Channels' gains (bit_volts) applied - unit: uV
119119
"""
120120
if self._ap_data is None:
121-
self._ap_data = np.hstack([s.signal for s in self.ap_analog_signals])
121+
self._ap_data = np.hstack([s.signal for s in self.ap_analog_signals]).T
122122
self._ap_data = self._ap_data * self.ap_meta['channels_gains']
123123
return self._ap_data
124124

@@ -131,11 +131,11 @@ def ap_timestamps(self):
131131
@property
132132
def lfp_data(self):
133133
"""
134-
LFP data concatenated across recordings. Shape: (channel x sample)
134+
LFP data concatenated across recordings. Shape: (sample x channel)
135135
Channels' gains (bit_volts) applied - unit: uV
136136
"""
137137
if self._lfp_data is None:
138-
self._lfp_data = np.hstack([s.signal for s in self.lfp_analog_signals])
138+
self._lfp_data = np.hstack([s.signal for s in self.lfp_analog_signals]).T
139139
self._lfp_data = self._lfp_data * self.lfp_meta['channels_gains']
140140
return self._lfp_data
141141

elements_ephys/readers/spikeglx.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def apmeta(self):
3939

4040
@property
4141
def apdata(self):
42+
"""
43+
AP data: (sample x channel)
44+
Channels' gains (bit_volts) applied - unit: uV
45+
"""
4246
if self._apdata is None:
4347
self._apdata = self._read_bin(self.root_dir / (self.root_name + '.ap.bin'))
4448
self._apdata = self._apdata * self.get_channel_bit_volts('ap')
@@ -52,6 +56,10 @@ def lfmeta(self):
5256

5357
@property
5458
def lfdata(self):
59+
"""
60+
LFP data: (sample x channel)
61+
Channels' gains (bit_volts) applied - unit: uV
62+
"""
5563
if self._lfdata is None:
5664
self._lfdata = self._read_bin(self.root_dir / (self.root_name + '.lf.bin'))
5765
self._lfdata = self._lfdata * self.get_channel_bit_volts('lf')

0 commit comments

Comments
 (0)