Example #1
0
 def initShExplicit(self, **kwargs):
     # this function offers the flexibility to use function objects with tunable parameters
     # TODO: implement
     self.__obj.shapeclass = Conic(curv=0, cc=0)
Example #2
0
                                             (si * 7.233e-11, 29.075),
                                             (si * 4.529e-12, -2.085)]),
                 aperture=CircularAperture(lcS2, maxradius=40.0))
D2Psurf = Surface(lcD2prime)
D3surf = Surface(lcD3)
S3surf = Surface(lcS3,
                 shape=Biconic(lcS3,
                               curvy=si * 1. / 108.187,
                               curvx=si * 1. / 73.105,
                               coefficients=[(0., 0.), (-si * 5.542e-7, -0.08),
                                             (-si * 8.176e-11, -1.379)]),
                 aperture=CircularAperture(lcS3, maxradius=40.0))
D3Psurf = Surface(lcD3prime)
D4surf = Surface(lcD4)
S4surf = Surface(lcS4,
                 shape=Conic(lcS4, curv=1. / 77.772),
                 aperture=CircularAperture(lcS4, maxradius=40.0))
D4Psurf = Surface(lcD4prime)
imgsurf = Surface(lcimage)

elem = OpticalElement(lc0, name="HUD")

elem.addMaterial("air", air)
elem.addMaterial("glass", glass)

elem.addSurface("object", objsurf, (None, None))
elem.addSurface("d1", D1surf, (None, None))
elem.addSurface("s1", S1surf, (None, "glass"))
elem.addSurface("d1p", D1Psurf, ("glass", "glass"))
elem.addSurface("d2", D2surf, ("glass", "glass"))
elem.addSurface("s2", S2surf, ("glass", "glass"))
# definition of optical system
s = OpticalSystem.p()

lc0 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="stop", decz=1.0),
                                 refname=s.rootcoordinatesystem.name)
lc1 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="surf1", decz=10.0),
                                 refname=lc0.name)  # objectDist
lc2 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="surf2", decz=5.0),
                                 refname=lc1.name)
lc3 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="image", decz=10.0),
                                 refname=lc2.name)

stopsurf = Surface.p(lc0)
frontsurf = Surface.p(lc1,
                      shape=Conic.p(lc1, curv=0),
                      aperture=CircularAperture.p(lc1, maxradius=10.0))
rearsurf = Surface.p(lc2,
                     shape=Conic.p(lc2, curv=0),
                     aperture=CircularAperture.p(lc3, maxradius=10.0))
image = Surface.p(lc3)

elem = OpticalElement.p(lc0, name="crystalelem")

no = 1.5
neo = 1.8

myeps = np.array([[no, 0, 0], [0, no, 0], [0, 0, neo]])

crystal = AnisotropicMaterial.p(lc1, myeps)
Example #4
0
lc1 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="surf1",
                                                    decz=10.0,
                                                    tiltx=5. * math.pi /
                                                    180.0),
                                 refname=lc0.name)  # objectDist
lc2 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="surf2",
                                                    decz=20.0,
                                                    tiltx=10. * math.pi /
                                                    180.0),
                                 refname=lc1.name)
lc3 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="image", decz=10.0),
                                 refname=lc2.name)

stopsurf = Surface.p(lc0)
surf1 = Surface.p(lc1,
                  shape=Conic.p(lc1, curv=1. / 24.0),
                  aperture=CircularAperture.p(lc1, maxradius=5.0))
surf2 = Surface.p(lc2,
                  shape=Conic.p(lc2, curv=-1. / 24.0),
                  aperture=CircularAperture.p(lc2, maxradius=5.0))
image = Surface.p(lc3)

elem = OpticalElement.p(lc0, name="grinelement")

mysource =\
r"""

import numpy as np

grin_strength = 0.5
Example #5
0
                                                    decz=-100,
                                                    decy=-35),
                                 refname=lc4.name)
lc5ap = s.addLocalCoordinateSystem(LocalCoordinates.p(name="oaparaap",
                                                      decz=0,
                                                      decy=35),
                                   refname=lc5.name)
lc6 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="image2",
                                                    decz=52.8,
                                                    tiltx=1 * math.pi / 32),
                                 refname=lc5.name)
lc7 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="image3", decz=5),
                                 refname=lc6.name)

objectsurf = Surface.p(lc0)
m1surf = Surface.p(lc1, shape=Conic.p(lc1, curv=-0.01))
m2surf = Surface.p(lc2, shape=Conic.p(lc2, curv=0.01))
m3surf = Surface.p(lc3, shape=Conic.p(lc3, curv=-0.006))
image1 = Surface.p(lc4)
oapara = Surface.p(lc3, shape=Conic.p(lc5, curv=0.01, cc=-1.))
image2 = Surface.p(lc6, aperture=CircularAperture.p(lc6, maxradius=20.0))
image3 = Surface.p(lc7, aperture=CircularAperture.p(lc7, maxradius=20.0))

elem = OpticalElement.p(lc0, name="TMA")

elem.addMaterial("air", air)

elem.addSurface("object", objectsurf, (None, None))
elem.addSurface("m1", m1surf, (None, None))
elem.addSurface("m2", m2surf, (None, None))
elem.addSurface("m3", m3surf, (None, None))
Example #6
0
                                                  decz=5.0,
                                                  tiltx=2.5 * degree),
                                 refname=lc2.name)
lc4 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf4", decz=3.0),
                                 refname=lc3.name)
lc5 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf5", decz=3.0),
                                 refname=lc4.name)
lc6 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf6", decz=2.0),
                                 refname=lc5.name)
lc7 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf7", decz=3.0),
                                 refname=lc6.name)
lc8 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=19.0),
                                 refname=lc7.name)

objectsurf = Surface(lc0)
surf1 = Surface(lc1, shape=Conic(lc1, curv=1 / -5.922))
surf2 = Surface(lc2, shape=Conic(lc2, curv=1 / -3.160))
surf3 = Surface(lc3, shape=Conic(lc3, curv=1 / 15.884))
surf4 = Surface(lc4, shape=Conic(lc4, curv=1 / -12.756))
stopsurf = Surface(lc5)
surf6 = Surface(lc6, shape=Conic(lc6, curv=1 / 3.125))
surf7 = Surface(lc7, shape=Conic(lc7, curv=0.1 * 1 / 1.479))
image = Surface(lc8)

elem = OpticalElement(lc0, name="lenssystem")

glass = ConstantIndexGlass(lc0, n=1.7)
glass2 = ConstantIndexGlass(lc0, n=1.5)

elem.addMaterial("glass", glass)
elem.addMaterial("glass2", glass2)