Skip to content

Commit 0cba6a4

Browse files
committed
Medium.eps_model fix now that C_0 is not a numpy float
1 parent 6204c71 commit 0cba6a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tidy3d/components/medium.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ class Sellmeier(DispersiveMedium):
782782
def _n_model(self, frequency: float) -> complex:
783783
"""Complex-valued refractive index as a function of frequency."""
784784

785-
wvl = C_0 / frequency
785+
wvl = C_0 / np.array(frequency)
786786
wvl2 = wvl**2
787787
n_squared = 1.0
788788
for (B, C) in self.coeffs:
@@ -840,7 +840,7 @@ def from_dispersion(cls, n: float, freq: float, dn_dwvl: float = 0, **kwargs):
840840
if n < 1:
841841
raise ValidationError("Refractive index ``n`` cannot be smaller than one.")
842842

843-
wvl = C_0 / freq
843+
wvl = C_0 / np.array(freq)
844844
nsqm1 = n**2 - 1
845845
c_coeff = -(wvl**3) * n * dn_dwvl / (nsqm1 - wvl * n * dn_dwvl)
846846
b_coeff = (wvl**2 - c_coeff) / wvl**2 * nsqm1

0 commit comments

Comments
 (0)