diff --git a/deeptrack/optics.py b/deeptrack/optics.py index 189bd7e73..21ced55a5 100644 --- a/deeptrack/optics.py +++ b/deeptrack/optics.py @@ -706,7 +706,15 @@ def get(self, illuminated_volume, limits, fields, **kwargs): **kwargs, )[0] - propagation_matrix = propagation_matrix + propagation_matrix = propagation_matrix * np.exp( + 1j + * voxel_size[-1] + * 2 + * np.pi + / kwargs["wavelength"] + * kwargs["refractive_index_medium"] + * (z - fz) + ) pf = np.fft.fft2(fields[idx][:, :, 0]) * np.fft.fftshift(propagation_matrix) light_in += pf diff --git a/deeptrack/scatterers.py b/deeptrack/scatterers.py index dd393585a..f011f4582 100644 --- a/deeptrack/scatterers.py +++ b/deeptrack/scatterers.py @@ -592,7 +592,7 @@ def _process_properties(self, properties): ) / 2 * min(properties["voxel_size"][:2]) - / np.sin(properties["collection_angle"]) + / np.tan(properties["collection_angle"]) ) return properties @@ -611,6 +611,7 @@ def get( input_polarization, output_polarization, coefficients, + z, **kwargs, ): @@ -686,7 +687,7 @@ def get( (ct > ct_max) * 1j / (k * R3) - * np.exp(1j * k * (R3 - offset_z)) + * np.exp(1j * k * R3) * (S2 * S2_coef + S1 * S1_coef) )