Skip to content

Commit

Permalink
fix out-of-NA values for sin_theta
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmoerland committed Nov 4, 2024
1 parent ee80e09 commit ed053d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lumicks/pyoptics/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def sample_back_focal_plane(self, f_input_field, bfp_sampling_n: int):
bfp_sampling_n=bfp_sampling_n,
)

Ex_bfp, Ey_bfp = f_input_field(*astuple(bfp_coords))
Ex_bfp, Ey_bfp = (
f_input_field(*astuple(bfp_coords)) if f_input_field is not None else (None, None)
)

return bfp_coords, BackFocalPlaneFields(Ex=Ex_bfp, Ey=Ey_bfp)

Expand All @@ -126,7 +128,7 @@ def back_focal_plane_to_farfield(
bfp_sampling_n = bfp_coords.bfp_sampling_n
sin_theta_x = bfp_coords.x_bfp / self.focal_length
sin_theta_y = bfp_coords.y_bfp / self.focal_length
sin_theta = bfp_coords.r_bfp / self.focal_length
sin_theta = bfp_coords.r_bfp / self.focal_length * bfp_coords.aperture
aperture = bfp_coords.aperture # sin_theta <= self.sin_theta_max
# Calculate properties of the plane waves in the far field
k = 2 * np.pi * self.n_medium / lambda_vac
Expand Down

0 comments on commit ed053d5

Please sign in to comment.