.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/thin_films/plot_antireflection_coating.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_thin_films_plot_antireflection_coating.py: Quarter-wave antireflection coating =================================== Design the ideal single-layer coating for an air-to-glass interface and compare its spectrum with the uncoated substrate. .. GENERATED FROM PYTHON SOURCE LINES 10-34 .. code-block:: Python import matplotlib.pyplot as plt import numpy from TypedUnit import ureg from PyOptik import ThinFilmLayer, thin_film_stack design_wavelength = 550 * ureg.nanometer substrate_index = 1.52 coating_index = numpy.sqrt(substrate_index) coating_thickness = design_wavelength / (4 * coating_index) wavelengths = numpy.linspace(350, 900, 600) * ureg.nanometer uncoated = thin_film_stack( wavelengths, [], substrate_index=substrate_index, ) coated = thin_film_stack( wavelengths, [ThinFilmLayer(coating_index, coating_thickness)], substrate_index=substrate_index, ) .. GENERATED FROM PYTHON SOURCE LINES 35-47 .. code-block:: Python figure, axis = plt.subplots(layout="constrained") axis.plot(wavelengths.magnitude, 100 * uncoated.reflectance, label="Uncoated glass") axis.plot(wavelengths.magnitude, 100 * coated.reflectance, label="Quarter-wave coating") axis.axvline(design_wavelength.magnitude, color="black", linestyle="--", alpha=0.6) axis.set( xlabel="Wavelength [nm]", ylabel="Reflectance [%]", title="Single-layer antireflection coating", ) axis.grid(alpha=0.25) axis.legend() plt.show() .. image-sg:: /gallery/thin_films/images/sphx_glr_plot_antireflection_coating_001.png :alt: Single-layer antireflection coating :srcset: /gallery/thin_films/images/sphx_glr_plot_antireflection_coating_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.343 seconds) .. _sphx_glr_download_gallery_thin_films_plot_antireflection_coating.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_antireflection_coating.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_antireflection_coating.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_