示例#1
0
# definition of optical system
(s, sysseq) = build_simple_optical_system(
                [
                 ({"shape": "Conic"}, {"decz": 0.0}, None, "stop",
                  {"is_stop": True}),
                 ({"shape": "Conic"}, {"decz": 5.0}, 1.5168, "front", {}),
                 ({"shape": "Asphere", "curv": -1./50.,
                   "cc": -1., "coefficients": [0.0, 0.0, 0.0]},
                  {"decz": 20.0}, None, "back", {}),
                 ({"shape": "Conic"}, {"decz": 100.0}, None, "image", {})
                ],
                )

osa = OpticalSystemAnalysis(s, sysseq, name="Analysis")

(o, k, E0) = osa.collimated_bundle(121, {"startz": -5., "radius": 11.43},
                                   wave=wavelength)
initialbundle = RayBundle(x0=o, k0=k, Efield0=E0, wave=wavelength)

# initialbundle = generatebundle(openangle=10.*math.pi/180, numrays=121)


def meritfunctionrms(my_s):
    """
    Standard rms spot radius merit function without removing centroid.
    """
    initialbundle_local = RayBundle(x0=o, k0=k, Efield0=E0, wave=wavelength)
    rpaths = my_s.seqtrace(initialbundle_local, sysseq)
    # other constructions lead to fill up of initial bundle with intersection
    # values

    # for glassy asphere only one path necessary
示例#2
0
文件: demo_hud.py 项目: joha2/pyrate
                ("s3", {"is_mirror": True}),
                ("d3p", {}),
                ("d4", {}),
                ("s4", {}),
                ("d4p", {}),
                ("image", {})
            ]
           )
          ]


osa = OpticalSystemAnalysis(s, sysseq, name="Analysis")

print("collimated bundles")
(o, k1, E1) = osa.collimated_bundle(3, {"radius": 2,
                                        "raster": raster.MeridionalFan()},
                                    wave=standard_wavelength)
(o, k2, E2) = osa.collimated_bundle(3, {"radius": 2,
                                        "raster": raster.MeridionalFan(),
                                        "anglex": 15*degree},
                                    wave=standard_wavelength)
(o, k3, E3) = osa.collimated_bundle(3, {"radius": 2,
                                        "raster": raster.MeridionalFan(),
                                        "anglex": -15*degree},
                                    wave=standard_wavelength)


initialbundle1 = RayBundle(x0=o, k0=k1, Efield0=E1, wave=standard_wavelength)
initialbundle2 = RayBundle(x0=o, k0=k2, Efield0=E2, wave=standard_wavelength)
initialbundle3 = RayBundle(x0=o, k0=k3, Efield0=E3, wave=standard_wavelength)
print("performing sequential raytrace")
示例#3
0
(s, seq) = build_rotationally_symmetric_optical_system(
    [(0, 0, 0., None, "object", {}),
     (100., 0, 5, 1.5, "lens1front", {
         "is_stop": True
     }), (0., 0, 5, None, "lens1rear", {}),
     (0, 0, 196.228, None, "image", {})],
    name="os")

imsurf = s.elements["stdelem"].surfaces["image"]
imsurf.rootcoordinatesystem.tiltx.setvalue(alpha)
imsurf.rootcoordinatesystem.update()
objsurf = s.elements["stdelem"].surfaces["object"]
osa = OpticalSystemAnalysis(s, seq, name="Analysis")
(x01, k01, E01) = osa.collimated_bundle(11, {
    "radius": epd,
    "raster": MeridionalFan()
})
(x02, k02, E02) = osa.collimated_bundle(11, {
    "radius": epd,
    "raster": MeridionalFan(),
    "anglex": 1. * degree
})
mybundle1 = RayBundle(x01, k01, E01)
mybundle2 = RayBundle(x02, k02, E02)

raypaths1 = s.seqtrace(mybundle1, seq)
raypaths2 = s.seqtrace(mybundle2, seq)

obj_dx = 0.1
obj_dphi = 0.1 * degree
示例#4
0
alpha = 10.*degree

epd = 5.

(s, seq) = build_rotationally_symmetric_optical_system(
        [(0, 0, 0., None, "object", {}),
         (100., 0, 5, 1.5, "lens1front", {"is_stop": True}),
         (0., 0, 5, None, "lens1rear", {}),
         (0, 0, 196.228, None, "image", {})], name="os")

imsurf = s.elements["stdelem"].surfaces["image"]
imsurf.rootcoordinatesystem.tiltx.setvalue(alpha)
imsurf.rootcoordinatesystem.update()
objsurf = s.elements["stdelem"].surfaces["object"]
osa = OpticalSystemAnalysis(s, seq, name="Analysis")
(x01, k01, E01) = osa.collimated_bundle(11, {"radius": epd,
                                             "raster": MeridionalFan()})
(x02, k02, E02) = osa.collimated_bundle(11, {"radius": epd,
                                             "raster": MeridionalFan(),
                                             "anglex": 1.*degree})
(x03, k03, E03) = osa.collimated_bundle(11, {"radius": epd,
                                             "raster": MeridionalFan(),
                                             "anglex": -1.*degree})

mybundle1 = RayBundle(x01, k01, E01)
mybundle2 = RayBundle(x02, k02, E02)
mybundle3 = RayBundle(x03, k03, E03)

raypaths1 = s.seqtrace(mybundle1, seq)
raypaths2 = s.seqtrace(mybundle2, seq)
raypaths3 = s.seqtrace(mybundle3, seq)
示例#5
0
print(s.rootcoordinatesystem.pprint())

sysseq = [("HUD", [("object", {
    "is_stop": True
}), ("d1", {}), ("s1", {}), ("d1p", {}), ("d2", {}), ("s2", {
    "is_mirror": True
}), ("d2p", {}), ("d3", {}), ("s3", {
    "is_mirror": True
}), ("d3p", {}), ("d4", {}), ("s4", {}), ("d4p", {}), ("image", {})])]

osa = OpticalSystemAnalysis(s, sysseq, name="Analysis")

print("collimated bundles")
(o, k1, E1) = osa.collimated_bundle(3, {
    "radius": 2,
    "raster": raster.MeridionalFan()
},
                                    wave=standard_wavelength)
(o, k2, E2) = osa.collimated_bundle(3, {
    "radius": 2,
    "raster": raster.MeridionalFan(),
    "anglex": 15 * degree
},
                                    wave=standard_wavelength)
(o, k3, E3) = osa.collimated_bundle(3, {
    "radius": 2,
    "raster": raster.MeridionalFan(),
    "anglex": -15 * degree
},
                                    wave=standard_wavelength)