示例#1
0
                           '/rawDataSample.bin'))
path_to_filtered_data = (os.path.expanduser('~/data/ucl-neuropixel'
                         '/tmp/filtered.bin'))


# create batch processor for the data
bp = BatchProcessor(path_to_neuropixel_data,
                    dtype='int16', n_channels=385, data_format='wide',
                    max_memory='500MB')


# appply a single channel transformation, each batch will be all observations
# from one channel, results are saved to disk
bp.single_channel_apply(butterworth,
                        mode='disk',
                        output_path=path_to_filtered_data,
                        low_freq=300, high_factor=0.1,
                        order=3, sampling_freq=30000,
                        channels=[0, 1, 2])


# let's visualize the results
raw = RecordingsReader(path_to_neuropixel_data, dtype='int16',
                       n_channels=385, data_format='wide')

# you do not need to specify the format since single_channel_apply
# saves a yaml file with such parameters
filtered = RecordingsReader(path_to_filtered_data)

fig, (ax1, ax2) = plt.subplots(2, 1)
ax1.plot(raw[:2000, 0])
ax2.plot(filtered[:2000, 0])
示例#2
0

x_long = dummy(big_long[(slice(0, 2000000, None), 1)])
big_long[(slice(0, 2000000, None), 1)] = x_long
big_long.flush()

x_long = dummy(big_long[:, 1])
big_long[:, 1] = x_long

bp_long = BatchProcessor(path_to_long,
                         dtype='int64',
                         n_channels=50,
                         data_format='long',
                         max_memory='500MB')

path = bp_long.single_channel_apply(dummy, path_to_out)

out = RecordingsReader(path)
out

bp_wide = BatchProcessor(path_to_wide,
                         dtype='int64',
                         n_channels=50,
                         data_format='wide',
                         max_memory='500MB')

path = bp_wide.single_channel_apply(dummy, path_to_out)
out = RecordingsReader(path)
out

path = bp_long.multi_channel_apply(dummy, path_to_out)
示例#3
0
                                              '/rawDataSample.bin'))
path_to_filtered_data = (os.path.expanduser('~/data/ucl-neuropixel'
                                            '/tmp/filtered.bin'))

# create batch processor for the data
bp = BatchProcessor(path_to_neuropixel_data,
                    dtype='int16',
                    n_channels=385,
                    data_format='wide',
                    max_memory='500MB')

# appply a single channel transformation, each batch will be all observations
# from one channel
bp.single_channel_apply(butterworth,
                        path_to_filtered_data,
                        low_freq=300,
                        high_factor=0.1,
                        order=3,
                        sampling_freq=30000)

# let's visualize the results
raw = RecordingsReader(path_to_neuropixel_data,
                       dtype='int16',
                       n_channels=385,
                       data_format='wide')

# you do not need to specify the format since single_channel_apply
# saves a yaml file with such parameters
filtered = RecordingsReader(path_to_filtered_data)

fig, (ax1, ax2) = plt.subplots(2, 1)
ax1.plot(raw[:2000, 0])