@@ -83,21 +83,22 @@ def _parse_header(self):
8383 self ._num_channels = self .channel_positions .shape [0 ]
8484 self ._dtype = self .info_dict ["recordings" ]["dtype" ]
8585
86- signals = [('Signals' , '0' )]
86+ signals = [('Signals' , '0' )] if self . load_analogsignal else []
8787 signal_streams = np .array (signals , dtype = _signal_stream_dtype )
8888
8989
9090 sig_channels = []
91- for c in range (self ._num_channels ):
92- ch_name = 'ch{}' .format (c )
93- chan_id = str (c + 1 )
94- sr = self ._sampling_rate # Hz
95- dtype = self ._dtype
96- units = 'uV'
97- gain = 1.
98- offset = 0.
99- stream_id = '0'
100- sig_channels .append ((ch_name , chan_id , sr , dtype , units , gain , offset , stream_id ))
91+ if self .load_analogsignal :
92+ for c in range (self ._num_channels ):
93+ ch_name = 'ch{}' .format (c )
94+ chan_id = str (c + 1 )
95+ sr = self ._sampling_rate # Hz
96+ dtype = self ._dtype
97+ units = 'uV'
98+ gain = 1.
99+ offset = 0.
100+ stream_id = '0'
101+ sig_channels .append ((ch_name , chan_id , sr , dtype , units , gain , offset , stream_id ))
101102
102103 sig_channels = np .array (sig_channels , dtype = _signal_channel_dtype )
103104
@@ -180,16 +181,10 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop,
180181
181182 def _spike_count (self , block_index , seg_index , unit_index ):
182183
183- if not self .load_spiketrains :
184- raise AttributeError ("Spiketrains not loaded. Set load_spiketrains=True in MEArecRawIO constructor" )
185-
186184 return len (self ._spiketrains [unit_index ])
187185
188186 def _get_spike_timestamps (self , block_index , seg_index , unit_index , t_start , t_stop ):
189187
190- if not self .load_spiketrains :
191- raise AttributeError ("Spiketrains not loaded. Set load_spiketrains=True in MEArecRawIO constructor" )
192-
193188 spike_timestamps = self ._spiketrains [unit_index ].times .magnitude
194189 if t_start is None :
195190 t_start = self ._segment_t_start (block_index , seg_index )
0 commit comments