本文整理汇总了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):
示例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