Note
Go to the end to download the full example code
Plot the Refractive Index of Optical Material: BK7#
This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material BK7 glass over a specified range of wavelengths.
![Refractive Index vs. Wavelength: [BK7]](../../_images/sphx_glr_plot_bk7_001.png)
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/PyOptik/material/base_class.py:60: UserWarning: Wavelength range goes from 5.0 micrometer to 5.0 micrometer which is outside the allowable range of 309.99999999999994 nanometer to 2.5 micrometer µm. [Material: BK7]
warnings.warn(
<Figure size 640x480 with 1 Axes>
from PyOptik import MaterialBank
from TypedUnit import ureg
# Initialize the material with the Sellmeier model
material = MaterialBank.BK7
# Calculate refractive index at specific wavelengths
RI = material.compute_refractive_index(wavelength=[5_000] * ureg.nanometer)
# Display calculated refractive indices at sample wavelengths
material.plot()
Total running time of the script: (0 minutes 0.203 seconds)