iq.py 文件源码

python
阅读 75 收藏 0 点赞 0 评论 0

项目:pyrpl 作者: lneuhaus 项目源码 文件源码
def _nadata_total(self): #only one read operation--> twice faster than _nadata
        attempt = 0
        a, b, c, d = self._reads(0x140, 4)
        while not ((a >> 31 == 0) and (b >> 31 == 0)
                   and (c >> 31 == 0) and (d >> 31 == 0)):
            a, b, c, d = self._reads(0x140, 4)

            self._logger.warning('NA data not ready yet. Try again!')
            attempt += 1
            if attempt > 10:
                raise Exception("Trying to recover NA data while averaging is not finished. Some setting is wrong. ")
        sum = np.complex128(self._to_pyint(int(a) + (int(b) << 31), bitlength=62)) \
              + np.complex128(self._to_pyint(int(c) + (int(d) << 31), bitlength=62)) * 1j
        return sum
    # the implementation of network_analyzer is not identical to na_trace
    # there are still many bugs in it, which is why we will keep this function
    # in the gui
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号