Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woolam parser dev #98

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Change Sellmeier to not modify wavelength in-place
Sellmeier was modifying the passed wavelength array in-place, which produced confusing behaviour.
  • Loading branch information
igresh authored and andyfaff committed Oct 3, 2024
commit 9a7263eb625397ab1ae418d5460ea86e8ce602ba
12 changes: 6 additions & 6 deletions refellips/dispersion.py
Original file line number Diff line number Diff line change
@@ -293,12 +293,12 @@ def complex(self, wavelength):
wav = wavelength

# Convert between μm & nm (constants are typically given in μm)
wav *= 1e-3
wav_um = wav * 1e-3

real = np.sqrt(
self.Einf.value
+ (self.Am.value * wav**2) / (wav**2 - self.En.value**2)
- (self.P.value * wav**2)
+ (self.Am.value * wav_um**2) / (wav_um**2 - self.En.value**2)
- (self.P.value * wav_um**2)
)
return real + 1j * 0.0

@@ -311,12 +311,12 @@ def epsilon(self, wavelength):
wav = wavelength

# Convert between μm & nm (constants are typically given in μm)
wav *= 1e-3
wav_um = wav * 1e-3

real = (
self.Einf.value
+ (self.Am.value * wav**2) / (wav**2 - self.En.value**2)
- (self.P.value * wav**2)
+ (self.Am.value * wav_um**2) / (wav_um**2 - self.En.value**2)
- (self.P.value * wav_um**2)
)

return real + 1j * 0