Package: otk
otk - optics toolkitToolkit for doing optics in PythonFeatures include3D engine based onsphere tracingfor simple robust implicit surfaces and constructive solid geometry,nonsequential ray tracing engine,programmatic lookup of fullRefractiveIndex.INFOdatabase,import of lenses and glass catalogs from Zemax.InstallationInstallation methods include:Clone repository and interact with it usingPoetrye.g.poetry run view-zmx <zemax-file>orpoetry shell.Install from package repository (e.g. PyPi) with pip:pip install otk.Development mode with [:poetry add <path-to-local-repo>.From package repository (e.g. PyPi) with Poetry:poetry add otk.Getting startedCheck out the scripts inexamples.View one of the lenses indesignswith the command line toolview-zmx.Documentation(Yep, this is it at the moment.)Command line toolsview-zmx <zemaxfile>launches a viewer of a Zemax lens.Packagesotk.sdb- Geometry library based on signed distance bounds.otk.rt1- First attempt at ray tracing package. Superseded by otk.rt2.otk.rt2- Ray tracing package with flexible geometry based on otk.sdb. See alsootk.rt2_scalar_qt.otk.asbp- Angular spectrum beam propagation.otk.abcd- 1D ray transfer matrix ("ABCD matrices") tools.otk.rtm4- abstractions for 1D ray transfer matrices, building uponotk.abcd.otk.pgb- parabasal Gaussian routines for doing wave optical calculations with ray tracing results. Builds uponotk.rt1.otk.h4t- homogeneous 4x4 transformation matrices.otk.paraxial- basic paraxial optics calculations.otk.math- various optics-specific math functions.otk.pov- tools for generating POV-Ray scenes of optical setups.otk.pov- for calculating properties of prisms.otk.qt- Qt-related utilitiesotk.ri- refractive index tools.otk.trains- axially symmetric optical systemsotk.v3- operations on homogeneous vectors in 2Dotk.v4- operations on homogeneous vectors in 3Dotk.v4b- broadcasting operations on homogeneous vectors in 3Dotk.zemax- reading Zemax filesRoadmapImport of wavelengths, field, and stop from Zemax.Variables to allow rapid changes for animation and optimization.Cool demos: rainbow, lighthouse.Improve physical & wave optics.Upgrade parabasal Gaussians to use rt2.Upgrade asbp to use rt2.Demos e.g. spherical aberration acting on Gaussian beam, Arago spot.Folder contentsotk- the Python package itself. Package data includesotk/properties- material properties databases.otk/notes- miscellaneous notes including derivations.examples- example scripts.Package managementotk usesPoetryfor package management. This means that dependencies, version, entry points etc are all defined inpyproject.toml.UsingPyPi test instanceTo setup, add test.pypi.org to your Poetry configuration withpoetry config repositories.test https://test.pypi.org/legacy/. Note thetrailing slash.To publish (afterpoetry build),poetry publish -r test.To test that it installs properly,create and activate a virtual environment, andperinstructions,pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple otk.However, I was unable to re-upload the same version (i.e. to correct a mistake) to test.pypi.org (even after logging in to the website and deleting the release).TestingTest framework ispytestandtox.ContributingPlease do.