def initDemoSystem(self): s = OpticalSystem() lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=2.0), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=3.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf3", decz=5.0, tiltx=0.0*math.pi/180.0), 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=1/1.479)) image = Surface(lc8) elem = OpticalElement(lc0, label="lenssystem") glass = material_isotropic.ConstantIndexGlass(lc0, n=1.7) glass2 = material_isotropic.ConstantIndexGlass(lc0, n=1.5) elem.addMaterial("glass", glass) elem.addMaterial("glass2", glass2) elem.addSurface("object", objectsurf, (None, None)) elem.addSurface("surf1", surf1, (None, "glass")) elem.addSurface("surf2", surf2, ("glass", None)) elem.addSurface("surf3", surf3, (None, "glass")) elem.addSurface("surf4", surf4, ("glass", None)) elem.addSurface("stop", stopsurf, (None, None)) elem.addSurface("surf6", surf6, (None, "glass2")) elem.addSurface("surf7", surf7, ("glass2", None)) elem.addSurface("image", image, (None, None)) s.addElement("lenssys", elem) return s
from pyrateoptics.raytracer.aperture import CircularAperture from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics.raytracer.analysis.optical_system_analysis import\ OpticalSystemAnalysis from pyrateoptics import draw logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem(name='os') lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="stop", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=-1.048), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=4.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf3", decz=2.5), refname=lc2.name) lc4 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=97.2), refname=lc3.name) stopsurf = Surface(lc0, name="stopsurf") frontsurf = Surface(lc1, name="frontsurf", shape=Conic(lc1, curv=1. / 62.8, name='conic1'), aperture=CircularAperture(lc1, maxradius=12.7)) cementsurf = Surface(lc2,
from pyrateoptics.raytracer.aperture import CircularAperture from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics.analysis.optical_system_analysis import OpticalSystemAnalysis from pyrateoptics import draw logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem(name='os') lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="stop", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=-1.048), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=4.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf3", decz=2.5), refname=lc2.name) lc4 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=97.2), refname=lc3.name) stopsurf = Surface(lc0, name="stopsurf") frontsurf = Surface(lc1, name="frontsurf", shape=Conic(lc1, curv=1./62.8, name='conic1'), aperture=CircularAperture(lc1, maxradius=12.7)) cementsurf = Surface(lc2, name="cementsurf", shape=Conic(lc2, curv=-1./45.7, name='conic2'),
import math import logging logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 wave_red = 0.700e-3 wave_blue = 0.470e-3 # definition of optical system s = OpticalSystem() deg = math.pi/180. lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="stop", decz=0.0), refname=s.rootcoordinatesystem.name) lccomprism = s.addLocalCoordinateSystem(LocalCoordinates(name="prismcenter", decz=50.0), refname=lc0.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=-10.0, tiltx=30.*deg), refname=lccomprism.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=10.0, tiltx=-30.*deg), refname=lccomprism.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=50.0), refname=lccomprism.name) stopsurf = Surface(lc0) frontsurf = Surface(lc1, shape=surfShape.Conic(lc1, curv=0), apert=CircularAperture(lc1, 20.0)) rearsurf = Surface(lc2, shape=surfShape.Conic(lc2, curv=0), apert=CircularAperture(lc2, 20.0)) image = Surface(lc3) elem = OpticalElement(lc0, name="prism")
from pyrateoptics.raytracer.surface import Surface from pyrateoptics.raytracer.optical_system import OpticalSystem from pyrateoptics.raytracer.aperture import CircularAperture from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics import raytrace, draw logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem() lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="obj", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=10.0, tiltx=5. * math.pi / 180.0), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=20.0, tiltx=10. * math.pi / 180.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=10.0), refname=lc2.name) stopsurf = Surface(lc0) surf1 = Surface(lc1, shape=Conic(lc1, curv=1. / 24.0), aperture=CircularAperture(lc1, maxradius=5.0))
from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics.raytracer.globalconstants import degree from pyrateoptics import draw, raytrace logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem(name='os') lc0 = s.addLocalCoordinateSystem( LocalCoordinates(name="stop", decz=1.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf1", decz=10.0), refname=lc0.name) lc2 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf2", decz=5.0, tiltx=10*math.pi/180.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem( LocalCoordinates(name="image", decz=-5.0, tiltx=-10*math.pi/180.0), refname=lc2.name) stopsurf = Surface(lc0) frontsurf = Surface(lc1, shape=Conic(lc1, curv=0), aperture=CircularAperture(lc1, maxradius=10.0)) rearsurf = Surface(lc2, shape=Conic(lc2, curv=0),
from pyrateoptics.raytracer.surface import Surface from pyrateoptics.raytracer.optical_system import OpticalSystem from pyrateoptics.raytracer.ray import RayBundle from pyrateoptics.raytracer.aperture import CircularAperture from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics.raytracer.globalconstants import degree from pyrateoptics import draw, raytrace wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem() lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="stop", decz=1.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=10.0), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=5.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=10.0), refname=lc2.name) stopsurf = Surface(lc0) frontsurf = Surface(lc1, shape=surfShape.Conic(lc1, curv=0), apert=CircularAperture(lc1, 10.0)) rearsurf = Surface(lc2, shape=surfShape.Conic(lc2, curv=0), apert=CircularAperture(lc3, 10.0)) image = Surface(lc3)
from pyrateoptics import raytrace, draw logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 wave_red = 0.700e-3 wave_blue = 0.470e-3 # definition of optical system s = OpticalSystem() dropletradius = 0.1 lc0 = s.addLocalCoordinateSystem( LocalCoordinates(name="stop", decz=0.0), refname=s.rootcoordinatesystem.name) lccomprism = s.addLocalCoordinateSystem( LocalCoordinates(name="dropletcenter", decz=2.*dropletradius), refname=lc0.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=-dropletradius), refname=lccomprism.name) # objectDist lc2 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf2", decz=dropletradius), refname=lccomprism.name) lc3 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf3", decz=0), refname=lccomprism.name) lc4 = s.addLocalCoordinateSystem(
from pyrateoptics.raytracer.globalconstants import canonical_ey, degree from pyrateoptics.analysis.optical_system_analysis import OpticalSystemAnalysis from pyrateoptics.analysis.surface_shape_analysis import ShapeAnalysis from pyrateoptics.sampling2d.raster import RandomGrid wavelength = standard_wavelength logging.basicConfig(level=logging.DEBUG) # definition of optical system s = OpticalSystem() # objectDistance = 2.0 lc0 = s.addLocalCoordinateSystem( LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf1", decz=2.0), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf2", decz=3.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf3", 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)
from pyrateoptics.raytracer.optical_system import OpticalSystem from pyrateoptics.raytracer.aperture import CircularAperture from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics.raytracer.globalconstants import degree from pyrateoptics import draw, raytrace logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem(name='os') lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="stop", decz=1.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=10.0), refname=lc0.name) lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=5.0, tiltx=10 * math.pi / 180.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=-5.0, tiltx=-10 * math.pi / 180.0), refname=lc2.name) stopsurf = Surface(lc0) frontsurf = Surface(lc1, shape=Conic(lc1, curv=0), aperture=CircularAperture(lc1, maxradius=10.0))
from pyrateoptics import draw from pyrateoptics.analysis.optical_system_analysis import OpticalSystemAnalysis from pyrateoptics.raytracer.helpers import build_pilotbundle_complex # definition of optical system # Design: US patent no. 5701202 A, inventor: Koichi Takahashi # and also: Bo Chen, Alois M. Herkommer, Opt. Express 24, 26999 (2016) logging.basicConfig(level=logging.INFO) s = OpticalSystem() lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) air = ConstantIndexGlass(lc0, 1.0) glass = ConstantIndexGlass(lc0, 1.492) s.material_background = air si = -1. lcD1 = s.addLocalCoordinateSystem(LocalCoordinates(name="D1", decz=30.002), refname=lc0.name) lcS1 = s.addLocalCoordinateSystem(LocalCoordinates(name="S1", decy=-24.028, decz=26.360, tiltx=-si*14.7*degree, tiltThenDecenter=False), refname=lc0.name) lcD1prime = s.addLocalCoordinateSystem(LocalCoordinates(name="D1prime", decy=0., decz=30.002, tiltx=-si*1.066*degree, tiltThenDecenter=False), refname=lc0.name) lcD2 = s.addLocalCoordinateSystem(LocalCoordinates(name="D2", decy=-0.251, decz=43.485, tiltx=-si*1.066*degree, tiltThenDecenter=False), refname=lc0.name) lcS2 = s.addLocalCoordinateSystem(LocalCoordinates(name="S2", decy=19.109, decz=33.339, tiltx=si*36.660*degree, tiltThenDecenter=False), refname=lc0.name) lcD2prime = s.addLocalCoordinateSystem(LocalCoordinates(name="D2prime", decy=-0.251, decz=43.485, tiltx=si*38.376*degree, tiltThenDecenter=False), refname=lc0.name) lcD3 = s.addLocalCoordinateSystem(LocalCoordinates(name="D3", decy=-11.858, decz=28.827, tiltx=si*38.376*degree, tiltThenDecenter=False), refname=lc0.name) lcS3 = s.addLocalCoordinateSystem(LocalCoordinates(name="S3", decy=-24.028, decz=26.360, tiltx=-si*14.7*degree, tiltThenDecenter=False), refname=lc0.name)
from pyrateoptics.raytracer.globalconstants import canonical_ey, degree from pyrateoptics.analysis.optical_system_analysis import OpticalSystemAnalysis from pyrateoptics.analysis.surfShape_analysis import ShapeAnalysis from pyrateoptics.sampling2d.raster import RandomGrid from pyrateoptics.analysis.optical_system_analysis import OpticalSystemAnalysis wavelength = standard_wavelength logging.basicConfig(level=logging.DEBUG) # definition of optical system s = OpticalSystem() # objectDistance = 2.0 lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=2.0), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=3.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf3", 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),
from pyrateoptics.raytracer.globalconstants import canonical_ey, degree, standard_wavelength import math import pyrateoptics.raytracer.helpers # definition of optical system # Design: US patent no. 5701202 A, inventor: Koichi Takahashi # and also: Bo Chen, Alois M. Herkommer, Opt. Express 24, 26999 (2016) logging.basicConfig(level=logging.INFO) s = OpticalSystem() lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) air = ConstantIndexGlass(lc0, 1.0) glass = ConstantIndexGlass(lc0, 1.492) s.material_background = air si = -1. lcD1 = s.addLocalCoordinateSystem(LocalCoordinates(name="D1", decz=30.002), refname=lc0.name) lcS1 = s.addLocalCoordinateSystem(LocalCoordinates(name="S1", decy=-24.028, decz=26.360, tiltx=-si * 14.7 * degree, tiltThenDecenter=False), refname=lc0.name)
from pyrateoptics.raytracer.globalconstants import degree from pyrateoptics import raytrace, draw logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 wave_red = 0.700e-3 wave_blue = 0.470e-3 # definition of optical system s = OpticalSystem() dropletradius = 0.1 lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="stop", decz=0.0), refname=s.rootcoordinatesystem.name) lccomprism = s.addLocalCoordinateSystem(LocalCoordinates(name="dropletcenter", decz=2. * dropletradius), refname=lc0.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf1", decz=-dropletradius), refname=lccomprism.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf2", decz=dropletradius), refname=lccomprism.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="surf3", decz=0), refname=lccomprism.name) lc4 = s.addLocalCoordinateSystem(LocalCoordinates(name="image", decz=-2. * dropletradius),
wavelength = 0.5876e-3 rnd_data1 = np.random.random((3, 3)) # np.eye(3) rnd_data2 = np.random.random((3, 3)) # np.zeros((3, 3))# lc = LocalCoordinates("1") myeps = np.eye(3) + 0.1*rnd_data1 + 0.01*complex(0, 1)*rnd_data2 # aggressive complex choice of myeps # myeps = np.eye(3) + 0.01*np.random.random((3, 3)) crystal = AnisotropicMaterial(lc, myeps) # definition of optical system s = OpticalSystem(matbackground=crystal) lc0 = s.addLocalCoordinateSystem( LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem( LocalCoordinates(name="m1", decz=50.0, tiltx=-math.pi/8), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem( LocalCoordinates(name="m2_stop", decz=-50.0, decy=-20, tiltx=math.pi/16), refname=lc1.name) lc3 = s.addLocalCoordinateSystem( LocalCoordinates(name="m3", decz=50.0, decy=-30, tiltx=3*math.pi/32), refname=lc2.name) lc4 = s.addLocalCoordinateSystem( LocalCoordinates(name="image1", decz=-50, decy=-15, tiltx=-math.pi/16), refname=lc3.name) lc5 = s.addLocalCoordinateSystem( LocalCoordinates(name="oapara", decz=-100, decy=-35), refname=lc4.name)
logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 rnd_data1 = np.random.random((3, 3)) # np.eye(3) rnd_data2 = np.random.random((3, 3)) # np.zeros((3, 3))# lc = LocalCoordinates("1") myeps = np.eye(3) + 0.1 * rnd_data1 + 0.01 * complex(0, 1) * rnd_data2 # aggressive complex choice of myeps # myeps = np.eye(3) + 0.01*np.random.random((3, 3)) crystal = AnisotropicMaterial(lc, myeps) # definition of optical system s = OpticalSystem(matbackground=crystal) lc0 = s.addLocalCoordinateSystem(LocalCoordinates(name="object", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem(LocalCoordinates(name="m1", decz=50.0, tiltx=-math.pi / 8), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem(LocalCoordinates(name="m2_stop", decz=-50.0, decy=-20, tiltx=math.pi / 16), refname=lc1.name) lc3 = s.addLocalCoordinateSystem(LocalCoordinates(name="m3", decz=50.0, decy=-30, tiltx=3 * math.pi / 32), refname=lc2.name) lc4 = s.addLocalCoordinateSystem(LocalCoordinates(name="image1",
from pyrateoptics.raytracer.optical_system import OpticalSystem from pyrateoptics.raytracer.aperture import CircularAperture from pyrateoptics.raytracer.localcoordinates import LocalCoordinates from pyrateoptics import raytrace, draw logging.basicConfig(level=logging.DEBUG) wavelength = 0.5876e-3 # definition of optical system s = OpticalSystem() lc0 = s.addLocalCoordinateSystem( LocalCoordinates(name="obj", decz=0.0), refname=s.rootcoordinatesystem.name) lc1 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf1", decz=10.0, tiltx=5.*math.pi/180.0), refname=lc0.name) # objectDist lc2 = s.addLocalCoordinateSystem( LocalCoordinates(name="surf2", decz=20.0, tiltx=10.*math.pi/180.0), refname=lc1.name) lc3 = s.addLocalCoordinateSystem( LocalCoordinates(name="image", decz=10.0), refname=lc2.name) stopsurf = Surface(lc0) surf1 = Surface(lc1, shape=Conic(lc1, curv=1./24.0), aperture=CircularAperture(lc1, maxradius=5.0)) surf2 = Surface(lc2, shape=Conic(lc2, curv=-1./24.0),