Skip to content

Commit

Permalink
quick cleanup before refractive branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jashcraf committed Oct 24, 2024
1 parent 166af5f commit adceb18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Binary file added experiments/physics_validation/singlet.zmx
Binary file not shown.
19 changes: 6 additions & 13 deletions poke/polarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def prt_matrix(kin, kout, normal, aoi, surfdict, wavelength, ambient_index):
wavelength : float
wavelength of light the computation is done at
ambient_index : float
refractive index that the optical system is immersed in
refractive index of material in the exiting space
Returns
-------
Expand Down Expand Up @@ -199,9 +199,7 @@ def prt_matrix(kin, kout, normal, aoi, surfdict, wavelength, ambient_index):
fss = ts
fpp = tp

elif (
type(surfdict["coating"]) == np.ndarray
): # assumes the film is defined with first index as fs,fp
elif (type(surfdict["coating"]) == np.ndarray): # assumes the film is defined with first index as fs,fp

fss = surfdict["coating"][0, 0]
fsp = surfdict["coating"][0, 1]
Expand All @@ -214,12 +212,8 @@ def prt_matrix(kin, kout, normal, aoi, surfdict, wavelength, ambient_index):

else:

fss, fpp = fresnel_coefficients(
aoi, ambient_index, surfdict["coating"], mode=surfdict["mode"]
)
if (
np.imag(surfdict["coating"]) < 0
): # TODO: This is a correction for the n - ik configuration, need to investigate if physical
fss, fpp = fresnel_coefficients(aoi, ambient_index, surfdict["coating"], mode=surfdict["mode"])
if np.imag(surfdict["coating"]) < 0: # TODO: This is a correction for the n - ik configuration, need to investigate if physical
fss *= np.exp(-1j * np.pi)
fpp *= np.exp(1j * np.pi)

Expand Down Expand Up @@ -283,9 +277,8 @@ def system_prt_matrices(aoi, kin, kout, norm, surfaces, wavelength, ambient_inde
normsurf = np.moveaxis(norm[i], -1, 0)
aoisurf = np.moveaxis(aoi[i], -1, 0)

Pmat, Jmat, Qmat = prt_matrix(
kisurf, kosurf, normsurf, aoisurf, surfdict, wavelength, ambient_index
)
Pmat, Jmat, Qmat = prt_matrix(kisurf, kosurf, normsurf, aoisurf, surfdict, wavelength, ambient_index)

P.append(Pmat)
J.append(Jmat)
Q.append(Qmat)
Expand Down

0 comments on commit adceb18

Please sign in to comment.