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


Python Datacube.createCol方法代码示例

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


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

示例1: getTrace

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import createCol [as 别名]
  def getTrace(self,waitFullSweep = False,timeOut = 1600,fromMemory=False):
    """ 
    Get a raw trace in the VNA, without correcting the data, except for internal attenuators.
    Get the memory instead of main trace if fromMemory=True.
    Restart a sweep and wait for its completion if fromMemory=False and waitFullSweep=True.
    FOR INTERNAL USE ONLY.
    USE INSTEAD getFreqMagPhase(waitFullSweep = False,fromMemory=False,timeOut=60,addedAttenuators=0,unwindPhase=False,subtractedSlope=None,deltaPhase=None,offset=None).
    """
    trace = Datacube('Spectrum')
    handle = self.getHandle()
    handle.timeout = timeOut
    if waitFullSweep:
      print "Getting trace...",
      # freqs = self.ask_for_values("HLD;TRS;WFS;fma;msb;OFV;") 2011/12 VS 
      self.write('TRS;WFS;')
    freqs = self.ask_for_values('fma;msb;OFV;')
    data = self.write('fma;msb;')
    if(fromMemory):
      data = self.ask_for_values('MEM;OFD;')
      self.write('DTM;')
    else: 
      data = self.ask_for_values('OFD;')
    if waitFullSweep:
      print "done."
    freqs.pop(0)
    data.pop(0)
    mag = []
    phase = []
    #If y length is twice the x length, we got phase and magnitude.
    if len(data) == 2*len(freqs):
      for i in range(0,len(data)):
        if i%2 == 0:	
          mag.append(data[i])
        else:
				 phase.append(data[i])
    else:
      mag = data
    att=self.attenuation()
    trace.setParameters( {'attenuation':att,'power':self.totalPower()})
    trace.createCol(name='freq',values=freqs)
    trace.createCol(name='mag',values=array(mag)+att)
    if len(phase)!=0: trace.createCol(name='phase',values=phase)
    return trace
开发者ID:manipp4,项目名称:qubit_setup,代码行数:45,代码来源:vna.py


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