Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 53d5a458a276
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b363cb1d669d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 23, 2016

  1. Copy the full SHA
    467268a View commit details
  2. Copy the full SHA
    b363cb1 View commit details
Showing with 45 additions and 0 deletions.
  1. +2 −0 artiq/wavesynth/coefficients.py
  2. +43 −0 examples/master/repository/coredevice_examples/pdq2_simple.py
2 changes: 2 additions & 0 deletions artiq/wavesynth/coefficients.py
Original file line number Diff line number Diff line change
@@ -73,6 +73,8 @@ def build_segment(durations, coefficients, target="bias",
if cdj or abs(yijk) or not compress:
cdj.append(float(yijk))
cdj.reverse()
if not cdj:
cdj.append(float(yij[0]))
cd.append({target: {variable: cdj}})
yield {"duration": int(dxi), "channel_data": cd}

43 changes: 43 additions & 0 deletions examples/master/repository/coredevice_examples/pdq2_simple.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import numpy as np

from artiq.experiment import *
from artiq.wavesynth.coefficients import build_segment


class PDQ2Simple(EnvExperiment):
"""Set PDQ2 voltages."""
def build(self):
self.setattr_device("core")
self.setattr_device("pmt")
self.setattr_device("electrodes")

# 1 device, 3 board each, 3 dacs each
self.u = np.arange(4*3)[None, :, None]*.1

def setup(self, offset):
self.electrodes.disarm()
self.load = self.electrodes.create_frame()
segment = self.load.create_segment()
for line in build_segment([100], self.u + offset):
segment.add_line(**line)
self.detect = self.electrodes.create_frame()
segment = self.detect.create_segment()
for line in build_segment([100], -self.u + offset):
segment.add_line(**line)
self.electrodes.arm()

@kernel
def one(self):
self.load.advance()
delay(1*ms)
self.detect.advance()
delay(1*ms)
self.pmt.gate_rising(100*us)
return self.pmt.count()

def run(self):
offsets = np.linspace(0, 10, 3)
for o in offsets:
self.setup(o)
print(self.electrodes.get_program())
self.one()