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
评论列表
文章目录