Esempio n. 1
0
    def dummycreate4(self):
        self.os = OpticalSystem(objectDistance=20.0) # reinit os
        #self.os.surfaces[1].shape.sdia.val = 1e10

        def nfun(x, y, z):
            return 0.5*np.exp(-x**2 - 4.*y**2)+1.0#(2.5 - (x**2 + 100.0*y**4)/10.**2)

        def ndx(x, y, z):
            return -2.*x*0.5*np.exp(-x**2 - 4.*y**2)#-2*x/10.**2

        def ndy(x, y, z):
            return -2.*4.*y*0.5*np.exp(-x**2 - 4.*y**2) #-100.0*4.0*y**3/10.**2

        def ndz(x, y, z):
            return np.zeros_like(x)

        def boundarycheck(x, y, z):
            return np.ones_like(x, dtype=bool)

        self.os.insertSurface(1,
                              Surface(surfShape.Conic(curv=-1./24.),
                                      thickness = 30.0,
                                      material=material.GrinMaterial(nfun, ndx, ndy, ndz, 0.01, 1e-3, boundarycheck),
                                      aperture=aperture.CircularAperture(5.0)
                                      )
                              )
        self.os.insertSurface(2,
                              Surface(surfShape.Conic(curv=1./24.),
                                      thickness = 10.0,
                                      aperture=aperture.CircularAperture(5.0)
                                      )
                              )
Esempio n. 2
0
 def dummycreate(
         self):  # should only create the demo system, will be removed later
     self.os = OpticalSystem(objectDistance=2.0)  # reinit os
     #self.os.surfaces[1].shape.sdia.val = 1e10 # radius of image plane may not be zero to be sure to catch all rays
     self.os.insertSurface(
         1,
         Surface(surfShape.Conic(curv=1 / -5.922),
                 thickness=3.0,
                 material=material.ConstantIndexGlass(1.7)))  # 0.55
     self.os.insertSurface(2,
                           Surface(surfShape.Conic(curv=1 / -3.160),
                                   thickness=5.0))  # 1.0
     self.os.insertSurface(
         3,
         Surface(surfShape.Conic(curv=1 / 15.884),
                 thickness=3.0,
                 material=material.ConstantIndexGlass(1.7)))  # 1.3
     self.os.insertSurface(4,
                           Surface(surfShape.Conic(curv=1 / -12.756),
                                   thickness=3.0))  # 1.3
     self.os.insertSurface(5,
                           Surface(surfShape.Conic(),
                                   thickness=2.0))  # semidiam=1.01 # STOP
     self.os.insertSurface(
         6,
         Surface(surfShape.Conic(curv=1 / 3.125),
                 thickness=3.0,
                 material=material.ConstantIndexGlass(1.5)))  # semidiam=1.0
     self.os.insertSurface(7,
                           Surface(surfShape.Conic(curv=1 / 1.479),
                                   thickness=19.0))  # semidiam=1.0
Esempio n. 3
0
 def dummycreate2(self):
     self.os = OpticalSystem(objectDistance=20.0)  # reinit os
     #self.os.surfaces[1].shape.sdia.val = 1e10
     self.os.insertSurface(
         1,
         Surface(surfShape.Conic(curv=-1. / 24.),
                 thickness=-30.0,
                 material=material.Mirror(),
                 aperture=aperture.CircularAperture(5.0)))