File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -297,13 +297,13 @@ def get_original_chans(self):
297
297
# output = int32, 0 to nSavedChans - 1
298
298
channels = np .arange (0 , int (self .meta ['nSavedChans' ]))
299
299
else :
300
- # parse the snsSaveChanSubset string
301
- channels = np .arange (0 , 0 ) # creates an empty array of int32
302
- for sL in self .meta ['snsSaveChanSubset' ].split (sep = ',' ): # split at commas
303
- current_list = sL . split ( sep = ':' )
304
- # each set of continuous channels specified by chan1:chan2 inclusive
305
- new_channels = np . arange ( int ( current_list [ 0 ]), int ( current_list [ min ( 1 , len ( current_list ) - 1 )]) + 1 )
306
- channels = np .append (channels , new_channels )
300
+ # parse the channel list self.meta['snsSaveChanSubset']
301
+ channels = np .arange (0 ) # empty array
302
+ for channel_range in self .meta ['snsSaveChanSubset' ].split (',' ):
303
+ # a block of contiguous channels specified as chan or chan1:chan2 inclusive
304
+ ix = [ int ( r ) for r in channel_range . split ( ':' )]
305
+ assert len ( ix ) in ( 1 , 2 ), f"Invalid channel range spec ' { channel_range } '"
306
+ channels = np .append (np . r_ [ ix [ 0 ]: ix [ - 1 ] + 1 ] )
307
307
return channels
308
308
309
309
You can’t perform that action at this time.
0 commit comments