Пример #1
0
    def zernike2seidel(self):
        a = [0] + self.__coefficients__
        #Piston
        Ap = a[1] - __sqrt__(3) * a[4] + __sqrt__(5) * a[11]
        #tilt
        At = 2 * __sqrt__((a[2] - __sqrt__(8) * a[8])**2 +
                          (a[3] - __sqrt__(8) * a[7])**2)
        Bt = __arctan2__(a[3] - __sqrt__(8) * a[7],
                         a[2] - __sqrt__(8) * a[8]) * 180 / __np__.pi
        #defocus
        Ad = 2 * (__sqrt__(3) * a[4] - 3 * __sqrt__(5) * a[11])
        #Astigmatism
        Aa = 2 * __sqrt__(6 * (a[5]**2 + a[6]**2))
        Ba = __arctan2__(a[5], a[6]) * 180 / __np__.pi
        #Coma
        Ac = 6 * __sqrt__(2 * (a[7]**2 + a[8]**2))
        Bc = __arctan2__(a[7], a[8]) * 180 / __np__.pi
        #Spherical
        As = 6 * __sqrt__(5) * a[11]
        A = [Ap, At, Bt, Ad, Aa, Ba, Ac, Bc, As]

        seidellist = [
            "Piston", "Tilt", "Defocus", "Astigmatism", "Coma", "Spherical"
        ]
        Atable = [[Ap, 0.0], [At, Bt], [Ad, 0.0], [Aa, Ba], [Ac, Bc],
                  [As, 0.0]]
        print "             Magnitude  Angle (Degrees)"
        print "-------------------------------------------"
        for i in range(len(seidellist)):
            print "| {0:>13s} |  {1:>8s}  | {2:>8s}   |".\
            format(seidellist[i],str(round(Atable[i][0],3)),str(round(Atable[i][1],3)))
        print "-------------------------------------------"
        SeidelCoefficient = __seidel2__.Coefficient(Atable)
        return SeidelCoefficient
Пример #2
0
	def zernike2seidel(self):
		a = [0]+self.__coefficients__
		#Piston
		Ap = a[1]-__sqrt__(3)*a[4]+__sqrt__(5)*a[11]
		#tilt
		At = 2*__sqrt__((a[2]-__sqrt__(8)*a[8])**2+(a[3]-__sqrt__(8)*a[7])**2)
		Bt = __arctan2__(a[3]-__sqrt__(8)*a[7],a[2]-__sqrt__(8)*a[8])*180/__np__.pi
		#defocus
		Ad = 2*(__sqrt__(3)*a[4]-3*__sqrt__(5)*a[11])
		#Astigmatism 
		Aa = 2*__sqrt__(6*(a[5]**2+a[6]**2))
		Ba = __arctan2__(a[5],a[6])*180/__np__.pi
		#Coma
		Ac = 6*__sqrt__(2*(a[7]**2+a[8]**2))
		Bc = __arctan2__(a[7],a[8])*180/__np__.pi
		#Spherical
		As = 6*__sqrt__(5)*a[11]
		A = [Ap,At,Bt,Ad,Aa,Ba,Ac,Bc,As]


		seidellist=["Piston",
				 	"Tilt",
				 	"Defocus",
				 	"Astigmatism",
				 	"Coma",
				 	"Spherical"]
		Atable = [[Ap,0.0],[At,Bt],[Ad,0.0],[Aa,Ba],[Ac,Bc],[As,0.0]]
		print"             Magnitude  Angle (Degrees)"
		print"-------------------------------------------"
		for i in range(len(seidellist)):
			print "| {0:>13s} |  {1:>8s}  | {2:>8s}   |".\
			format(seidellist[i],str(round(Atable[i][0],3)),str(round(Atable[i][1],3)))
		print"-------------------------------------------"
		SeidelCoefficient = __seidel2__.Coefficient(Atable)	
		return SeidelCoefficient
Пример #3
0
def __seidelcartesian__(coefficient,x,y):
	W = coefficient
	h = 1
	u = __arctan2__(y,x)
	r = __sqrt__(x**2+y**2)
	W = __seidelpolar__(coefficient,r,u)
	return W
Пример #4
0
def __seidelcartesian__(coefficient, x, y):
    W = coefficient
    h = 1
    u = __arctan2__(y, x)
    r = __sqrt__(x**2 + y**2)
    W = __seidelpolar__(coefficient, r, u)
    return W