def _fitC_residual(angles, r0, invCmat, wavelength): rI = gw.makeARecipVector(angles, wavelength) #print rI df = 1./Mag(rI) d0 = 1./Mag(r0) gii_0 = dot(r0,r0) gii = dot(dot(invCmat,r0),r0) r_i = df/d0 - sqrt(gii_0)/(sqrt(gii)) return r_i
def _fitR_residual(angles, r0, Fmat, wavelength): Cmat = dot(Fmat.T,Fmat) rI = gw.makeARecipVector(angles,wavelength) n = Unit(rI) N = Unit(r0) #print Fmat,Cmat alpha_ = sqrt(Inner_Prod(Star(Cmat),N,N)) #print alpha_ r_i = Inner_Prod(Star(Fmat),n,N) - alpha_ #print 'r_i' return r_i