.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/utils/create_sellmeier_file.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_utils_create_sellmeier_file.py: Example: Create a Custom Sellmeier YAML File ============================================ This example demonstrates how to create a custom Sellmeier YAML file using the `create_sellmeier_file` function from the `PyOptik.utils` module. .. GENERATED FROM PYTHON SOURCE LINES 10-30 .. image-sg:: /gallery/utils/images/sphx_glr_create_sellmeier_file_001.png :alt: Refractive Index vs. Wavelength: [example_sellmeier] :srcset: /gallery/utils/images/sphx_glr_create_sellmeier_file_001.png :class: sphx-glr-single-img .. code-block:: Python from PyOptik import MaterialBank # Define the file properties filename = 'example_sellmeier' coefficients = [1.86e-06, 1.31e-08, -1.37e-11, 4.34e-07, 6.27e-1, 0.17] formula_type = 1 # Call the function to create the file MaterialBank.create_sellmeier_file( filename=filename, coefficients=coefficients, formula_type=formula_type, wavelength_range=(0.2, 2.0), reference="Sample Reference", comments="This is a sample Sellmeier file created for demonstration purposes. " ) m = MaterialBank.get(filename) m.plot() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.304 seconds) .. _sphx_glr_download_gallery_utils_create_sellmeier_file.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: create_sellmeier_file.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: create_sellmeier_file.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_