Skip to content

Commit

Permalink
refactor to clarify discretization factor
Browse files Browse the repository at this point in the history
  • Loading branch information
talonchandler committed Apr 16, 2024
1 parent d3c48ce commit 65bf748
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions waveorder/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,11 @@ def compute_weak_object_transfer_function_3D(

H1 = torch.fft.ifft2(torch.conj(SPHz_hat) * PG_hat, dim=(1, 2))
H1 = H1 * window[:, None, None]
H1 = torch.fft.fft(H1, dim=0) * z_pixel_size
H1 = torch.fft.fft(H1, dim=0)

H2 = torch.fft.ifft2(SPHz_hat * torch.conj(PG_hat), dim=(1, 2))
H2 = H2 * window[:, None, None]
H2 = torch.fft.fft(H2, dim=0) * z_pixel_size
H2 = torch.fft.fft(H2, dim=0)

direct_intensity = torch.sum(
illumination_pupil_support
Expand All @@ -753,6 +753,10 @@ def compute_weak_object_transfer_function_3D(
real_potential_transfer_function = (H1 + H2) / direct_intensity
imag_potential_transfer_function = 1j * (H1 - H2) / direct_intensity

# Discretization factor for unitless input and output
real_potential_transfer_function *= z_pixel_size
imag_potential_transfer_function *= z_pixel_size

return real_potential_transfer_function, imag_potential_transfer_function


Expand Down

0 comments on commit 65bf748

Please sign in to comment.