Exemplo n.º 1
0
 def test_link_resolve(self):
     nwbfile = NWBFile("a file with header data", "NB123A", datetime(2018, 6, 1, tzinfo=tzlocal()))
     device = nwbfile.create_device('device_name')
     electrode_group = nwbfile.create_electrode_group(
         name='electrode_group_name',
         description='desc',
         device=device,
         location='unknown')
     nwbfile.add_electrode(id=0,
                           x=1.0, y=2.0, z=3.0,  # position?
                           imp=2.718,
                           location='unknown',
                           filtering='unknown',
                           group=electrode_group)
     etr = nwbfile.create_electrode_table_region([0], 'etr_name')
     for passband in ('theta', 'gamma'):
         electrical_series = ElectricalSeries(name=passband + '_phase',
                                              data=[1., 2., 3.],
                                              rate=0.0,
                                              electrodes=etr)
         nwbfile.add_acquisition(electrical_series)
     with NWBHDF5IO(self.path, 'w') as io:
         io.write(nwbfile)
     with NWBHDF5IO(self.path, 'r') as io:
         io.read()
Exemplo n.º 2
0
    def test_link_resolve(self):
        print("TEST_LINK_RESOLVE")

        nwbfile = NWBFile("source", "a file with header data", "NB123A",
                          '2018-06-01T00:00:00')
        device = nwbfile.create_device('device_name', 'source')
        electrode_group = nwbfile.create_electrode_group(
            name='electrode_group_name',
            source='source',
            description='desc',
            device=device,
            location='unknown')
        nwbfile.add_electrode(
            0,
            1.0,
            2.0,
            3.0,  # position?
            imp=2.718,
            location='unknown',
            filtering='unknown',
            description='desc',
            group=electrode_group)
        etr = nwbfile.create_electrode_table_region([0], 'etr_name')
        for passband in ('theta', 'gamma'):
            electrical_series = ElectricalSeries(name=passband + '_phase',
                                                 source='ephys_analysis',
                                                 data=[1., 2., 3.],
                                                 rate=0.0,
                                                 electrodes=etr)
            nwbfile.add_acquisition(electrical_series)
        with NWBHDF5IO(self.path, 'w') as io:
            io.write(nwbfile)
        with NWBHDF5IO(self.path, 'r') as io:
            io.read()