예제 #1
0
def do_measurement(phases, ontime=1, offtime=12):
    voltages = table.get_voltages(phases)
    dac.write_voltages(voltages)
    print 'warming up...'
    for j in range(ontime):
        fpga.read()
    counts = dict(zip(fpga.labels, fpga.read()))
    dac.zero()
    print 'cooling'
    for j in range(offtime):
        fpga.read()
    return counts
예제 #2
0
def do_measurement(phases, ontime=1, offtime=12):
    voltages=table.get_voltages(phases)
    dac.write_voltages(voltages)
    print 'warming up...'
    for j in range(ontime): 
        fpga.read()
    counts=fpga.read()
    dac.zero()
    print 'cooling'
    for j in range(offtime): 
        fpga.read()
    return counts
예제 #3
0
def do_experiment(voltages, ontime=2, offtime=12):
    dac.write_voltages(voltages)
    print 'warming up...',
    for j in range(ontime): 
        fpga.read()
    counts=fpga.read()
    dac.zero()
    print 'cooling...',
    for j in range(offtime): 
        fpga.read()
    
    # Get c00, c01, c10, c11
    coincidences=np.array(counts[8:12])
    accidentals=np.array([counts[12], counts[17], counts[16], counts[13]]) 
    corrected_counts=coincidences-accidentals
    total_counts=np.sum(corrected_counts)
    print 'total count rate %d' % total_counts
    probabilities_expt=corrected_counts/float(np.sum(corrected_counts))
    return probabilities_expt, total_counts
예제 #4
0
def do_experiment(voltages, ontime=2, offtime=12):
    dac.write_voltages(voltages)
    print 'warming up...',
    for j in range(ontime):
        fpga.read()
    counts = fpga.read()
    dac.zero()
    print 'cooling...',
    for j in range(offtime):
        fpga.read()

    # Get c00, c01, c10, c11
    coincidences = np.array(counts[8:12])
    accidentals = np.array([counts[12], counts[17], counts[16], counts[13]])
    corrected_counts = coincidences - accidentals
    total_counts = np.sum(corrected_counts)
    print 'total count rate %d' % total_counts
    probabilities_expt = corrected_counts / float(np.sum(corrected_counts))
    return probabilities_expt, total_counts