コード例 #1
0
ファイル: test_io.py プロジェクト: LiuDaveLiu/ibllib
 def test_get_channel_map(self):
     map = spikeglx.get_sync_map(self.file3a)
     self.assertEqual(map, self.map3A)
     map = spikeglx.get_sync_map(self.file3b)
     self.assertEqual(map, self.map3B)
     with tempfile.TemporaryDirectory() as tdir:
         self.assertIsNone(spikeglx.get_sync_map(Path(tdir) / 'idontexist.json'))
コード例 #2
0
def get_ibl_sync_map(ef, version):
    """
    Gets default channel map for the version/binary file type combination
    :param ef: ibllib.io.spikeglx.glob_ephys_file dictionary with field 'ap' or 'nidq'
    :return: channel map dictionary
    """
    if version == '3A':
        default_chmap = CHMAPS['3A']['ap']
    elif version == '3B':
        if ef.get('nidq', None):
            default_chmap = CHMAPS['3B']['nidq']
        elif ef.get('ap', None):
            default_chmap = CHMAPS['3B']['ap']
    return spikeglx.get_sync_map(ef['path']) or default_chmap