当前位置: 首页>>代码示例>>Python>>正文


Python Datacube.search方法代码示例

本文整理汇总了Python中pyview.lib.datacube.Datacube.search方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.search方法的具体用法?Python Datacube.search怎么用?Python Datacube.search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyview.lib.datacube.Datacube的用法示例。


在下文中一共展示了Datacube.search方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: IqOptimization

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import search [as 别名]

#.........这里部分代码省略.........
    self._awg.createRawWaveform("IQ_Sideband_Calibration_I",waveform,self._markers,"REAL")
    self._awg.createRawWaveform("IQ_Sideband_Calibration_Q",waveform,self._markers,"REAL")
        
  def loadSidebandWaveforms(self):
    self._awg.setWaveform(1,"IQ_Sideband_Calibration_I")
    self._awg.setWaveform(2,"IQ_Sideband_Calibration_Q")
    self._awg.setWaveform(3,"IQ_Sideband_Calibration_I")
    self._awg.setWaveform(4,"IQ_Sideband_Calibration_Q")

  def loadSidebandCalibrationWaveform(self,f_sb = 0,c = 0,phi = 0):
    
    length = int(1.0/self._awg.repetitionRate()*1e9)
    waveform = self.generateSidebandWaveform(f_sb = f_sb, c = c,phi = phi,length = length)
    self._awg.createRawWaveform("IQ_Sideband_Calibration_I",real(waveform)*0.5,self._markers,"REAL")
    self._awg.createRawWaveform("IQ_Sideband_Calibration_Q",imag(waveform)*0.5,self._markers,"REAL")

    return waveform
    
  def sidebandParameters(self,f_c,f_sb):
  
    if self.sidebandCalibrationData().column("f_c") == None:
      return (0,0)
  
    min_index = argmin(abs(self.sidebandCalibrationData().column("f_c")-f_c))
    f_c = self.sidebandCalibrationData()["f_c"][min_index]
    
    
    if min_index == None:
      return (0,0)
    
    calibrationData = self.sidebandCalibrationData().children(f_c = f_c)[0]
    
    
    rows = calibrationData.search(f_sb = f_sb)
    
    if rows != []:
      c = calibrationData.column("c")[rows[0]]
      phi = calibrationData.column("phi")[rows[0]]
    else:      
      phiInterpolation = scipy.interpolate.interp1d(calibrationData.column("f_sb"),calibrationData.column("phi"))      
      cInterpolation = scipy.interpolate.interp1d(calibrationData.column("f_sb"),calibrationData.column("c"))      
      
      c = cInterpolation(f_sb)
      phi = phiInterpolation(f_sb)
    
    return (c,phi)

  def calibrationParameters(self, f_c, f_sb):    
    (iO,qO)=(self.iOffset(f_c),self.qOffset(f_c))
    (c,phi) = self.sidebandParameters(f_c,f_sb)
    return (iO, qO, c, phi)
    
    
  def generateCalibratedSidebandWaveform(self,f_c,f_sb = 0,length = 100,delay = 0):
  
    (c,phi) = self.sidebandParameters(f_c,f_sb)

#    print "Generating a sideband waveform at f_c = %g GHz at f_sb = %g GHZ, c = %g, phi = %g deg" % (f_c,f_sb,c,phi*180.0/math.pi)
    
    return self.generateSidebandWaveform(f_sb,length = length,delay = delay,c = c,phi = phi)*0.8  
    

  def generateSidebandWaveform(self,f_sb = 0,c = 0,phi = 0,length = 100,delay = 0,normalize = True):
    """
    Generates a sideband waveform using a sideband frequency "f_sb", an amplitude correction "c" and a phase correction "phi"
    """
开发者ID:adewes,项目名称:python-qubit-setup,代码行数:70,代码来源:iq_level_optimization.py


注:本文中的pyview.lib.datacube.Datacube.search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。