PyOptik 1.1.5.post0__tar.gz → 1.1.6.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.
Files changed (107) hide show
  1. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PKG-INFO +3 -1
  2. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/_version.py +2 -2
  3. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/sellmeier_class.py +19 -16
  4. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/tabulated_class.py +17 -8
  5. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik.egg-info/PKG-INFO +3 -1
  6. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik.egg-info/SOURCES.txt +5 -5
  7. pyoptik-1.1.5.post0/docs/examples/sellmeier_bk7.py → pyoptik-1.1.6.post0/docs/examples/plot_bk7.py +7 -9
  8. pyoptik-1.1.5.post0/docs/examples/sellmeier_sf5.py → pyoptik-1.1.6.post0/docs/examples/plot_sf5.py +6 -8
  9. pyoptik-1.1.6.post0/docs/examples/plot_silica.py +21 -0
  10. pyoptik-1.1.5.post0/docs/examples/sellmeier_silica.py → pyoptik-1.1.6.post0/docs/examples/plot_silver.py +5 -6
  11. pyoptik-1.1.6.post0/docs/examples/plot_water.py +22 -0
  12. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/pyproject.toml +2 -0
  13. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/tests/test_sellmeier.py +1 -2
  14. pyoptik-1.1.5.post0/docs/examples/measurements_tio2.py +0 -23
  15. pyoptik-1.1.5.post0/docs/examples/measurements_water.py +0 -23
  16. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/.github/dependabot.yml +0 -0
  17. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/.github/workflows/coverage.yml +0 -0
  18. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/.github/workflows/deploy_workflow.yml +0 -0
  19. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/.gitignore +0 -0
  20. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/.readthedocs.yml +0 -0
  21. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/LICENSE +0 -0
  22. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/__init__.py +0 -0
  23. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/base_class.py +0 -0
  24. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/__init__.py +0 -0
  25. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/BAK1.yml +0 -0
  26. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/BK7.yml +0 -0
  27. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/SF5.yml +0 -0
  28. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/ZBLAN.yml +0 -0
  29. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/__init__.py +0 -0
  30. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/argon.yml +0 -0
  31. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/crown.yml +0 -0
  32. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/default.py +0 -0
  33. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/flint.yml +0 -0
  34. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/fluorine_doped_silica_1%.yml +0 -0
  35. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/fluorine_doped_silica_2%.yml +0 -0
  36. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/fused_silica.yml +0 -0
  37. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/germanium.yml +0 -0
  38. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/lithium_niobate.yml +0 -0
  39. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/polystyren.yml +0 -0
  40. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/silica.yml +0 -0
  41. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/silicon.yml +0 -0
  42. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/soda_lime_glass.yml +0 -0
  43. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/test.yml +0 -0
  44. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/sellmeier/water.yml +0 -0
  45. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/__init__.py +0 -0
  46. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/aluminium.yml +0 -0
  47. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/calcium.yml +0 -0
  48. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/copper.yml +0 -0
  49. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/default.py +0 -0
  50. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/gold.yml +0 -0
  51. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/iron.yml +0 -0
  52. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/nickel.yml +0 -0
  53. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/silver.yml +0 -0
  54. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/sodium.yml +0 -0
  55. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/test.yml +0 -0
  56. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/tabulated/zinc.yml +0 -0
  57. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/data/test.yml +0 -0
  58. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/directories.py +0 -0
  59. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/download.py +0 -0
  60. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/material.py +0 -0
  61. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik/utils.py +0 -0
  62. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik.egg-info/dependency_links.txt +0 -0
  63. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik.egg-info/requires.txt +0 -0
  64. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/PyOptik.egg-info/top_level.txt +0 -0
  65. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/README.rst +0 -0
  66. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/developments/testing.py +0 -0
  67. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/Makefile +0 -0
  68. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/deprecated/experiment_material.py +0 -0
  69. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/examples/README.rst +0 -0
  70. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/images/logo.png +0 -0
  71. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/make.bat +0 -0
  72. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/_static/default.css +0 -0
  73. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/code.rst +0 -0
  74. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/conf.py +0 -0
  75. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/add_material.ipynb +0 -0
  76. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/add_material.py +0 -0
  77. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/add_material.rst +0 -0
  78. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/add_material_codeobj.pickle +0 -0
  79. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/get_values.ipynb +0 -0
  80. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/get_values.py +0 -0
  81. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/get_values.rst +0 -0
  82. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/get_values_codeobj.pickle +0 -0
  83. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/images/sphx_glr_plot_sellmeier_0_001.png +0 -0
  84. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/images/sphx_glr_plot_sellmeier_1_001.png +0 -0
  85. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/images/thumb/sphx_glr_add_material_thumb.png +0 -0
  86. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/images/thumb/sphx_glr_get_values_thumb.png +0 -0
  87. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/images/thumb/sphx_glr_plot_sellmeier_0_thumb.png +0 -0
  88. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/images/thumb/sphx_glr_plot_sellmeier_1_thumb.png +0 -0
  89. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/index.rst +0 -0
  90. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_0.ipynb +0 -0
  91. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_0.py +0 -0
  92. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_0.py.md5 +0 -0
  93. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_0.rst +0 -0
  94. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_0_codeobj.pickle +0 -0
  95. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_1.ipynb +0 -0
  96. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_1.py +0 -0
  97. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_1.py.md5 +0 -0
  98. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_1.rst +0 -0
  99. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/plot_sellmeier_1_codeobj.pickle +0 -0
  100. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/gallery/sg_execution_times.rst +0 -0
  101. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/index.rst +0 -0
  102. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/docs/source/references.rst +0 -0
  103. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/setup.cfg +0 -0
  104. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/tests/__init__.py +0 -0
  105. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/tests/test_extra.py +0 -0
  106. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/tests/test_tabulated.py +0 -0
  107. {pyoptik-1.1.5.post0 → pyoptik-1.1.6.post0}/tests/test_usual_material.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyOptik
3
- Version: 1.1.5.post0
3
+ Version: 1.1.6.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
@@ -28,8 +28,10 @@ License: MIT License
28
28
  Keywords: refracive index,optics
29
29
  Classifier: Programming Language :: Python
30
30
  Classifier: Programming Language :: Python :: 3
31
+ Classifier: Programming Language :: Python :: 3.10
31
32
  Classifier: Programming Language :: Python :: 3.11
32
33
  Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
33
35
  Classifier: Programming Language :: Python :: Implementation :: CPython
34
36
  Classifier: Development Status :: 4 - Beta
35
37
  Classifier: Topic :: Scientific/Engineering :: Physics
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.1.5.post0'
16
- __version_tuple__ = version_tuple = (1, 1, 5)
15
+ __version__ = version = '1.1.6.post0'
16
+ __version_tuple__ = version_tuple = (1, 1, 6)
@@ -54,7 +54,7 @@ class SellmeierMaterial(Material):
54
54
  # Extract reference
55
55
  self.reference = parsed_yaml.get('REFERENCES', None)
56
56
 
57
- def check_wavelength_range(self, wavelength: float) -> None:
57
+ def check_wavelength_range(self, lambda_um: float) -> None:
58
58
  """
59
59
  Checks if a wavelength is within the material's allowable range and raises an error if it is not.
60
60
 
@@ -65,10 +65,9 @@ class SellmeierMaterial(Material):
65
65
  ValueError: If the wavelength is outside the allowable range.
66
66
  """
67
67
  if self.wavelength_range is not None:
68
- wavelength_um = wavelength * 1e6
69
68
  min_value, max_value = self.wavelength_range
70
- if not min_value <= wavelength_um <= max_value:
71
- warnings.warn(f"Wavelength {wavelength_um} µm is outside the allowable range of {min_value} µm to {max_value} µm. [{self.filename}]")
69
+ if not min_value <= lambda_um <= max_value:
70
+ warnings.warn(f"Wavelength {lambda_um} µm is outside the allowable range of {min_value} µm to {max_value} µm. [{self.filename}]")
72
71
 
73
72
  def compute_refractive_index(self, wavelength: Union[float, numpy.ndarray]) -> Union[float, numpy.ndarray]:
74
73
  """
@@ -84,15 +83,17 @@ class SellmeierMaterial(Material):
84
83
  ValueError: If the wavelength is outside the specified range or if an unsupported formula type is encountered.
85
84
  """
86
85
  # Ensure that wavelength is within the allowable range if it's a single value
87
- if isinstance(wavelength, float):
88
- self.check_wavelength_range(wavelength)
89
- else: # If it's an array, ensure all values are within range
90
- for wl in numpy.nditer(wavelength):
91
- self.check_wavelength_range(float(wl))
86
+ wavelength = numpy.asarray(wavelength)
92
87
 
93
88
  # Convert wavelength to micrometers
94
89
  lambda_um = wavelength * 1e6
95
90
 
91
+ if isinstance(wavelength, float):
92
+ self.check_wavelength_range(lambda_um)
93
+ else: # If it's an array, ensure all values are within range
94
+ for wl in lambda_um:
95
+ self.check_wavelength_range(float(wl))
96
+
96
97
  # Compute the refractive index based on the formula type
97
98
  match self.formula_type:
98
99
  case 1: # Formula 1 computation (standard Sellmeier)
@@ -128,27 +129,29 @@ class SellmeierMaterial(Material):
128
129
  return n
129
130
 
130
131
 
131
- def plot(self, wavelength_range: Union[List[float], numpy.ndarray]) -> NoReturn:
132
+ def plot(self, wavelength: Optional[List[float]] = None) -> NoReturn:
132
133
  """
133
134
  Plots the refractive index as a function of wavelength over a specified range.
134
135
 
135
136
  Args:
136
137
  wavelength_range (Union[List[float], numpy.ndarray]): The range of wavelengths to plot, in meters.
137
138
  """
138
- if isinstance(wavelength_range, list):
139
- wavelength_range = numpy.array(wavelength_range)
139
+ if wavelength is None:
140
+ wavelength = numpy.linspace(*self.wavelength_range, 100) * 1e-6
141
+
142
+ wavelength = numpy.asarray(wavelength)
140
143
 
141
- if wavelength_range.ndim != 1:
142
- raise ValueError("wavelength_range must be a 1D array or list of float values.")
144
+ if wavelength.ndim != 1:
145
+ raise ValueError("wavelength must be a 1D array or list of float values.")
143
146
 
144
147
  # Calculate the refractive index over the wavelength range
145
- refractive_index = self.compute_refractive_index(wavelength_range)
148
+ refractive_index = self.compute_refractive_index(wavelength)
146
149
 
147
150
  # Plotting
148
151
  fig, ax = plt.subplots()
149
152
  ax.set_xlabel('Wavelength [m]')
150
153
  ax.set_ylabel('Refractive Index')
151
- ax.plot(wavelength_range, refractive_index.real, linewidth=2, label='Real Part')
154
+ ax.plot(wavelength, refractive_index.real, linewidth=2, label='Real Part')
152
155
  ax.legend()
153
156
  ax.grid(True)
154
157
  plt.tight_layout()
@@ -1,6 +1,6 @@
1
1
  import numpy
2
2
  from dataclasses import dataclass, field
3
- from typing import Optional, Tuple, Union
3
+ from typing import Optional, Tuple, Union, List
4
4
  import yaml
5
5
  from scipy.interpolate import interp1d
6
6
  import warnings
@@ -54,10 +54,9 @@ class TabulatedMaterial(Material):
54
54
  Raises:
55
55
  ValueError: If the wavelength is outside the tabulated range.
56
56
  """
57
- if isinstance(wavelength, float):
58
- wavelength = numpy.array([wavelength])
57
+ wavelength = numpy.asarray(wavelength)
59
58
 
60
- wavelength *= 1e6
59
+ wavelength_um = wavelength * 1e6
61
60
 
62
61
  if numpy.any(wavelength < self.wavelength.min()) or numpy.any(wavelength > self.wavelength.max()):
63
62
  warnings.warn(f"Wavelength: {wavelength} is outside the tabulated range of {self.wavelength.min()} µm to {self.wavelength.max()} µm. [{self.filename}]")
@@ -65,24 +64,34 @@ class TabulatedMaterial(Material):
65
64
  n_interp = interp1d(self.wavelength, self.n_values, kind='cubic', fill_value='extrapolate')
66
65
  k_interp = interp1d(self.wavelength, self.k_values, kind='cubic', fill_value='extrapolate')
67
66
 
68
- return n_interp(wavelength) + 1j * k_interp(wavelength)
67
+ return n_interp(wavelength_um) + 1j * k_interp(wavelength_um)
69
68
 
70
- def plot(self) -> None:
69
+ def plot(self, wavelength: Optional[List[float]] = None) -> None:
71
70
  """
72
71
  Plots the tabulated refractive index (n) and absorption (k) as a function of wavelength.
73
72
  """
73
+ if wavelength is None:
74
+ wavelength = self.wavelength
75
+ index = self.compute_refractive_index(wavelength=self.wavelength)
76
+ n_values = index.real
77
+ k_values = index.imag
78
+ else:
79
+ wavelength = self.wavelength
80
+ n_values = self.n_values
81
+ k_values = self.k_values
82
+
74
83
  import matplotlib.pyplot as plt
75
84
 
76
85
  fig, ax1 = plt.subplots()
77
86
 
78
87
  ax1.set_xlabel('Wavelength [µm]')
79
88
  ax1.set_ylabel('Refractive Index (n)', color='tab:blue')
80
- ax1.plot(self.wavelength, self.n_values, 'o-', color='tab:blue', label='n')
89
+ ax1.plot(wavelength, n_values, 'o-', color='tab:blue', label='n')
81
90
  ax1.tick_params(axis='y', labelcolor='tab:blue')
82
91
 
83
92
  ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis
84
93
  ax2.set_ylabel('Absorption (k)', color='tab:red') # we already handled the x-label with ax1
85
- ax2.plot(self.wavelength, self.k_values, 'o-', color='tab:red', label='k')
94
+ ax2.plot(wavelength, k_values, 'o-', color='tab:red', label='k')
86
95
  ax2.tick_params(axis='y', labelcolor='tab:red')
87
96
 
88
97
  fig.tight_layout() # to prevent the right y-label from being slightly clipped
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyOptik
3
- Version: 1.1.5.post0
3
+ Version: 1.1.6.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
@@ -28,8 +28,10 @@ License: MIT License
28
28
  Keywords: refracive index,optics
29
29
  Classifier: Programming Language :: Python
30
30
  Classifier: Programming Language :: Python :: 3
31
+ Classifier: Programming Language :: Python :: 3.10
31
32
  Classifier: Programming Language :: Python :: 3.11
32
33
  Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
33
35
  Classifier: Programming Language :: Python :: Implementation :: CPython
34
36
  Classifier: Development Status :: 4 - Beta
35
37
  Classifier: Topic :: Scientific/Engineering :: Physics
@@ -59,11 +59,11 @@ docs/Makefile
59
59
  docs/make.bat
60
60
  docs/deprecated/experiment_material.py
61
61
  docs/examples/README.rst
62
- docs/examples/measurements_tio2.py
63
- docs/examples/measurements_water.py
64
- docs/examples/sellmeier_bk7.py
65
- docs/examples/sellmeier_sf5.py
66
- docs/examples/sellmeier_silica.py
62
+ docs/examples/plot_bk7.py
63
+ docs/examples/plot_sf5.py
64
+ docs/examples/plot_silica.py
65
+ docs/examples/plot_silver.py
66
+ docs/examples/plot_water.py
67
67
  docs/images/logo.png
68
68
  docs/source/code.rst
69
69
  docs/source/conf.py
@@ -2,22 +2,20 @@
2
2
  Plot the Refractive Index of Optical Material: BK7
3
3
  =====================================================
4
4
 
5
- This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material SF5 over a specified range of wavelengths.
5
+ 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.
6
6
 
7
7
  """
8
8
 
9
9
  import numpy
10
- from PyOptik import Sellmeier
10
+ from PyOptik import UsualMaterial
11
11
 
12
12
  # Initialize the material with the Sellmeier model
13
- material = Sellmeier('BK7')
13
+ material = UsualMaterial.get('BK7')
14
14
 
15
15
  # Calculate refractive index at specific wavelengths
16
- RI = material.get_refractive_index(wavelength_range=[1310e-9, 1550e-9])
16
+ RI = material.compute_refractive_index(wavelength=[1310e-9, 1550e-9])
17
17
 
18
18
  # Display calculated refractive indices at sample wavelengths
19
- figure = material.plot(
20
- wavelength_range=numpy.linspace(300e-9, 3500e-9, 300)
21
- )
22
-
23
- figure.show()
19
+ material.plot(
20
+ wavelength=numpy.linspace(300e-9, 1500e-9, 300)
21
+ )
@@ -2,22 +2,20 @@
2
2
  Plot the Refractive Index of Optical Material: SF5
3
3
  ==================================================
4
4
 
5
- This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material SF5 over a specified range of wavelengths.
5
+ This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material SF5 glass over a specified range of wavelengths.
6
6
 
7
7
  """
8
8
 
9
9
  import numpy
10
- from PyOptik import Sellmeier
10
+ from PyOptik import UsualMaterial
11
11
 
12
12
  # Initialize the material with the Sellmeier model
13
- material = Sellmeier('SF5')
13
+ material = UsualMaterial.get('SF5')
14
14
 
15
15
  # Calculate refractive index at specific wavelengths
16
- RI = material.get_refractive_index(wavelength_range=[1310e-9, 1550e-9])
16
+ RI = material.compute_refractive_index(wavelength=[1310e-9, 1550e-9])
17
17
 
18
18
  # Display calculated refractive indices at sample wavelengths
19
- figure = material.plot(
20
- wavelength_range=numpy.linspace(300e-9, 3500e-9, 300)
19
+ material.plot(
20
+ wavelength=numpy.linspace(400e-9, 1500e-9, 300)
21
21
  )
22
-
23
- figure.show()
@@ -0,0 +1,21 @@
1
+ """
2
+ Plot the Refractive Index of Optical Material: Silica
3
+ =====================================================
4
+
5
+ This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material Silica over a specified range of wavelengths.
6
+
7
+ """
8
+
9
+ import numpy
10
+ from PyOptik import UsualMaterial
11
+
12
+ # Initialize the material with the Sellmeier model
13
+ material = UsualMaterial.fused_silica
14
+
15
+ # Calculate refractive index at specific wavelengths
16
+ RI = material.compute_refractive_index(wavelength=[1310e-9, 1550e-9])
17
+
18
+ # Display calculated refractive indices at sample wavelengths
19
+ material.plot(
20
+ wavelength=numpy.linspace(500e-9, 1500e-9, 300)
21
+ )
@@ -7,17 +7,16 @@ This module demonstrates the usage of the PyOptik library to calculate and plot
7
7
  """
8
8
 
9
9
  import numpy
10
- from PyOptik import Sellmeier
10
+ from PyOptik import UsualMaterial
11
11
 
12
12
  # Initialize the material with the Sellmeier model
13
- material = Sellmeier('silica')
13
+ material = UsualMaterial.silver
14
14
 
15
15
  # Calculate refractive index at specific wavelengths
16
- RI = material.get_refractive_index(wavelength_range=[1310e-9, 1550e-9])
16
+ RI = material.compute_refractive_index(wavelength=[1310e-9, 1550e-9])
17
17
 
18
18
  # Display calculated refractive indices at sample wavelengths
19
- figure = material.plot(
20
- wavelength_range=numpy.linspace(300e-9, 3500e-9, 300)
19
+ material.plot(
20
+ wavelength=numpy.linspace(300e-9, 1500e-9, 300)
21
21
  )
22
22
 
23
- figure.show()
@@ -0,0 +1,22 @@
1
+ """
2
+ Plot the Refractive Index of Optical Material: Silica
3
+ =====================================================
4
+
5
+ This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material water over a specified range of wavelengths.
6
+
7
+ """
8
+
9
+ import numpy
10
+ from PyOptik import UsualMaterial
11
+
12
+ # Initialize the material with the Sellmeier model
13
+ material = UsualMaterial.water
14
+
15
+ # Calculate refractive index at specific wavelengths
16
+ RI = material.compute_refractive_index(wavelength=[800e-9, 900e-9])
17
+
18
+ # Display calculated refractive indices at sample wavelengths
19
+ material.plot(
20
+ wavelength=numpy.linspace(300e-9, 1000e-9, 300)
21
+ )
22
+
@@ -13,8 +13,10 @@ authors = [{ name="Martin Poinsinet de Sivry-Houle", email="martin.poinsinet.de.
13
13
  classifiers = [
14
14
  'Programming Language :: Python',
15
15
  'Programming Language :: Python :: 3',
16
+ 'Programming Language :: Python :: 3.10',
16
17
  'Programming Language :: Python :: 3.11',
17
18
  'Programming Language :: Python :: 3.12',
19
+ 'Programming Language :: Python :: 3.13',
18
20
  'Programming Language :: Python :: Implementation :: CPython',
19
21
  'Development Status :: 4 - Beta',
20
22
  'Topic :: Scientific/Engineering :: Physics',
@@ -25,9 +25,8 @@ def test_init_material():
25
25
  @patch("matplotlib.pyplot.show")
26
26
  def test_material_plot(mock_show, material: str):
27
27
  material = Material(material)
28
- wavelength_range = [500e-9]
29
28
 
30
- material.plot(wavelength_range=wavelength_range)
29
+ material.plot(wavelength=[500e-9])
31
30
 
32
31
  plt.close()
33
32
 
@@ -1,23 +0,0 @@
1
- """
2
- Plot the Refractive Index of Optical Material: Ti02
3
- ===================================================
4
-
5
- This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material SF5 over a specified range of wavelengths.
6
-
7
- """
8
-
9
- import numpy
10
- from PyOptik import DataMeasurement
11
-
12
- # Initialize the material with the Sellmeier model
13
- material = DataMeasurement('tio2')
14
-
15
- # Calculate refractive index at specific wavelengths
16
- RI = material.get_refractive_index(wavelength_range=[1310e-9, 1550e-9])
17
-
18
- # Display calculated refractive indices at sample wavelengths
19
- figure = material.plot(
20
- wavelength_range=numpy.linspace(10e-9, 3500e-9, 300)
21
- )
22
-
23
- figure.show()
@@ -1,23 +0,0 @@
1
- """
2
- Plot the Refractive Index of Optical Material: Water
3
- ====================================================
4
-
5
- This module demonstrates the usage of the PyOptik library to calculate and plot the refractive index of the optical material SF5 over a specified range of wavelengths.
6
-
7
- """
8
-
9
- import numpy
10
- from PyOptik import DataMeasurement
11
-
12
- # Initialize the material with the Sellmeier model
13
- material = DataMeasurement('water')
14
-
15
- # Calculate refractive index at specific wavelengths
16
- RI = material.get_refractive_index(wavelength_range=[1310e-9, 1550e-9])
17
-
18
- # Display calculated refractive indices at sample wavelengths
19
- figure = material.plot(
20
- wavelength_range=numpy.linspace(300e-9, 3500e-9, 300)
21
- )
22
-
23
- figure.show()
File without changes
File without changes
File without changes
File without changes