Skip to content

Commit

Permalink
Fixed bug in optika.rulings where the amplitude of the grating wasn…
Browse files Browse the repository at this point in the history
…'t being accounted for correctly.
  • Loading branch information
byrdie committed Mar 25, 2024
1 parent b7a891e commit 2711170
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions optika/rulings/_rulings.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ def efficiency(

wavelength = rays.wavelength
cos_theta = -direction @ normal
d = self.depth
amplitude = np.pi / 4
d = self.depth / amplitude
i = self.diffraction_order

gamma = np.pi * d / (wavelength * cos_theta)
Expand Down Expand Up @@ -555,7 +556,8 @@ def efficiency(

wavelength = rays.wavelength
cos_theta = -direction @ normal
d = self.depth
amplitude = np.pi / 2
d = self.depth / amplitude
i = self.diffraction_order

gamma = np.pi * d / (wavelength * cos_theta)
Expand Down Expand Up @@ -693,7 +695,8 @@ def efficiency(

wavelength = rays.wavelength
cos_theta = -direction @ normal
d = self.depth
amplitude = np.square(np.pi) / 8
d = self.depth / amplitude
i = self.diffraction_order

gamma = np.pi * d / (wavelength * cos_theta)
Expand Down Expand Up @@ -843,8 +846,9 @@ def efficiency(

wavelength = rays.wavelength
cos_theta = -direction @ normal
d = self.depth
a = 2 * np.pi * self.ratio_duty
amplitude = np.pi / (2 * np.sqrt(2 * (1 - np.cos(a))))
d = self.depth / amplitude
i = self.diffraction_order

gamma = np.pi * d / (wavelength * cos_theta)
Expand Down

0 comments on commit 2711170

Please sign in to comment.