Skip to content

Commit

Permalink
Fix Zernike tests for radius and k scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
diptodip committed Dec 11, 2024
1 parent 3e58ff7 commit aedcd4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_zernikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_first_ten_zernikes():
grid = create_grid(size, spacing)
# Normalize coordinates from -1 to 1 within radius R
grid = grid_spatial_to_pupil(grid, f, NA, n)
rho = jnp.sum(grid**2, axis=0) # radial coordinate
rho = jnp.sqrt(jnp.sum(grid**2, axis=0)) # radial coordinate
mask = rho <= 1
radius = rho * mask
angle = jnp.arctan2(*grid) * mask # angle coordinate
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_first_ten_zernikes():
)
assert phase.shape == size
assert jnp.allclose(
phase.squeeze(), expected[idx]
phase.squeeze(), 2 * jnp.pi * expected[idx] / wavelength
), f"Mismatch in Zernike polynomial {idx}."


Expand Down

0 comments on commit aedcd4b

Please sign in to comment.