PyOptik documentation#

PyOptik is a unit-aware Python toolkit for optical material data, dispersion, Fresnel interfaces, and coherent thin-film stacks. It combines a searchable RefractiveIndex.INFO catalog with APIs for measured and fitted materials.

Start with a plot#

Each tutorial includes a complete script and an Open in Colab notebook.

Getting started

Install the package, download the catalog, and calculate refractive index with explicit wavelength units.

Example gallery

Follow executable examples for dispersion, custom data, interfaces, coatings, pulse properties, and catalog search.

Interfaces and thin films

Calculate Fresnel coefficients and coherent multilayer spectra for s and p polarization.

Custom materials

Construct materials from arrays, CSV files, or formula coefficients and export validated YAML.

Quick example#

from TypedUnit import ureg
from PyOptik import material, fresnel_coefficients

glass = material("N-BK7")

wavelength = 550 * ureg.nanometer
index = glass.compute_refractive_index(wavelength)
interface = fresnel_coefficients(1.0, glass, wavelength=wavelength)

print(index)
print(interface.reflectance)