Example #1
0
lc8 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="image", decz=19.0),
                                 refname=lc7.name)

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

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

glass = ConstantIndexGlass.p(lc0, n=1.7)
glass2 = ConstantIndexGlass.p(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))
Example #2
0
elem = OpticalElement.p(lc0, name="droplet")


database_basepath = "refractiveindex.info-database/database"
shelf = "3d"
book = "liquids"
page = "water"

try:
    gcat = GlassCatalog(database_basepath)
    waterdict = gcat.get_material_dict(shelf, book, page)
    water = CatalogMaterial.p(lc0, waterdict, name="water (catalogue)")
except KeyError:
    logging.warning("refractive index database not found. please download it\
                     and symlink\nto it in your local pyrate directory")
    water = ConstantIndexGlass.p(lc0, n=1.336, name="water (failsafe)")

logging.info("wavelength %f, index %f" %
             (wave_red, water.get_optical_index(None, wave_red).real))
logging.info("wavelength %f, index %f" %
             (wave_blue, water.get_optical_index(None, wave_blue).real))

elem.addMaterial("water", water)

elem.addSurface("stop", stopsurf, (None, None))
elem.addSurface("surf1", frontsurf, (None, "water"))
elem.addSurface("surf2", rearsurf, ("water", "water"))
elem.addSurface("surf4", frontsurf, ("water", None))
elem.addSurface("image", image, (None, None))

s.addElement("droplet", elem)
Example #3
0
file_to_read = parsed.file
enpd = parsed.epd
num_rays = parsed.numrays
bundletype = parsed.bundletype
anglex = parsed.anglex
reverse = parsed.reverse
surfaces_do_not_draw = parsed.do_not_draw_surfaces.split(",")
raybundles_do_not_draw = [
    int(s) for s in parsed.do_not_draw_raybundles.split(",") if s != ''
]

p = ZMXParser(file_to_read, name='ZMXParser')
lctmp = LocalCoordinates.p("tmp")

matdict = {
    "BK7": ConstantIndexGlass.p(lctmp, 1.5168),
    "LAFN21": ConstantIndexGlass.p(lctmp, 1.788),
    "SF53": ConstantIndexGlass.p(lctmp, 1.72)
}

(s, seq) = p.create_optical_system(matdict)

if s is None:
    sys.exit()

initialbundles_dict = p.create_initial_bundle()

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

ray_paths = []
Example #4
0
            LocalCoordinates.p(name="image", decz=97.2), refname=lc3.name)


stopsurf = Surface.p(lc0)
frontsurf = Surface.p(lc1, shape=Conic.p(lc1, curv=1./62.8),
                    aperture=CircularAperture.p(lc1, maxradius=12.7))
cementsurf = Surface.p(lc2, shape=Conic.p(lc2, curv=-1./45.7),
                     aperture=CircularAperture.p(lc2, maxradius=12.7))
rearsurf = Surface.p(lc3, shape=Conic.p(lc3, curv=-1./128.2),
                   aperture=CircularAperture.p(lc3, maxradius=12.7))
image = Surface.p(lc4)


elem = OpticalElement.p(lc0, name="thorlabs_AC_254-100-A")

bk7 = ConstantIndexGlass.p(lc1, n=1.5168)
sf5 = ConstantIndexGlass.p(lc2, n=1.6727)

elem.addMaterial("BK7", bk7)
elem.addMaterial("SF5", sf5)

elem.addSurface("stop", stopsurf, (None, None))
elem.addSurface("front", frontsurf, (None, "BK7"))
elem.addSurface("cement", cementsurf, ("BK7", "SF5"))
elem.addSurface("rear", rearsurf, ("SF5", None))
elem.addSurface("image", image, (None, None))

s.addElement("AC254-100", elem)

sysseq = [("AC254-100",
           [
Example #5
0
    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.p()

lc0 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="object", decz=0.0),
                                 refname=s.rootcoordinatesystem.name)

air = ConstantIndexGlass.p(lc0, 1.0)
glass = ConstantIndexGlass.p(lc0, 1.492)
s.material_background = air

si = -1.

lcD1 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="D1", decz=30.002),
                                  refname=lc0.name)
lcS1 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="S1",
                                                     decy=-24.028,
                                                     decz=26.360,
                                                     tiltx=-si * 14.7 * degree,
                                                     tiltThenDecenter=False),
                                  refname=lc0.name)
lcD1prime = s.addLocalCoordinateSystem(LocalCoordinates.p(
    name="D1prime",
Example #6
0
 def initConstantIndex(self, lc=None, index=1.0):
     self.__obj.addProperty("App::PropertyFloat", "index", "Material",
                            "constant index").index = index
     self.__obj.matclass = ConstantIndexGlass.p(lc, index)
Example #7
0
wavelength = 0.5876e-3

# definition of optical system

# v = np.ones(3)# + 0.001*np.random.random(3)
# myeps = np.diag(v)


s = OpticalSystem.p()

lc0 = s.addLocalCoordinateSystem(LocalCoordinates.p(name="object", decz=0.0),
                                 refname=s.rootcoordinatesystem.name)

# air = AnisotropicMaterial(lc0, myeps)  # tests for anisotropic mirror
air = ConstantIndexGlass.p(lc0, 1.0)
s.material_background = air

lc1 = s.addLocalCoordinateSystem(
            LocalCoordinates.p(name="m1", decz=50.0, tiltx=-math.pi/8),
            refname=lc0.name)  # objectDist
lc2 = s.addLocalCoordinateSystem(
            LocalCoordinates.p(name="m2_stop",
                               decz=-50.0,
                               decy=-20,
                               tiltx=math.pi/16),
            refname=lc1.name)
lc3 = s.addLocalCoordinateSystem(
            LocalCoordinates.p(name="m3", decz=50.0, decy=-30,
                               tiltx=3*math.pi/32), refname=lc2.name)
lc4 = s.addLocalCoordinateSystem(