PyOptik 1.6.4.post0__tar.gz → 1.7.0.post0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.github/workflows/deploy_anaconda.yml +1 -1
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PKG-INFO +11 -6
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/__init__.py +3 -2
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/_version.py +2 -2
- pyoptik-1.7.0.post0/PyOptik/material/__init__.py +4 -0
- pyoptik-1.7.0.post0/PyOptik/material/base_class.py +76 -0
- {pyoptik-1.6.4.post0/PyOptik → pyoptik-1.7.0.post0/PyOptik/material}/material.py +14 -8
- pyoptik-1.7.0.post0/PyOptik/material/sellmeier_class.py +188 -0
- pyoptik-1.7.0.post0/PyOptik/material/tabulated_class.py +165 -0
- pyoptik-1.7.0.post0/PyOptik/units.py +9 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/utils.py +48 -25
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik.egg-info/PKG-INFO +11 -6
- pyoptik-1.7.0.post0/PyOptik.egg-info/SOURCES.txt +147 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik.egg-info/requires.txt +1 -1
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/README.rst +9 -4
- pyoptik-1.7.0.post0/docs/examples/README.rst +23 -0
- pyoptik-1.7.0.post0/docs/examples/sellmeier/README.rst +16 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/examples/sellmeier}/plot_bk7.py +3 -2
- pyoptik-1.7.0.post0/docs/examples/tabulated/README.rst +13 -0
- pyoptik-1.7.0.post0/docs/examples/utils/README.rst +6 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/examples/utils}/create_sellmeier_file.py +1 -1
- pyoptik-1.7.0.post0/docs/source/code.rst +63 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/source/conf.py +17 -6
- pyoptik-1.7.0.post0/docs/source/gallery/index.rst +12 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/images/sphx_glr_plot_bk7_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/images/sphx_glr_plot_silica_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/images/sphx_glr_plot_water_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/images/thumb/sphx_glr_plot_bk7_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/images/thumb/sphx_glr_plot_silica_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/images/thumb/sphx_glr_plot_water_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/index.rst +120 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_bk7.ipynb +1 -1
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_bk7.py +3 -2
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/plot_bk7.py.md5 +1 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_bk7.rst +12 -11
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/plot_bk7_codeobj.pickle +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_silica.rst +8 -8
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/plot_silica_codeobj.pickle +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_water.rst +8 -8
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/plot_water_codeobj.pickle +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/sellmeier/sg_execution_times.rst +17 -0
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/images/sphx_glr_plot_sf5_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/images/sphx_glr_plot_silver_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/images/thumb/sphx_glr_plot_sf5_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/images/thumb/sphx_glr_plot_silver_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/index.rst +100 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_sf5.rst +8 -8
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/plot_sf5_codeobj.pickle +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_silver.rst +8 -8
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/plot_silver_codeobj.pickle +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/tabulated/sg_execution_times.rst +15 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_sellmeier_file.rst +10 -12
- pyoptik-1.7.0.post0/docs/source/gallery/utils/create_sellmeier_file_codeobj.pickle +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_tabulated_file.rst +8 -8
- pyoptik-1.7.0.post0/docs/source/gallery/utils/create_tabulated_file_codeobj.pickle +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/download_yml_file.rst +8 -8
- pyoptik-1.7.0.post0/docs/source/gallery/utils/download_yml_file_codeobj.pickle +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/images/sphx_glr_create_sellmeier_file_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/images/sphx_glr_create_tabulated_file_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/images/sphx_glr_download_yml_file_001.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/images/thumb/sphx_glr_create_sellmeier_file_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/images/thumb/sphx_glr_create_tabulated_file_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/images/thumb/sphx_glr_download_yml_file_thumb.png +0 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/index.rst +119 -0
- pyoptik-1.7.0.post0/docs/source/gallery/utils/sg_execution_times.rst +17 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/source/index.rst +1 -1
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/meta.yaml +6 -2
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/pyproject.toml +4 -2
- pyoptik-1.7.0.post0/tests/test_sellmeier.py +144 -0
- pyoptik-1.7.0.post0/tests/test_tabulated.py +109 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/tests/test_usual_material.py +2 -2
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/tests/test_utils.py +1 -1
- pyoptik-1.6.4.post0/PyOptik/base_class.py +0 -21
- pyoptik-1.6.4.post0/PyOptik/sellmeier_class.py +0 -181
- pyoptik-1.6.4.post0/PyOptik/tabulated_class.py +0 -121
- pyoptik-1.6.4.post0/PyOptik.egg-info/SOURCES.txt +0 -161
- pyoptik-1.6.4.post0/docs/examples/README.rst +0 -6
- pyoptik-1.6.4.post0/docs/source/code.rst +0 -60
- pyoptik-1.6.4.post0/docs/source/gallery/add_material.ipynb +0 -43
- pyoptik-1.6.4.post0/docs/source/gallery/add_material.py +0 -16
- pyoptik-1.6.4.post0/docs/source/gallery/add_material.rst +0 -68
- pyoptik-1.6.4.post0/docs/source/gallery/add_material_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/create_sellmeier_file_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/create_tabulated_file_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/download_yml_file_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/get_values.ipynb +0 -43
- pyoptik-1.6.4.post0/docs/source/gallery/get_values.py +0 -14
- pyoptik-1.6.4.post0/docs/source/gallery/get_values.rst +0 -66
- pyoptik-1.6.4.post0/docs/source/gallery/get_values_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_create_sellmeier_file_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_create_tabulated_file_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_download_yml_file_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_bk7_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_sellmeier_0_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_sellmeier_1_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_sf5_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_silica_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_silver_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/sphx_glr_plot_water_001.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_add_material_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_create_sellmeier_file_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_create_tabulated_file_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_download_yml_file_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_get_values_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_bk7_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_sellmeier_0_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_sellmeier_1_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_sf5_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_silica_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_silver_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/images/thumb/sphx_glr_plot_water_thumb.png +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/index.rst +0 -175
- pyoptik-1.6.4.post0/docs/source/gallery/plot_bk7.py.md5 +0 -1
- pyoptik-1.6.4.post0/docs/source/gallery/plot_bk7_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_0.ipynb +0 -43
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_0.py +0 -19
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_0.py.md5 +0 -1
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_0.rst +0 -225
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_0_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_1.ipynb +0 -43
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_1.py +0 -19
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_1.py.md5 +0 -1
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_1.rst +0 -225
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sellmeier_1_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/plot_sf5_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/plot_silica_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/plot_silver_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/plot_water_codeobj.pickle +0 -0
- pyoptik-1.6.4.post0/docs/source/gallery/sg_execution_times.rst +0 -27
- pyoptik-1.6.4.post0/tests/test_sellmeier.py +0 -38
- pyoptik-1.6.4.post0/tests/test_tabulated.py +0 -47
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.github/dependabot.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.github/workflows/deploy_coverage.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.github/workflows/deploy_documentation.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.github/workflows/deploy_workflow.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.gitignore +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/.readthedocs.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/LICENSE +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/__main__.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/__init__.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/BAK1.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/BK7.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/SF5.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/ZBLAN.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/__init__.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/argon.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/crown.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/default.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/flint.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/fluorine_doped_silica_1%.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/fluorine_doped_silica_2%.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/fused_silica.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/germanium.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/lithium_niobate.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/polystyren.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/silica.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/silicon.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/soda_lime_glass.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/sellmeier/water.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/__init__.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/aluminium.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/calcium.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/copper.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/default.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/gold.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/iron.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/nickel.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/silver.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/sodium.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/data/tabulated/zinc.yml +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik/directories.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik.egg-info/dependency_links.txt +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/PyOptik.egg-info/top_level.txt +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/Makefile +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/examples/sellmeier}/plot_silica.py +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/examples/sellmeier}/plot_water.py +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/examples/tabulated}/plot_sf5.py +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/examples/tabulated}/plot_silver.py +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/examples/utils}/create_tabulated_file.py +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/examples/utils}/download_yml_file.py +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/images/example_bk7.png +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/images/logo.png +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/make.bat +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/source/_static/default.css +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_silica.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_silica.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_silica.py.md5 +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_water.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_water.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/sellmeier}/plot_water.py.md5 +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_sf5.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_sf5.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_sf5.py.md5 +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_silver.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_silver.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/tabulated}/plot_silver.py.md5 +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_sellmeier_file.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/examples → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_sellmeier_file.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_sellmeier_file.py.md5 +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_tabulated_file.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_tabulated_file.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/create_tabulated_file.py.md5 +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/download_yml_file.ipynb +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/download_yml_file.py +0 -0
- {pyoptik-1.6.4.post0/docs/source/gallery → pyoptik-1.7.0.post0/docs/source/gallery/utils}/download_yml_file.py.md5 +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/docs/source/references.rst +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/setup.cfg +0 -0
- {pyoptik-1.6.4.post0 → pyoptik-1.7.0.post0}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyOptik
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0.post0
|
|
4
4
|
Summary: A package for refractive index values.
|
|
5
5
|
Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -36,9 +36,9 @@ Classifier: Intended Audience :: Science/Research
|
|
|
36
36
|
Requires-Python: >=3.10
|
|
37
37
|
Description-Content-Type: text/x-rst
|
|
38
38
|
License-File: LICENSE
|
|
39
|
+
Requires-Dist: pint
|
|
39
40
|
Requires-Dist: pydantic>=2.6.3
|
|
40
41
|
Requires-Dist: numpy
|
|
41
|
-
Requires-Dist: scipy
|
|
42
42
|
Requires-Dist: pyyaml
|
|
43
43
|
Requires-Dist: MPSPlots
|
|
44
44
|
Requires-Dist: tabulate
|
|
@@ -69,7 +69,7 @@ PyOptik is a powerful Python tool designed to import refractive indexes and exti
|
|
|
69
69
|
:header-rows: 1
|
|
70
70
|
|
|
71
71
|
* - Testing
|
|
72
|
-
-
|
|
72
|
+
- |ci/cd|
|
|
73
73
|
- |coverage|
|
|
74
74
|
-
|
|
75
75
|
* - Package
|
|
@@ -83,6 +83,7 @@ PyOptik is a powerful Python tool designed to import refractive indexes and exti
|
|
|
83
83
|
|
|
84
84
|
Features
|
|
85
85
|
********
|
|
86
|
+
|
|
86
87
|
- **Comprehensive Database Access**: Seamlessly import refractive index and extinction coefficient data for a wide range of materials.
|
|
87
88
|
- **Simulation Ready**: Ideal for light-matter interaction simulations, particularly in optics and photonics.
|
|
88
89
|
- **Simple API**: Easy-to-use API that integrates well with other Python libraries.
|
|
@@ -96,10 +97,10 @@ To install PyOptik, simply use `pip` or `conda`:
|
|
|
96
97
|
.. code:: bash
|
|
97
98
|
|
|
98
99
|
pip install PyOptik
|
|
99
|
-
conda install pyoptik
|
|
100
|
+
conda install --channels martinpdes pyoptik
|
|
100
101
|
|
|
101
|
-
Usage
|
|
102
|
-
|
|
102
|
+
Simple Usage
|
|
103
|
+
************
|
|
103
104
|
|
|
104
105
|
After installing PyOptik, you can easily access material properties:
|
|
105
106
|
|
|
@@ -199,6 +200,10 @@ As of 2024, PyOptik is still under development. If you would like to collaborate
|
|
|
199
200
|
:target: https://martinpdes.github.io/PyOptik/
|
|
200
201
|
:alt: Documentation Status
|
|
201
202
|
|
|
203
|
+
.. |ci/cd| image:: https://github.com/martinpdes/pyoptik/actions/workflows/deploy_coverage.yml/badge.svg
|
|
204
|
+
:target: https://martinpdes.github.io/PyOptik/actions
|
|
205
|
+
:alt: Unittest Status
|
|
206
|
+
|
|
202
207
|
.. |PyPi| image:: https://badge.fury.io/py/pyoptik.svg
|
|
203
208
|
:target: https://badge.fury.io/py/pyoptik
|
|
204
209
|
|
|
@@ -7,7 +7,8 @@ except ImportError:
|
|
|
7
7
|
|
|
8
8
|
from .utils import build_default_library
|
|
9
9
|
from .material import Material
|
|
10
|
-
from .
|
|
11
|
-
from .
|
|
10
|
+
from .material import TabulatedMaterial
|
|
11
|
+
from .material import SellmeierMaterial
|
|
12
|
+
from .material import base_class
|
|
12
13
|
|
|
13
14
|
Material = Material()
|
|
@@ -12,5 +12,5 @@ __version__: str
|
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
|
13
13
|
version_tuple: VERSION_TUPLE
|
|
14
14
|
|
|
15
|
-
__version__ = version = '1.
|
|
16
|
-
__version_tuple__ = version_tuple = (1,
|
|
15
|
+
__version__ = version = '1.7.0.post0'
|
|
16
|
+
__version_tuple__ = version_tuple = (1, 7, 0)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
from PyOptik.units import Quantity, meter
|
|
5
|
+
import numpy
|
|
6
|
+
import warnings
|
|
7
|
+
|
|
8
|
+
class BaseMaterial:
|
|
9
|
+
def __str__(self) -> str:
|
|
10
|
+
"""
|
|
11
|
+
Provides an informal string representation of the Material object.
|
|
12
|
+
|
|
13
|
+
Returns
|
|
14
|
+
-------
|
|
15
|
+
str
|
|
16
|
+
Informal representation of the Material object.
|
|
17
|
+
"""
|
|
18
|
+
return f"Material: {self.filename}"
|
|
19
|
+
|
|
20
|
+
def __repr__(self) -> str:
|
|
21
|
+
"""
|
|
22
|
+
Provides a formal string representation of the Material object, including key attributes.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
str
|
|
27
|
+
Formal representation of the Material object.
|
|
28
|
+
"""
|
|
29
|
+
return self.__str__()
|
|
30
|
+
|
|
31
|
+
def _check_wavelength(self, wavelength_range: Quantity) -> None:
|
|
32
|
+
"""
|
|
33
|
+
Checks if a wavelength is within the material's allowable range and raises a warning if it is not.
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
lambda_um : float
|
|
38
|
+
The wavelength to check, in micrometers.
|
|
39
|
+
|
|
40
|
+
Raises
|
|
41
|
+
------
|
|
42
|
+
UserWarning
|
|
43
|
+
If the wavelength is outside the allowable range.
|
|
44
|
+
"""
|
|
45
|
+
if self.wavelength_bound is not None:
|
|
46
|
+
min_value, max_value = self.wavelength_bound
|
|
47
|
+
|
|
48
|
+
if numpy.any((wavelength_range < min_value) | (wavelength_range > max_value)):
|
|
49
|
+
warnings.warn(
|
|
50
|
+
f"Wavelength range goes from {wavelength_range.min().to_compact()} to {wavelength_range.max().to_compact()} "
|
|
51
|
+
f"which is outside the allowable range of {min_value.to_compact()} to {max_value.to_compact()} µm. "
|
|
52
|
+
f"[Material: {self.filename}]"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def ensure_units(func):
|
|
56
|
+
"""
|
|
57
|
+
Decorator to ensure that the wavelength parameter has the correct units.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
func : callable
|
|
62
|
+
The function to wrap.
|
|
63
|
+
|
|
64
|
+
Returns
|
|
65
|
+
-------
|
|
66
|
+
callable
|
|
67
|
+
The wrapped function that ensures wavelength is a Quantity in meters.
|
|
68
|
+
"""
|
|
69
|
+
def wrapper(self, wavelength: Quantity = None, *args, **kwargs):
|
|
70
|
+
if wavelength is None:
|
|
71
|
+
wavelength = numpy.linspace(self.wavelength_bound[0].magnitude, self.wavelength_bound[1].magnitude, 100) * self.wavelength_bound.units
|
|
72
|
+
|
|
73
|
+
if not isinstance(wavelength, Quantity):
|
|
74
|
+
wavelength = wavelength * meter
|
|
75
|
+
return func(self, wavelength, *args, **kwargs)
|
|
76
|
+
return wrapper
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
from typing import Union
|
|
5
5
|
from dataclasses import dataclass
|
|
6
|
-
from PyOptik.sellmeier_class import SellmeierMaterial
|
|
7
|
-
from PyOptik.tabulated_class import TabulatedMaterial
|
|
6
|
+
from PyOptik.material.sellmeier_class import SellmeierMaterial
|
|
7
|
+
from PyOptik.material.tabulated_class import TabulatedMaterial
|
|
8
8
|
from PyOptik import data
|
|
9
9
|
|
|
10
10
|
class staticproperty(property):
|
|
@@ -45,14 +45,20 @@ class Material:
|
|
|
45
45
|
"""
|
|
46
46
|
Retrieve a material by name.
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
material_name : str
|
|
51
|
+
The name of the material to retrieve.
|
|
50
52
|
|
|
51
|
-
Returns
|
|
52
|
-
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
Union[SellmeierMaterial, TabulatedMaterial]
|
|
56
|
+
An instance of the material if found.
|
|
53
57
|
|
|
54
|
-
Raises
|
|
55
|
-
|
|
58
|
+
Raises
|
|
59
|
+
------
|
|
60
|
+
FileNotFoundError
|
|
61
|
+
If the material is not found in either the Sellmeier or Tabulated lists.
|
|
56
62
|
"""
|
|
57
63
|
if material_name in data.sellmeier.material_list:
|
|
58
64
|
return SellmeierMaterial(material_name)
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
from pydantic import Field, ConfigDict
|
|
5
|
+
from pydantic.dataclasses import dataclass
|
|
6
|
+
import matplotlib.pyplot as plt
|
|
7
|
+
import numpy
|
|
8
|
+
from typing import Tuple, Optional, Union
|
|
9
|
+
import yaml
|
|
10
|
+
from PyOptik.directories import sellmeier_data_path
|
|
11
|
+
import itertools
|
|
12
|
+
from PyOptik.material.base_class import BaseMaterial
|
|
13
|
+
from MPSPlots.styles import mps
|
|
14
|
+
from PyOptik.units import meter, micrometer, Quantity
|
|
15
|
+
|
|
16
|
+
config_dict = ConfigDict(
|
|
17
|
+
arbitrary_types_allowed=True
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
@dataclass(config=config_dict, slots=True)
|
|
21
|
+
class SellmeierMaterial(BaseMaterial):
|
|
22
|
+
"""
|
|
23
|
+
Class representing a material with Sellmeier coefficients for refractive index computation.
|
|
24
|
+
|
|
25
|
+
Attributes
|
|
26
|
+
----------
|
|
27
|
+
filename : str
|
|
28
|
+
The name of the YAML file containing material properties.
|
|
29
|
+
coefficients : numpy.ndarray
|
|
30
|
+
The Sellmeier coefficients used for calculating the refractive index.
|
|
31
|
+
wavelength_range : Optional[Tuple[float, float]]
|
|
32
|
+
The allowable wavelength range for the material in micrometers.
|
|
33
|
+
reference : Optional[str]
|
|
34
|
+
Reference information for the material data.
|
|
35
|
+
formula_type : int
|
|
36
|
+
The formula type to use for refractive index calculation.
|
|
37
|
+
"""
|
|
38
|
+
filename: str
|
|
39
|
+
coefficients: Optional[numpy.ndarray] = Field(default=None)
|
|
40
|
+
wavelength_bound: Optional[Tuple[float, float]] = Field(default=None)
|
|
41
|
+
reference: Optional[str] = Field(default=None)
|
|
42
|
+
formula_type: Optional[int] = Field(default=None)
|
|
43
|
+
|
|
44
|
+
def __post_init__(self) -> None:
|
|
45
|
+
"""
|
|
46
|
+
Post-initialization method to load coefficients, wavelength range, formula type, and reference from a YAML file.
|
|
47
|
+
"""
|
|
48
|
+
self._load_coefficients()
|
|
49
|
+
|
|
50
|
+
def _load_coefficients(self) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Loads the Sellmeier coefficients, wavelength range, formula type, and reference from the specified YAML file.
|
|
53
|
+
"""
|
|
54
|
+
file_path = sellmeier_data_path / f'{self.filename}'
|
|
55
|
+
|
|
56
|
+
if not file_path.with_suffix('.yml').exists():
|
|
57
|
+
raise FileNotFoundError(f"YAML file {file_path} not found.")
|
|
58
|
+
|
|
59
|
+
with file_path.with_suffix('.yml').open('r') as file:
|
|
60
|
+
parsed_yaml = yaml.safe_load(file)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# Extract the formula type
|
|
64
|
+
self.formula_type = int(parsed_yaml['DATA'][0]['type'].split()[-1])
|
|
65
|
+
|
|
66
|
+
# Extract coefficients and ensure the list has exactly 7 coefficients by padding with zeros if necessary
|
|
67
|
+
coefficients_str = parsed_yaml['DATA'][0]['coefficients']
|
|
68
|
+
coefficients = list(map(float, coefficients_str.split()))
|
|
69
|
+
if len(coefficients) < 7:
|
|
70
|
+
coefficients.extend([0.0] * (7 - len(coefficients)))
|
|
71
|
+
self.coefficients = numpy.array(coefficients)
|
|
72
|
+
|
|
73
|
+
# Extract wavelength range
|
|
74
|
+
if 'wavelength_range' in parsed_yaml['DATA'][0]:
|
|
75
|
+
data_str = parsed_yaml['DATA'][0]['wavelength_range'].split()
|
|
76
|
+
self.wavelength_bound = numpy.array([float(val) for val in data_str]) * micrometer
|
|
77
|
+
|
|
78
|
+
else:
|
|
79
|
+
self.wavelength_bound = None
|
|
80
|
+
|
|
81
|
+
# Extract reference
|
|
82
|
+
self.reference = parsed_yaml.get('REFERENCES', None)
|
|
83
|
+
|
|
84
|
+
@BaseMaterial.ensure_units
|
|
85
|
+
def compute_refractive_index(self, wavelength: Union[Quantity]) -> Union[float, numpy.ndarray]:
|
|
86
|
+
r"""
|
|
87
|
+
Computes the refractive index n(\u03bb) using the appropriate formula (either Formula 1, 2, 5, or 6).
|
|
88
|
+
|
|
89
|
+
Parameters
|
|
90
|
+
----------
|
|
91
|
+
wavelength : Union[Quantity]
|
|
92
|
+
The wavelength \u03bb in meters, can be a single float or a numpy array.
|
|
93
|
+
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
Union[Quantity]
|
|
97
|
+
The refractive index n(\u03bb) for the given wavelength or array of wavelengths.
|
|
98
|
+
|
|
99
|
+
Raises
|
|
100
|
+
------
|
|
101
|
+
ValueError
|
|
102
|
+
If the wavelength is outside the specified range or if an unsupported formula type is encountered.
|
|
103
|
+
"""
|
|
104
|
+
is_scalar = numpy.isscalar(wavelength)
|
|
105
|
+
wavelength = numpy.atleast_1d(wavelength)
|
|
106
|
+
self._check_wavelength(wavelength)
|
|
107
|
+
|
|
108
|
+
# Compute the refractive index based on the formula type
|
|
109
|
+
zipped_coefficients = itertools.zip_longest(*[iter(self.coefficients[1:])] * 2)
|
|
110
|
+
|
|
111
|
+
match self.formula_type:
|
|
112
|
+
case 1: # Formula 1 computation (standard Sellmeier)
|
|
113
|
+
n_squared = self.coefficients[0]
|
|
114
|
+
for (B, C) in zipped_coefficients:
|
|
115
|
+
n_squared += (B * wavelength.to(micrometer).magnitude**2) / (wavelength.to(micrometer).magnitude**2 - C**2)
|
|
116
|
+
n = numpy.sqrt(n_squared)
|
|
117
|
+
|
|
118
|
+
case 2: # Formula 2 computation (extended Sellmeier)
|
|
119
|
+
n_squared = 1 + self.coefficients[0]
|
|
120
|
+
for (B, C) in zipped_coefficients:
|
|
121
|
+
n_squared += (B * wavelength.to(micrometer).magnitude**2) / (wavelength.to(micrometer).magnitude**2 - C)
|
|
122
|
+
n = numpy.sqrt(n_squared)
|
|
123
|
+
|
|
124
|
+
case 5: # Formula 5 computation (extended Sellmeier)
|
|
125
|
+
n = 1 + self.coefficients[0]
|
|
126
|
+
for (B, C) in zipped_coefficients:
|
|
127
|
+
n = B * wavelength.to(micrometer).magnitude**C
|
|
128
|
+
|
|
129
|
+
case 6:
|
|
130
|
+
n = 1 + self.coefficients[0]
|
|
131
|
+
for (B, C) in zipped_coefficients:
|
|
132
|
+
n = B / (C - wavelength.to(micrometer).magnitude**-2)
|
|
133
|
+
|
|
134
|
+
case _:
|
|
135
|
+
raise ValueError(f"Unsupported formula type: {self.formula_type}")
|
|
136
|
+
|
|
137
|
+
return n[0] if is_scalar else n
|
|
138
|
+
|
|
139
|
+
@BaseMaterial.ensure_units
|
|
140
|
+
def plot(self, wavelength: Optional[Quantity] = None) -> None:
|
|
141
|
+
"""
|
|
142
|
+
Plots the refractive index as a function of wavelength over a specified range.
|
|
143
|
+
|
|
144
|
+
Parameters
|
|
145
|
+
----------
|
|
146
|
+
wavelength : Optional[Quantity]
|
|
147
|
+
The range of wavelengths to plot, in meters. If not provided, the entire allowable wavelength range is used.
|
|
148
|
+
|
|
149
|
+
Raises
|
|
150
|
+
------
|
|
151
|
+
ValueError
|
|
152
|
+
If the wavelength is not a 1D array or list of float values.
|
|
153
|
+
"""
|
|
154
|
+
if wavelength.ndim != 1:
|
|
155
|
+
raise ValueError("wavelength must be a 1D array or list of float values.")
|
|
156
|
+
|
|
157
|
+
# Calculate the refractive index over the wavelength range
|
|
158
|
+
refractive_index = self.compute_refractive_index(wavelength)
|
|
159
|
+
|
|
160
|
+
with plt.style.context(mps):
|
|
161
|
+
fig, ax = plt.subplots()
|
|
162
|
+
|
|
163
|
+
ax.set(
|
|
164
|
+
ylabel='Refractive Index',
|
|
165
|
+
xlabel=r'Wavelength [$\mu$m]',
|
|
166
|
+
title=f"Refractive Index vs. Wavelength: [{self.filename}]"
|
|
167
|
+
)
|
|
168
|
+
ax.plot(wavelength.to(micrometer).magnitude, refractive_index.real, linewidth=2, label='Real Part')
|
|
169
|
+
ax.legend()
|
|
170
|
+
|
|
171
|
+
plt.show()
|
|
172
|
+
|
|
173
|
+
def print(self) -> str:
|
|
174
|
+
"""
|
|
175
|
+
Provides a formal string representation of the Material object, including key attributes.
|
|
176
|
+
|
|
177
|
+
Returns
|
|
178
|
+
-------
|
|
179
|
+
str
|
|
180
|
+
Formal representation of the Material object.
|
|
181
|
+
"""
|
|
182
|
+
return (
|
|
183
|
+
f"\nMaterial: '{self.filename}',\n"
|
|
184
|
+
f"coefficients: {self.coefficients},\n"
|
|
185
|
+
f"wavelength_range: {self.wavelength_bound},\n"
|
|
186
|
+
f"formula_type: {self.formula_type},\n"
|
|
187
|
+
f"reference: '{self.reference}')"
|
|
188
|
+
)
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
import numpy
|
|
5
|
+
from pydantic.dataclasses import dataclass, Field
|
|
6
|
+
from typing import Optional, Union
|
|
7
|
+
import yaml
|
|
8
|
+
import warnings
|
|
9
|
+
from PyOptik.directories import tabulated_data_path
|
|
10
|
+
from PyOptik.material.base_class import BaseMaterial
|
|
11
|
+
from MPSPlots.styles import mps
|
|
12
|
+
import matplotlib.pyplot as plt
|
|
13
|
+
from PyOptik.units import Quantity, micrometer, meter
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass(config=dict(arbitrary_types_allowed=True))
|
|
17
|
+
class TabulatedMaterial(BaseMaterial):
|
|
18
|
+
"""
|
|
19
|
+
Class representing a material with tabulated refractive index (n) and absorption (k) values.
|
|
20
|
+
|
|
21
|
+
Attributes
|
|
22
|
+
----------
|
|
23
|
+
filename : str
|
|
24
|
+
The name of the YAML file containing material properties.
|
|
25
|
+
wavelength : numpy.ndarray
|
|
26
|
+
Array of wavelengths in micrometers for which the refractive index and absorption values are tabulated.
|
|
27
|
+
n_values : numpy.ndarray
|
|
28
|
+
Array of tabulated refractive index values (n) corresponding to the wavelengths.
|
|
29
|
+
k_values : numpy.ndarray
|
|
30
|
+
Array of tabulated absorption values (k) corresponding to the wavelengths.
|
|
31
|
+
reference : Optional[str]
|
|
32
|
+
Reference information for the material data.
|
|
33
|
+
"""
|
|
34
|
+
filename: str
|
|
35
|
+
wavelength: numpy.ndarray = Field(init=False)
|
|
36
|
+
n_values: numpy.ndarray = Field(init=False)
|
|
37
|
+
k_values: numpy.ndarray = Field(init=False)
|
|
38
|
+
reference: Optional[str] = Field(init=False)
|
|
39
|
+
|
|
40
|
+
def __post_init__(self) -> None:
|
|
41
|
+
"""
|
|
42
|
+
Post-initialization method to load the tabulated data from the YAML file.
|
|
43
|
+
"""
|
|
44
|
+
self._load_tabulated_data()
|
|
45
|
+
|
|
46
|
+
def _load_tabulated_data(self) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Loads the tabulated refractive index and absorption values from the specified YAML file.
|
|
49
|
+
|
|
50
|
+
Raises
|
|
51
|
+
------
|
|
52
|
+
FileNotFoundError
|
|
53
|
+
If the specified YAML file does not exist.
|
|
54
|
+
ValueError
|
|
55
|
+
If the YAML data is malformed or missing required keys.
|
|
56
|
+
"""
|
|
57
|
+
file_path = tabulated_data_path / f'{self.filename}'
|
|
58
|
+
|
|
59
|
+
if not file_path.with_suffix('.yml').exists():
|
|
60
|
+
raise FileNotFoundError(f"YAML file {file_path} not found.")
|
|
61
|
+
|
|
62
|
+
with file_path.with_suffix('.yml').open('r') as file:
|
|
63
|
+
parsed_yaml = yaml.safe_load(file)
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
# Extract data points
|
|
67
|
+
data_points = parsed_yaml['DATA'][0]['data'].strip().split('\n')
|
|
68
|
+
data = numpy.array([[float(value) for value in point.split()] for point in data_points])
|
|
69
|
+
|
|
70
|
+
self.wavelength = data[:, 0] * micrometer
|
|
71
|
+
self.n_values = data[:, 1]
|
|
72
|
+
self.k_values = data[:, 2]
|
|
73
|
+
except (KeyError, IndexError, ValueError):
|
|
74
|
+
raise ValueError(f"Invalid or missing data in YAML file {file_path}")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
self.wavelength_bound = [self.wavelength.min().magnitude, self.wavelength.max().magnitude] * micrometer
|
|
78
|
+
|
|
79
|
+
# Extract reference
|
|
80
|
+
self.reference = parsed_yaml.get('REFERENCES', None)
|
|
81
|
+
|
|
82
|
+
@BaseMaterial.ensure_units
|
|
83
|
+
def compute_refractive_index(self, wavelength: Union[float, Quantity]) -> numpy.ndarray:
|
|
84
|
+
"""
|
|
85
|
+
Interpolates the refractive index (n) and absorption (k) values for the given wavelength(s).
|
|
86
|
+
|
|
87
|
+
Parameters
|
|
88
|
+
----------
|
|
89
|
+
wavelength : Union[float, Quantity]
|
|
90
|
+
Wavelength(s) in micrometers for which to interpolate n and k.
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
numpy.ndarray
|
|
95
|
+
Complex refractive index values (n + i*k) for the given wavelength(s).
|
|
96
|
+
|
|
97
|
+
Raises
|
|
98
|
+
------
|
|
99
|
+
ValueError
|
|
100
|
+
If the wavelength is outside the tabulated range.
|
|
101
|
+
"""
|
|
102
|
+
self._check_wavelength(wavelength)
|
|
103
|
+
|
|
104
|
+
n_interp = numpy.interp(wavelength.to(meter).magnitude, self.wavelength.to(meter).magnitude, self.n_values)
|
|
105
|
+
k_interp = numpy.interp(wavelength.to(meter).magnitude, self.wavelength.to(meter).magnitude, self.k_values)
|
|
106
|
+
|
|
107
|
+
return n_interp + 1j * k_interp
|
|
108
|
+
|
|
109
|
+
@BaseMaterial.ensure_units
|
|
110
|
+
def plot(self, wavelength: Optional[Quantity] = None) -> None:
|
|
111
|
+
"""
|
|
112
|
+
Plots the tabulated refractive index (n) and absorption (k) as a function of wavelength.
|
|
113
|
+
|
|
114
|
+
Parameters
|
|
115
|
+
----------
|
|
116
|
+
wavelength : Optional[Quantity]
|
|
117
|
+
The range of wavelengths to plot, in micrometers. If not provided, the entire tabulated wavelength range is used.
|
|
118
|
+
title : str, optional
|
|
119
|
+
Title of the plot.
|
|
120
|
+
grid : bool, optional
|
|
121
|
+
Whether to show grid lines on the plot.
|
|
122
|
+
|
|
123
|
+
Raises
|
|
124
|
+
------
|
|
125
|
+
ValueError
|
|
126
|
+
If the wavelength is not a 1D array or list of float values.
|
|
127
|
+
"""
|
|
128
|
+
n_values, k_values = self.compute_refractive_index(wavelength).real, self.compute_refractive_index(wavelength).imag
|
|
129
|
+
|
|
130
|
+
with plt.style.context(mps):
|
|
131
|
+
_, ax1 = plt.subplots()
|
|
132
|
+
|
|
133
|
+
ax1.set(
|
|
134
|
+
title=f"Refractive Index and Absorption vs. Wavelength [{self.filename}]",
|
|
135
|
+
xlabel='Wavelength [µm]',
|
|
136
|
+
ylabel='Refractive Index (n)',
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
ax1.plot(wavelength.to(micrometer).magnitude, n_values, 'o-', color='tab:blue', label='n')
|
|
140
|
+
|
|
141
|
+
ax2 = ax1.twinx()
|
|
142
|
+
|
|
143
|
+
ax2.set(
|
|
144
|
+
xlabel='Wavelength [µm]',
|
|
145
|
+
ylabel='Absorption (k)',
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
ax2.plot(wavelength.to(micrometer).magnitude, k_values, 'o-', color='tab:red', label='k')
|
|
149
|
+
|
|
150
|
+
plt.show()
|
|
151
|
+
|
|
152
|
+
def print(self) -> str:
|
|
153
|
+
"""
|
|
154
|
+
Provides a formal string representation of the TabulatedMaterial object, including key attributes.
|
|
155
|
+
|
|
156
|
+
Returns
|
|
157
|
+
-------
|
|
158
|
+
str
|
|
159
|
+
Formal representation of the TabulatedMaterial object.
|
|
160
|
+
"""
|
|
161
|
+
return (
|
|
162
|
+
f"\nTabulatedMaterial: '{self.filename}',\n"
|
|
163
|
+
f"wavelength_range: [{self.wavelength.min()} µm, {self.wavelength.max()} µm],\n"
|
|
164
|
+
f"reference: '{self.reference}')"
|
|
165
|
+
)
|
|
@@ -10,11 +10,15 @@ def download_yml_file(url: str, filename: str, location: str) -> None:
|
|
|
10
10
|
"""
|
|
11
11
|
Downloads a .yml file from a specified URL and saves it locally.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
Parameters
|
|
14
|
+
----------
|
|
15
|
+
url : str
|
|
16
|
+
The URL of the .yml file to download.
|
|
17
|
+
save_path : str
|
|
18
|
+
The local path where the .yml file should be saved.
|
|
19
|
+
|
|
20
|
+
Raises
|
|
21
|
+
------
|
|
18
22
|
HTTPError: If the download fails due to an HTTP error.
|
|
19
23
|
"""
|
|
20
24
|
file_path = location / f"{filename}.yml"
|
|
@@ -53,13 +57,19 @@ def remove_element(filename: str, location: str = 'any') -> None:
|
|
|
53
57
|
"""
|
|
54
58
|
Remove a file associated with a given element name from the specified location.
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
Parameters
|
|
61
|
+
----------
|
|
62
|
+
filename : str
|
|
63
|
+
The name of the file to remove, without the '.yml' suffix.
|
|
64
|
+
location : str
|
|
65
|
+
The location to search for the file, either 'sellmeier', 'tabulated', or 'any' (default is 'any').
|
|
66
|
+
|
|
67
|
+
Raises
|
|
68
|
+
------
|
|
69
|
+
FileNotFoundError
|
|
70
|
+
If the specified file does not exist.
|
|
71
|
+
ValueError
|
|
72
|
+
If an invalid location is provided.
|
|
63
73
|
"""
|
|
64
74
|
location = location.lower()
|
|
65
75
|
|
|
@@ -87,14 +97,22 @@ def create_sellmeier_file(
|
|
|
87
97
|
"""
|
|
88
98
|
Creates a YAML file with custom Sellmeier coefficients in the correct format.
|
|
89
99
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
Parameters
|
|
101
|
+
----------
|
|
102
|
+
filename : str
|
|
103
|
+
The name of the file to create (without the extension).
|
|
104
|
+
formula_type : int
|
|
105
|
+
The type of Sellmeier formula.
|
|
106
|
+
coefficients : list[float]
|
|
107
|
+
A list of coefficients for the Sellmeier equation.
|
|
108
|
+
wavelength_range : Tuple[float, float]
|
|
109
|
+
The range of wavelengths, in micrometers.
|
|
110
|
+
reference : str
|
|
111
|
+
A reference for the material data.
|
|
112
|
+
comments : Optional[str]
|
|
113
|
+
Additional comments about the material.
|
|
114
|
+
specs : Optional[dict]
|
|
115
|
+
Additional specifications, such as temperature and whether the wavelength is in a vacuum.
|
|
98
116
|
"""
|
|
99
117
|
reference = 'None' if reference is None else reference
|
|
100
118
|
wavelength_range = [None, None] if wavelength_range is None else wavelength_range
|
|
@@ -135,11 +153,16 @@ def create_tabulated_file(
|
|
|
135
153
|
"""
|
|
136
154
|
Creates a YAML file with tabulated nk data in the correct format.
|
|
137
155
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
Parameters
|
|
157
|
+
----------
|
|
158
|
+
filename : str)
|
|
159
|
+
The name of the file to create (without the extension).
|
|
160
|
+
data : List[Tuple[float, float, float]])
|
|
161
|
+
The tabulated nk data.
|
|
162
|
+
reference : Optional[str])
|
|
163
|
+
A reference for the material data.
|
|
164
|
+
comments : Optional[str])
|
|
165
|
+
Additional comments about the material.
|
|
143
166
|
"""
|
|
144
167
|
reference = 'None' if reference is None else reference
|
|
145
168
|
|