Skip to content

Commit

Permalink
physics: add compute_propagation_distance_limit
Browse files Browse the repository at this point in the history
which makes it easy to create a propagator whose frequencies just
satisfy the sampling theorem.
  • Loading branch information
tfarago committed Dec 3, 2021
1 parent 9391d45 commit 7eebb58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions syris/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,12 @@ def compute_propagation_sampling(wavelength, distance, fov, fresnel=True):
n = int(np.ceil((fov / ps).simplified.magnitude))

return n, ps


def compute_propagation_distance_limit(n, wavelength, pixel_size):
"""Compute the propagation distance which just fits the sampling theorem for *n* pixels,
*wavelength* and *pixel_size*.
"""
alpha = np.arccos((wavelength / (2 * pixel_size)).simplified.magnitude)

return (np.tan(alpha) * n * pixel_size / 2).simplified

0 comments on commit 7eebb58

Please sign in to comment.