示例#1
0
def num_int_a_ring(r1,r2,order,position,tal_at_pos,normvec):
# numerical integrate the results in a ring
# r1: inner radius
# r2: outer radius
# order: order of zernikes
# position: even order positions
# tal_at_pos: tallies at even orders
# normvec: normalization vectors
# integral: numerical integrals
	R = 0.392
	N = 1000
	rlist = np.linspace(r1,r2,N+1)
	dr = (r2-r1)/N
	zn_mode = np.zeros((len(rlist),len(position)))
	for j in range(0,len(rlist)):
		full_zn_vals = capi.calc_zn(order,rlist[j]/R,0)
		for k in range(0,len(position)):
			zn_mode[j,k] = full_zn_vals[position[k]]
	tal_at_pos_mat = np.mat(tal_at_pos)
	normvec_mat = np.mat(normvec)
	tal_at_pos_mat = np.multiply(tal_at_pos_mat,normvec_mat)
	estimate = zn_mode*np.transpose(tal_at_pos_mat)
	estimate= np.squeeze(np.asarray(estimate))
	integral = 2*np.pi*np.trapz(np.multiply(estimate,rlist),rlist)

	return integral
示例#2
0
def fet_func(w, coeff, pos):
    R = 0.392
    order = 2 * (len(pos) - 1)
    # print(order)
    y = np.zeros(len(w))
    for i in range(0, len(w)):
        # print(i)
        full_zn_vals = capi.calc_zn(order, w[i] / R, 0)
        # print("b",len(full_zn_vals))
        # print("a",len(pos))
        rn_at_pos = get_val_at_pos(pos, full_zn_vals)
        y[i] = np.sum(np.multiply(coeff, rn_at_pos))
    return y
示例#3
0
def get_fet_est(radmid,position,order,tal_at_pos,normvec):
# get the FET estimations at the middle of each rings
# radmid: middle positions
# order: order of zernikes
# position: even order positions
# tal_at_pos: tallies at even orders
# normvec: normalization vectors
# fet_est_norm: normalized results to get the shape
    zn_mode = np.zeros((len(radmid),len(position)))
    R = 0.392
    for j in range(0,len(radmid)):
        full_zn_vals = capi.calc_zn(order,radmid[j]/R,0)
        for k in range(0,len(position)):
            zn_mode[j,k] = full_zn_vals[position[k]]
    tal_at_pos_mat = np.mat(tal_at_pos)
    normvec_mat = np.mat(normvec)
    tal_at_pos_mat = np.multiply(tal_at_pos_mat,normvec_mat)
    estimate = zn_mode*np.transpose(tal_at_pos_mat)
    fet_est = np.squeeze(np.asarray(estimate))
    fet_est_norm = fet_est/np.linalg.norm(fet_est)
    return fet_est_norm