From 2711170e25d86daccc2d15c114db7d267fef6211 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sun, 24 Mar 2024 23:05:07 -0600 Subject: [PATCH] Fixed bug in `optika.rulings` where the amplitude of the grating wasn't being accounted for correctly. --- optika/rulings/_rulings.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/optika/rulings/_rulings.py b/optika/rulings/_rulings.py index b3510bb..0e09eda 100644 --- a/optika/rulings/_rulings.py +++ b/optika/rulings/_rulings.py @@ -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) @@ -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) @@ -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) @@ -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)