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


Python Datacube.clear方法代码示例

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


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

示例1: Instr

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

#.........这里部分代码省略.........

    self.generateShape()

    self.bit=int(self.name()[-1])-1
    self._phase=0
  
  def generateShape(self):
    """
    Use the folowing dictionnary to generate the shape:
      self._shapeParams["risingTime"]
      self._shapeParams["plateauLength"]
      self._shapeParams["latchLength"]
      self._shapeParams["plateau"]
    """
    self.shape=zeros((20000),dtype = numpy.complex128)

    self.shape[10000:10000+self._shapeParams["risingTime"]]=linspace(0,1,self._shapeParams["risingTime"])
    self.shape[10000+self._shapeParams["risingTime"]:10000+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]]=1
    self.shape[10000+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]:10000+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]+self._shapeParams["risingTime"]]=linspace(1,self._shapeParams["plateau"],self._shapeParams["risingTime"])
    self.shape[10000+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]+self._shapeParams["risingTime"]:10000+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]+self._shapeParams["risingTime"]+self._shapeParams["latchLength"]]=self._shapeParams["plateau"]


  def parameters(self):
    """
    Return parameters
    """    
    return self._params      


  def init(self):
    """
    Clear the JBA (no frequency to analyse)
    """
    self._pulseGenerator.clearPulse()
    self._pulseAnalyser.clear()
    self._change=True
          
  def setFrequency(self, frequency, amplitude=1., duration=0., gaussian=False, delayFromZero=0,phase=None,shape=None):
    """
    Add a new frequency to analyse
    """
    if shape==None:shape=self.shape
    if phase==None:
      phase=self._phase
    self.phase=phase
    self._frequency=frequency
    self._amplitude=amplitude
    #self._pulseGenerator.clearPulse()
    self._pulseGenerator.generatePulse(duration=duration, frequency=self._frequency, amplitude=self._amplitude, DelayFromZero=delayFromZero,useCalibration=True, phase=phase,shape=amplitude*shape, name=self.name())
    self._fsb=-(self._pulseGenerator._MWSource.frequency()-frequency)
    self._pulseAnalyser.addFrequency(f=self._fsb, name=self.name(),bit=self.bit)
    self._change=True
            
  def sendAllWaveforms(self,forceSend=False):
    """
    Send all waveforms in pulseGenerator buffer
    """
    self._pulseGenerator.sendPulse(forceSend)
    
  def sendWaveform(self,forceSend=False):
    """
    Send waveform pf this JBA
    """
    self._pulseGenerator.sendPulse(forceSend)
    
  def setAmplitude(self, amplitude, magnitudeButton=None, phase=None,**args):
开发者ID:manipp4,项目名称:qubit_setup,代码行数:70,代码来源:jba_sb_old_20140425.py

示例2: Instr

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

#.........这里部分代码省略.........
    self.generateShape()

    self.bit=int(self.name()[-1])-1
    self._phase=0
    self._nLoopsMax=70
  
  def generateShape(self):
    """
    Use the folowing dictionnary to generate the shape:
      self._shapeParams["risingTime"]
      self._shapeParams["plateauLength"]
      self._shapeParams["latchLength"]
      self._shapeParams["plateau"]
    """
    self.shape=zeros((20000),dtype = numpy.complex128)

    self.shape[10000+self._shapeParams["offsetDelay"]:10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]]=linspace(0,1,self._shapeParams["risingTime"])
    self.shape[10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]:10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]]=1
    self.shape[10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]:10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]+self._shapeParams["risingTime"]]=linspace(1,self._shapeParams["plateau"],self._shapeParams["risingTime"])
    self.shape[10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]+self._shapeParams["risingTime"]:10000+self._shapeParams["offsetDelay"]+self._shapeParams["risingTime"]+self._shapeParams["plateauLength"]+self._shapeParams["risingTime"]+self._shapeParams["latchLength"]]=self._shapeParams["plateau"]


  def parameters(self):
    """
    Return parameters
    """    
    return self._params      


  def init(self):
    """
    Clear the JBA (no frequency to analyse)
    """
    self._pulseGenerator.clearPulse()
    self._pulseAnalyser.clear()
    self._change=True
      
  def setCarrierFrequency(self, f):
    self._pulseGenerator.setCarrierFrequency(f)

  def setFrequency(self, frequency, amplitude=1., duration=0., gaussian=False, delayFromZero=0,phase=None,shape=None, generatorToo=False):
    """
    Add a new frequency to analyse
    """
    if generatorToo: self.setCarrierFrequency(frequency)
    if shape==None:shape=self.shape
    if phase==None:
      phase=self._phase
    self.phase=phase
    self._frequency=frequency
    self._amplitude=amplitude
    #self._pulseGenerator.clearPulse()
    self._pulseGenerator.generatePulse(duration=duration, frequency=self._frequency, amplitude=self._amplitude, DelayFromZero=delayFromZero,useCalibration=True, phase=phase,shape=amplitude*shape, name=self.name())
    self._fsb=-(self._pulseGenerator._MWSource.frequency()-frequency)
    self._pulseAnalyser.addFrequency(f=self._fsb, name=self.name(),bit=self.bit)
    self._change=True
            
  def sendAllWaveforms(self,forceSend=False):
    """
    Send all waveforms in pulseGenerator buffer
    """
    self._pulseGenerator.sendPulse(forceSend)
    
  def sendWaveform(self,forceSend=False):
    """
    Send waveform pf this JBA
开发者ID:manipp4,项目名称:qubit_setup,代码行数:70,代码来源:jba_sb.py


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