• Stars
    star
    250
  • Rank 162,397 (Top 4 %)
  • Language
    Python
  • License
    GNU Lesser Genera...
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python optics and lens design, raytracing

RayOpt

https://ci.appveyor.com/api/projects/status/6e97f8o94v7r5bpb/branch/master?svg=true https://codecov.io/github/jordens/rayopt/coverage.svg?branch=master

Introduction

Optics design (lenses, cavities, gaussian optics, lasers). Geometric, paraxial, and gaussian ray tracing.

Installation

Install like any usual Python package using pip, easy_install, or plain setup.py. Anaconda packages from three operating systems and three current Python versions are available through Anaconda. Install with:

conda install -c https://conda.anaconda.org/jordens/channel/ci rayopt

The distribution already contains all materials from http://refractiveindex.info/.

More materials

More materials and lenses catalogs can be obtained from the freely available versions of Oslo and Zemax, copied to catalog/ and then parsed using rayopt/library.py.

Zemax

More materials and lenses catalogs can be obtained from the freely available versions of Oslo and Zemax, copied to catalog/ and then parsed using rayopt/library.py (see there for details on where the files are expected)

Get Zemax optics studio. You can either install the software or unpack it with innoextract. Depending on your chosen method the paths have to be adapted:

$ python -m rayopt.library \
Users/$USER/My\ Documents/Zemax/Glasscat \
Users/$USER/My\ Documents/Zemax/Stockcat

OSLO

For OSLO, download and install OSLO.:

get and install http://www.lambdares.com/images/OSLO/OSLO662_EDU_Installer.exe
$ python -m rayopt.library \
Users/Public/Documents/OSLO66\ EDU/bin/lmo \
Users/Public/Documents/OSLO66\ EDU/bin/glc

Examples

Usage examples are at in their own repository as IPython Notebooks, specifically also the Tutorial.

Notes

Distance

The choice of prescription specification is a little different from most other lens design and ray tracing programs. RayOpt associates with an element (surface):

  • distance (or directional offset, measured in the global, unrotated coordinate system) of the element's apex relative to the previous element's apex.
  • orientation (x-y-z Euler angles in the rotating frame) with respect to the directional offset
  • element properties (type of element, curvature, aspheric and conic coefficients, focal length of an ideal element)
  • optionally, the material after the element (behind the surface)

Ray data are given at (ray intercepts) or just after (direction cosines, paraxial slopes) the respective element unless stated otherwise (e.g. incidence angles).

The choice of associating the "distance to" and not the "thickness after" with a surface has several advantages: shifts, offsets, tolerances can be implemented in a more straight forward manner, ray propagation becomes more natural and efficient (transfer, intercept, refraction), ray data at the surfaces' apex planes does not need to be tracked. The "thickness after" does not have much meaning in ray trace data as it can only be used later when tracing toward the next element and its direction is typically ill defined. Compared to most other programs the distance data is the thickness data shifted by one element towards the object.

Object and Image

Object and image are located at the first (index 0) and last (index -1) surface respectively. This naturally allows tracking their positions, material and shape data and supports curved objects and images naturally. Further data like pupils data are maintained in the two Conjugate s of the System.

Therefore, a minimal system of a single lens consists of fours surfaces: object, the two lens surfaces (one of which can be the aperture stop) and the image surface. The offset data of the first (object) surface does play a role in ray tracing but it can be useful as it locates the global coordinate system's origin. The material of the last (image) surface is used as it can cause incident rays to be evanescent at the image surface. This can also be compared to other programs where the thickness of the image surface is never relevant or the material in object space and the position of the lens has to be tracked somewhere else depending on the implementation.

Literature

  • Warren J. Smith: Modern Optical Engineering, McGraw-Hill 2000: concise and methods derivation from paraxial all the way to arbitrary ray tracing, with terminology explained and examples given
  • Michael Bass (ed): Mandbook of Optics I and II, OSA/McGraw-Hill 1995: physical foundations, broad on optics, comprehensive on theory, some info on numerics, some example designs
  • Daniel Malacara: Handbook of Optical Design, Marcel Dekker Inc. 1994: Introduction, Aberations, Examples, more info on terminology, especially in ray tracing programs and codes
  • Daniel Malacara: Geometrical and Instrumental Optics, Academic Press Inc. 1988: less info about algorithms and numerical methds, more examples and use cases, speciality lens designs
  • Robert R. Shannon: The Art and Science of Optical Design, Cambridge University Press 1997: many examples with Oslo and Zemax, not very thorough on numerical methods and foundations, good for material comparison with own codes.
  • Michael J. Kidger: Intermediate Optical Design, SPIE Press 2004: info on optimization techniques and algorithms, higher order aberrations, lots of example designs
  • Milton Laikin: Lens Design, CRC Press 2007: little bit of basic theory, lots of basic and paradigmatic example designs
  • Oslo Optics manual and reference
  • Zemax manual

More Repositories

1

minimq

Minimal no_std MQTT v5.0 client implementation
Rust
142
star
2

stabilizer

Firmware and software for the Sinara Stabilizer module with high speed, low latency ADC/DAC data processing and powerful DSP algorithms in between
Rust
104
star
3

bscan_spi_bitstreams

FPGA gateware and pre-build bitstreams that expose SPI over JTAG. The protocol is implemented (among others) by openocd.
Python
51
star
4

rayopt-notebooks

RayOpt Example IPython Notebooks
Jupyter Notebook
34
star
5

idsp

Rust DSP algorithms. Often integer math. no-std.
Rust
34
star
6

redpid

migen + misoc + redpitaya = digital servo
Verilog
34
star
7

miniconf

Rust serialize/deserialize/access reflection for trees (no_std, no alloc)
Rust
25
star
8

smoltcp-nal

An embedded-nal implementation for smoltcp
Rust
18
star
9

booster

Firmware for the Sinara Booster RF amplifier
Rust
13
star
10

phaser

Phaser AWG DSP design
Jupyter Notebook
10
star
11

thermostat-eem

Embedded software for the Thermostat-EEM multichannel temperature controller.
Rust
7
star
12

xilinx-bitstream

Python
6
star
13

picam

ARTIQ support for Princeton Instrumentsโ€™ PICam Library
Python
5
star
14

newfocus8742

Newport New Focus 8742 four channel open loop piezo controller
Python
5
star
15

grabber

Grabber gateware and prototyping: Camera Link Interface, Frame Grabber, ROI engines, RTIO Interface
Python
4
star
16

std-embedded-time

Rust
4
star
17

fastino

Gateware and software for Fastino (32 channel 2.5 MS/s 16 bit DAC for the Sinara ecosystem)
Python
4
star
18

minireq

Minimal MQTT-based request/response library
Rust
3
star
19

lasersdk-artiq

ARTIQ controller for TOPTICA Laser SDK
Python
3
star
20

urukul

CPLD gateware for the Sinara Urukul module
Python
2
star
21

kasli-i2c

Utilities to access the Sinara I2C tree via Kasli, including Sinara EEPROM deployment, firmware flashing for Fastino, Banker
Python
2
star
22

thermostat

Sinara Thermostat firmware. Currently a potentially outdated mirror of http://git.m-labs.hk/M-Labs/thermostat
Rust
2
star
23

queenmod

MTS/WMS prototype/testbed with STM32 and Rust
Rust
2
star
24

andorpy

Andor EMCCD driver and camera app (ATMCD32)
Python
2
star
25

miqro-sim

MIQRO pulse generator simulator
Python
2
star
26

stabilizer-stream

Host-side stream utilities for interacting with Stabilizer's livestream
Rust
2
star
27

quartiq.github.io

HTML
2
star
28

ai9

CLI tool using Bluetooth and Python to control the Signalfire AI-9 Fiber Fusion Splicer
Python
1
star
29

crosstrait

Cast from `dyn Any` to other trait objects, with no_std, no alloc support
Rust
1
star
30

ai-artiq.github.io

HTML
1
star
31

artiq-docker

ARTIQ docker recipes: https://hub.docker.com/r/quartiq/artiq/
Nix
1
star
32

highfinesse-net

Python
1
star
33

artiq-setup

Python
1
star
34

pounder-bringup

Provides a minimal application to test Pounder hardware support on Stabilizer: **deprecated legacy code, use https://github.com/quartiq/stabilizer**
Rust
1
star
35

awrite

awrite!(): the async write!()/format!() scratch buffer
Rust
1
star
36

etf-trace

Capture STM32H7 trace data using the internal embedded trace FIFO
Rust
1
star
37

wlm

Python wrapper and network server/clients for Wavemeter API
Python
1
star