Beispiel #1
0
def get_countrates_at_sinlge_zernike_amp(zernike_i, amp):
    X, Y, Z_matrix = zernike.zernike_grid_i(i, 12)
    new_voltages = dm.get_cur_voltages(
    ) + amp * dm.voltages_from_matrix(Z_matrix)
    dm.set_cur_voltages(new_voltages)
    crs = measure_counts()
    return -1. * crs
Beispiel #2
0
def get_countrates_at_zernike_amp(zernike_amps, *initial_voltages):
    if (msvcrt.kbhit() and msvcrt.getch() == 'q'):
        raise Exception('User abort')
    new_voltages = initial_voltages
    for i, amp in enumerate(zernike_amps):
        X, Y, Z_matrix = zernike.zernike_grid_i(i, 12)
        new_voltages += amp * dm.voltages_from_matrix(Z_matrix)
    dm.set_cur_voltages(new_voltages)

    crs = measure_counts()
    print 'avg_amplitude : {:.2f}, Countrates: {:.0f}'.format(
        np.mean(np.abs(zernike_amps)), crs)
    #print zernike_amps[0:10]
    return -1. * crs
Beispiel #3
0
def optimize_zernike_amplitude(name, zernike_mode, **kw):
    name = name + '_zernike_' + str(zernike_mode)
    X, Y, Z_matrix = zernike.zernike_grid_i(zernike_mode, 12)
    return optimize_matrix_amplitude(name, Z_matrix, **kw)