From a1cf632d14fd101e12b1f742e78907a489275d23 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 22 May 2017 19:19:21 +0800 Subject: [PATCH] remove pdq2_client --- artiq/frontend/pdq2_client.py | 73 ----------------------------------- doc/manual/ndsp_reference.rst | 7 ---- setup.py | 1 - 3 files changed, 81 deletions(-) delete mode 100755 artiq/frontend/pdq2_client.py diff --git a/artiq/frontend/pdq2_client.py b/artiq/frontend/pdq2_client.py deleted file mode 100755 index bb0336cd9..000000000 --- a/artiq/frontend/pdq2_client.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/python -# Copyright (C) 2012-2015 Robert Jordens - -import argparse - -from scipy import interpolate -import numpy as np - -from artiq.protocols.pc_rpc import Client -from artiq.tools import verbosity_args, init_logger - - -def get_argparser(): - parser = argparse.ArgumentParser(description="""PDQ2 client. - Evaluates times and voltages, interpolates and uploads - them to the controller.""") - parser.add_argument("-s", "--server", default="::1", - help="hostname or IP of the controller to connect to") - parser.add_argument("--port", default=3252, type=int, - help="TCP port to use to connect to the controller") - parser.add_argument("-c", "--channel", default=0, type=int, - help="channel: 3*board_num+dac_num [%(default)s]") - parser.add_argument("-f", "--frame", default=0, type=int, - help="frame [%(default)s]") - parser.add_argument("-t", "--times", default="np.arange(5)*1e-6", - help="sample times (s) [%(default)s]") - parser.add_argument("-u", "--voltages", - default="(1-np.cos(t/t[-1]*2*np.pi))/2", - help="sample voltages (V) [%(default)s]") - parser.add_argument("-o", "--order", default=3, type=int, - help="interpolation (0: const, 1: lin, 2: quad," - " 3: cubic) [%(default)s]") - parser.add_argument("-e", "--free", default=False, action="store_true", - help="software trigger [%(default)s]") - verbosity_args(parser) - return parser - - -def main(): - args = get_argparser().parse_args() - init_logger(args) - dev = Client(args.server, args.port, "pdq2") - - freq = dev.get_freq() - times = np.around(eval(args.times, globals(), {})*freq) - voltages = eval(args.voltages, globals(), dict(t=times/freq)) - - dt = np.diff(times.astype(np.int)) - if args.order: - tck = interpolate.splrep(times, voltages, k=args.order, s=0) - u = interpolate.spalde(times, tck) - else: - u = voltages[:, None] - segment = [] - for dti, ui in zip(dt, u): - segment.append({ - "duration": int(dti), - "channel_data": [{ - "bias": { - "amplitude": [float(uij) for uij in ui] - } - }] - }) - program = [[] for i in range(args.frame)] - program.append(segment) - dev.park() - dev.program(program, [args.channel]) - dev.unpark() - dev.cmd("TRIGGER", args.free) - - -if __name__ == "__main__": - main() diff --git a/doc/manual/ndsp_reference.rst b/doc/manual/ndsp_reference.rst index aab38f1e1..5daf8f141 100644 --- a/doc/manual/ndsp_reference.rst +++ b/doc/manual/ndsp_reference.rst @@ -24,13 +24,6 @@ Controller :ref: artiq.frontend.pdq2_controller.get_argparser :prog: pdq2_controller -Client -++++++ - -.. argparse:: - :ref: artiq.frontend.pdq2_client.get_argparser - :prog: pdq2_client - Lab Brick Digital Attenuator (LDA) ---------------------------------- diff --git a/setup.py b/setup.py index cc337153e..3ce815f4f 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,6 @@ console_scripts = [ "artiq_flash=artiq.frontend.artiq_flash:main", "lda_controller=artiq.frontend.lda_controller:main", "novatech409b_controller=artiq.frontend.novatech409b_controller:main", - "pdq2_client=artiq.frontend.pdq2_client:main", "pdq2_controller=artiq.frontend.pdq2_controller:main", "thorlabs_tcube_controller=artiq.frontend.thorlabs_tcube_controller:main", ]