Example #1
0
f.write("#reflect angle: %s\n" % (90.0-math.degrees(angle2)))
f.write("#L: %s\n" % L)
f.write("#bounce: %s\n" % bounce)
f.write("#bulk: %s\n" % bulk)
f.write("#rat0: %s\n" % rat0)

move_route=[]
reflect=[]
for i in xrange(len(scan_route)):
    control.move_all(scan_route[i])
    print "move_lr: (%s,%s)" % (scan_route[i][0],scan_route[i][1])
    print "move_pd: (%s,%s)" % (scan_route[i][2],scan_route[i][3])

    if i==0:
        print "first point"
        m=control.find_laser()
        #m=(0,0,0,0)
    else:
        print "in the quartz"
        m=control.find_laser([steps[-1]],move_route[0])
        #m=(0,0,0,0)

    pos=((m[0]+m[1])/2,(m[2]+m[3])/2)
    control.move_pd(pos[0],pos[1])
    mpd=[]
    rpd=[]
    for kkk in xrange(10):
        r=control.read_time_pico_dmm()
        mpd.append(float(r[1]))
        rpd.append(float(r[2]))
        print "%s %s %s %s %s %s %s %s %s" % (r[0],r[1],r[2],pos[0],pos[1],control.global_lr[0],control.global_lr[1],control.global_pd[0],control.global_pd[1])
Example #2
0
#!/usr/bin/python
import control
import sys

f = None
if len(sys.argv) > 1:
    f = open(sys.argv[1], "a")

m = control.find_laser()
pos = ((m[0] + m[1]) / 2, (m[2] + m[3]) / 2)
print "pos: %s %s" % (pos[0], pos[1])
control.move_pd(pos[0], pos[1])
mpd = []
rpd = []
for kkk in xrange(10):
    r = control.read_time_pico_dmm()
    mpd.append(float(r[1]) * 1e6)
    rpd.append(float(r[2]) * 1e6)
    if f != None:
        f.write(
            "%s %s %s %s %s %s %s %s %s\n"
            % (
                r[0],
                r[1],
                r[2],
                pos[0],
                pos[1],
                control.global_lr[0],
                control.global_lr[1],
                control.global_pd[0],
                control.global_pd[1],