kwd.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:spyking-circus 作者: spyking-circus 项目源码 文件源码
def set_streams(self, stream_mode):

        if stream_mode == 'single-file':

            sources     = []
            to_write    = []
            count       = 0
            params      = self.get_description()
            my_file     = h5py.File(self.file_name)
            all_matches = my_file.get('recordings').keys()
            all_streams = []
            for m in all_matches:
                all_streams += [int(m)]

            idx = numpy.argsort(all_streams)

            for count in xrange(len(all_streams)):
                params['recording_number'] = all_streams[idx[count]]
                new_data   = type(self)(self.file_name, params)
                sources   += [new_data]
                to_write  += ['We found the datafile %s with t_start %d and duration %d' %(new_data.file_name, new_data.t_start, new_data.duration)]

            print_and_log(to_write, 'debug', logger)

            return sources

        elif stream_mode == 'multi-files':
            return H5File.set_streams(stream_mode)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号