def collect_ncs_samples(path): logging.debug("Collecting samples") with open(path,'rb') as f: reader = binary_reader.BinaryReader(f, binary_reader.NEURALYNX_ENDIAN) header = print_header(reader) data = CscData(header, ncs_blocks(reader, header)) samples = data.samples(0) logging.debug("Done. %d samples" % len(samples))
def list_ncs(path): with open(path,'rb') as f: reader = binary_reader.BinaryReader(f, binary_reader.NEURALYNX_ENDIAN) header = print_header(reader) print ' ' print ' ' print "NCS blocks:" total_samples = 0 n = 0 for block in ncs_blocks(reader, header): n += 1 if n % 10000 == 0: print 'Block %d' % n total_samples += len(block.samples) print "Done (" + str(total_samples) + " samples)."