Пример #1
0
def test_prb():
    probegroup = read_prb(folder / 'dummy.prb')
    
    with open('two_tetrodes.prb', 'w') as f:
        f.write(prb_two_tetrodes)
    
    two_tetrode = read_prb('two_tetrodes.prb')
    assert len(two_tetrode.probes) == 2
    assert two_tetrode.probes[0].get_electrode_count() == 4
    
    write_prb('two_tetrodes_written.prb', two_tetrode)
    two_tetrode_back = read_prb('two_tetrodes_written.prb')
Пример #2
0
    def __init__(self, file_path):
        # load params file related to the given shybrid recording
        assert self.installed, self.installation_mesg
        assert Path(file_path).suffix in [
            ".yml", ".yaml"
        ], "The 'file_path' should be a yaml file!"
        params = sbio.get_params(file_path)['data']
        file_path = Path(file_path)

        # create a shybrid probe object
        probe = sbprb.Probe(params['probe'])
        nb_channels = probe.total_nb_channels

        # translate the byte ordering
        byte_order = params['order']
        if byte_order == 'C':
            time_axis = 1
        elif byte_order == 'F':
            time_axis = 0

        bin_file = file_path.parent / f"{file_path.stem}.bin"

        # piggyback on binary data recording extractor
        BinaryRecordingExtractor.__init__(self,
                                          files_path=bin_file,
                                          sampling_frequency=float(
                                              params['fs']),
                                          num_chan=nb_channels,
                                          dtype=params['dtype'],
                                          time_axis=time_axis)

        # load probe file
        probegroup = read_prb(params['probe'])
        self.set_probegroup(probegroup, in_place=True)
        self._kwargs = {'file_path': str(Path(file_path).absolute())}
Пример #3
0
prb_two_tetrodes = """
channel_groups = {
    0: {
            'channels' : [0,1,2,3],
            'geometry': {
                0: [0, 50],
                1: [50, 0],
                2: [0, -50],
                3: [-50, 0],
            }
    },
    1: {
            'channels' : [4,5,6,7],
            'geometry': {
                4: [0, 50],
                5: [50, 0],
                6: [0, -50],
                7: [-50, 0],
            }
    }
}
"""

with open('two_tetrodes.prb', 'w') as f:
    f.write(prb_two_tetrodes)

two_tetrode = read_prb('two_tetrodes.prb')
plot_probe_group(two_tetrode, same_axe=False, with_channel_index=True)

plt.show()