Skip to main content
Optable Logo

Optable — Ray tracing on an Optical table

A simple ray tracing and visualization tool for freespace optics.

dedicated to phys students working with freespace optics.

Python Version License GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests

For documentation see online documentation on Read The Docs.

For examples of use check Examples.

Documentation Status PyPI version

Installation

pip install optical_table

or install from source:

git clone https://github.com/tim4431/optable.git
cd optable
pip install -e .

Example

Gaussian beam tracing

import numpy as np, matplotlib.pyplot as plt
from optable import *

wl = 780e-9
w0 = 10e-6

r0 = [
    Ray([-10, 0, 0], [1, 0, 0], wavelength=wl, w0=w0),
    Ray([-10, 2, 0], [1, 0, 0], wavelength=wl, w0=w0),
    Ray([-10, 4, 0], [1, 0, 0], wavelength=wl, w0=w0),
    Ray([-10, 6, 0], [1, 0, 0], wavelength=wl, w0=w0),
    Ray([-10, 9, 0], [1, 0, 0], wavelength=wl, w0=w0),
    Ray([-10, 21, 0], [1, 0, 0], wavelength=wl, w0=w0).RotZ(-np.pi / 4),
]

m0 = Mirror([0, 0, 0]).RotZ(np.pi / 6)
l0 = Lens([0, 2, 0], radius=0.8, focal_length=5)
l1 = Lens([0, 4, 0], radius=0.8, focal_length=10)
l2 = Lens([0, 6.5, 0], radius=0.8, focal_length=10)
slab0 = GlassSlab([0, 9, 0], n1=1, n2=2, thickness=5)
m1 = Mirror([0, 11, 0]).RotZ(-np.pi / 2)

rays = r0
components = [m0, l0, l1, l2, slab0, m1]

table = OpticalTable()
table.add_components(components)
table.ray_tracing(rays)

fig, ax0 = plt.subplots(1, 1, figsize=(12, 6))
table.render(
    ax0,
    type="Z",
    gaussian_beam=True,
    spot_size_scale=1,
    roi=[-15, 30, -10, 20],
)
plt.show()

Result gaussian_beam

Metadata

Release files for optical-table 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optical-table 1.0.2
File Size Uploaded Provenance
optical_table-1.0.2.tar.gz 44.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for optical-table 1.0.2
File Interpreter ABI Platform
optical_table-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 91.5 kB

Release files / optical_table-1.0.2.tar.gz

Download URL optical_table-1.0.2.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4a5a7b4bf51a093e53c515226b7e6c4979363958e1e9d0b2bafde6a7fee5d1ce
BLAKE2b-256 checksum
How to use checksums
aa8e83eca70c66a77fdba519c0cab792a13e9e0d808434c394659c56b4a6e56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

Release files / optical_table-1.0.2-py3-none-any.whl

Download URL optical_table-1.0.2-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c69aae500551050eb869d0b5fcd5368a08c3aa2ed09b929f67391d0052609cf5
BLAKE2b-256 checksum
How to use checksums
bec6d14a7f3f59cf7d2547195865857df516eff672cfeb75cfed26cb94a3a05e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

Security for optical-table 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for optical_table-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page