51 tmp2, tmp1 = np.indices((n, n))
52 tmp1 = tmp1[:dimx, :dimy] - (dimx // 2)
53 tmp2 = tmp2[:dimx, :dimy] - (dimy // 2)
55 tmp = np.zeros((tmp1.size, 6), np.int32)
56 tmp[:, 0] = (tmp1**2).flatten()
57 tmp[:, 1] = (tmp2**2).flatten()
58 tmp[:, 2] = (tmp1 * tmp2).flatten()
59 tmp[:, 3] = tmp1.flatten()
60 tmp[:, 4] = tmp2.flatten()
63 return np.dot(np.linalg.inv(np.dot(tmp.T, tmp)), tmp.T).T
67 """ Returns the mean centroid gain
71 E : (np.array(dtype=np.float32)) : measurements from WFS
73 F : (np.array(dtype=np.float32)) : geometric measurements
77 cgain : (float) : mean centroid gain between the sets of WFS measurements and geometric ones
80 cgains = np.polyfit(E, F, 1)[0]
82 cgains = np.zeros(E.shape[1])
83 for k
in range(E.shape[1]):
84 cgains[k] = np.polyfit(E[:, k], F[:, k], 1)[0]
85 cgains = np.mean(cgains)
87 raise ValueError(
"E and F must 1D or 2D arrays")
def centroid_gain(E, F)
Returns the mean centroid gain.
def create_interp_mat(int dimx, int dimy)
TODO doc.