打开Abf时“列表索引超出范围”。使用pyabf的文件

时间:2019-02-13 08:25:03

标签: python file

我正在尝试使用pyabf库打开abf(轴突二进制格式), 如下:

import matplotlib.pyplot as plt
import numpy as np
import pyabf
abf = 
pyabf.ABF(r"C:\temp\2018_07_02_06\2018_07_02_06.CH1.abf",loadData=True, 
          cacheStimulusFiles=False)   

但是出现以下错误:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-26-02884ab5af1b> in <module>()
      3 import numpy as np
      4 import pyabf
----> 5 abf = 
pyabf.ABF(r"C:\temp\2018_07_02_06\2018_07_02_06.CH1.abf",loadData=True, 
cacheStimulusFiles=False)
      6 

C:\anaconda\lib\site-packages\pyabf\abf.py in __init__(self, abfFilePath, 
loadData, cacheStimulusFiles)
     91             if self._preLoadData:
     92                 self._loadAndScaleData(fb)
---> 93                 self.setSweep(0)
     94 
     95     def __str__(self):

C:\anaconda\lib\site-packages\pyabf\abf.py in setSweep(self, sweepNumber, 
channel, absoluteTime, baseline)
    486         self.sweepChannel = channel
    487         self.sweepUnitsY = self.adcUnits[channel]
--> 488         self.sweepUnitsC = self.dacUnits[channel]
    489         self.sweepUnitsX = "sec"
    490 

IndexError: list index out of range

该如何解决?

1 个答案:

答案 0 :(得分:0)

也许是pyABF由于某种原因不支持的格式-尝试将您的ABF发送给pyABF作者,或者打开GitHub问题并附加文件: https://github.com/swharden/pyABF