forked from M-Labs/artiq
1
0
Fork 0

Merge branch 'master' of github.com:m-labs/artiq

This commit is contained in:
Sebastien Bourdeauducq 2016-02-25 01:25:31 +08:00
commit 6b28b8e36e
2 changed files with 8 additions and 5 deletions

View File

@ -103,6 +103,9 @@ class _Frame:
def _get_program(self): def _get_program(self):
r = [] r = []
for segment in self.segments: for segment in self.segments:
if segment.duration < 2*trigger_duration:
raise ValueError(("Segment too short ({:g} s), trigger might "
"spill").format(segment.duration))
segment_program = [ segment_program = [
{ {
"dac_divider": dac_divider, "dac_divider": dac_divider,
@ -168,10 +171,10 @@ class CompoundPDQ2:
def disarm(self): def disarm(self):
for frame in self.frames: for frame in self.frames:
frame._invalidate() frame._invalidate()
self.frames = [] self.frames.clear()
self.armed = False
for dev in self.pdq2s: for dev in self.pdq2s:
dev.park() dev.park()
self.armed = False
def get_program(self): def get_program(self):
return [f._get_program() for f in self.frames] return [f._get_program() for f in self.frames]
@ -181,7 +184,6 @@ class CompoundPDQ2:
raise ArmError() raise ArmError()
for frame in self.frames: for frame in self.frames:
frame._arm() frame._arm()
self.armed = True
full_program = self.get_program() full_program = self.get_program()
n = 0 n = 0
@ -203,6 +205,7 @@ class CompoundPDQ2:
n += dn n += dn
for pdq2 in self.pdq2s: for pdq2 in self.pdq2s:
pdq2.unpark() pdq2.unpark()
self.armed = True
def create_frame(self): def create_frame(self):
if self.armed: if self.armed:

View File

@ -17,8 +17,8 @@ class Transport(EnvExperiment):
self.setattr_argument("wait_at_stop", NumberValue(100*us)) self.setattr_argument("wait_at_stop", NumberValue(100*us))
self.setattr_argument("speed", NumberValue(1/(10*us))) self.setattr_argument("speed", NumberValue(1/(10*us)))
self.setattr_argument("repeats", NumberValue(100)) self.repeats = int(self.get_argument("repeats", NumberValue(100)))
self.setattr_argument("bins", NumberValue(100)) self.bins = int(self.get_argument("bins", NumberValue(100)))
t = np.linspace(0, 10, 101) # waveform time t = np.linspace(0, 10, 101) # waveform time
u = 1 - np.cos(np.pi*t/t[-1]) u = 1 - np.cos(np.pi*t/t[-1])