Skip to content

Commit 8ceeb0b

Browse files
author
Thinh Nguyen
committed
apply channels' gain for the data
1 parent 847eeba commit 8ceeb0b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

elements_ephys/readers/openephys.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ def __init__(self, processor):
113113

114114
@property
115115
def ap_data(self):
116+
"""
117+
AP data concatenated across recordings. Shape: (channel x sample)
118+
Channels' gains (bit_volts) applied - unit: uV
119+
"""
116120
if self._ap_data is None:
117121
self._ap_data = np.hstack([s.signal for s in self.ap_analog_signals])
122+
self._ap_data = self._ap_data * self.ap_meta['channels_gains']
118123
return self._ap_data
119124

120125
@property
@@ -125,8 +130,13 @@ def ap_timestamps(self):
125130

126131
@property
127132
def lfp_data(self):
133+
"""
134+
LFP data concatenated across recordings. Shape: (channel x sample)
135+
Channels' gains (bit_volts) applied - unit: uV
136+
"""
128137
if self._lfp_data is None:
129138
self._lfp_data = np.hstack([s.signal for s in self.lfp_analog_signals])
139+
self._lfp_data = self._lfp_data * self.lfp_meta['channels_gains']
130140
return self._lfp_data
131141

132142
@property
@@ -141,7 +151,6 @@ def extract_spike_waveforms(self, spikes, channel, n_wf=500, wf_win=(-32, 32)):
141151
:param channel: channel (name, not indices) to extract waveforms
142152
:param n_wf: number of spikes per unit to extract the waveforms
143153
:param wf_win: number of sample pre and post a spike
144-
:param bit_volts: scalar required to convert int16 values into microvolts (default of 1)
145154
:return: waveforms (sample x channel x spike)
146155
"""
147156
data = self.ap_data.T # (sample x channel)

0 commit comments

Comments
 (0)