Hi, I'm currently working at commit 76bb028cc9b5a621aa7a439940f041875c65b82d (Jan 3, 2025).
1. Zernike Masking in zernike_sum
In the file holography.toolbox.phase.py, the function zernike_sum() contains a potentially confusing or incorrect aperture masking operation around line 889 with the code:
mask = np.square(x_grid * x_scale) + np.square(y_grid * y_scale) <= 1
The x_scale and y_scale parameters used here are generated by the zernike_aperture() function. These values correspond to the reciprocal of the input beam amplitude diameter (in appropriate units), assuming the SLM has already undergone wavefront calibration and the input beam amplitude was characterized in the process.
This implies that the beam, at its 1/e² intensity contour, spans a circular region with diameter = 1, radius = 0.5, and centered at the origin (0, 0).
However, in zernike_sum(), the aperture mask appears to compute:
mask = np.square(x * x_scale) + np.square(y * y_scale) <= 1
This checks whether each pixel is within a unit radius circle (i.e., compares to 1 = (diameter)²) rather than 0.5² = 0.25 = (radius)², which seems inconsistent with the assumption that the beam radius is 0.5. Should this threshold be:
mask = np.square(x * x_scale) + np.square(y * y_scale) <= 0.25
instead?
2. Beam Waist from Source Amplitude in SLM
The beam waist used above is returned by self.source["amplitude_radius"] in the SLM class in hardware.slms.slm.py and is computed with SLM.fit_source_amplitude around line 921:
elif method == "moments":
# Do moments in power-space, not amplitude.
center = analysis.image_positions(np.square(amp))
std = np.sqrt(2 * analysis.image_variances(np.square(amp), centers=center)[:2])
center = np.squeeze(center)
However, for a Gaussian beam of the form:
I(x) ∝ exp(-2 * x² / ω₀²)
the variance of intensity is ω₀² / 4, so the beam waist ω₀ should be:
Thus, the current factor of 2 seems incorrect and may underestimate the beam waist.
Best,
Zhenpu
Hi, I'm currently working at commit
76bb028cc9b5a621aa7a439940f041875c65b82d(Jan 3, 2025).1. Zernike Masking in
zernike_sumIn the file
holography.toolbox.phase.py, the functionzernike_sum()contains a potentially confusing or incorrect aperture masking operation around line 889 with the code:The
x_scaleandy_scaleparameters used here are generated by thezernike_aperture()function. These values correspond to the reciprocal of the input beam amplitude diameter (in appropriate units), assuming the SLM has already undergone wavefront calibration and the input beam amplitude was characterized in the process.This implies that the beam, at its 1/e² intensity contour, spans a circular region with diameter = 1, radius = 0.5, and centered at the origin (0, 0).
However, in
zernike_sum(), the aperture mask appears to compute:This checks whether each pixel is within a unit radius circle (i.e., compares to 1 = (diameter)²) rather than 0.5² = 0.25 = (radius)², which seems inconsistent with the assumption that the beam radius is 0.5. Should this threshold be:
instead?
2. Beam Waist from Source Amplitude in
SLMThe beam waist used above is returned by
self.source["amplitude_radius"]in theSLMclass inhardware.slms.slm.pyand is computed withSLM.fit_source_amplitudearound line 921:However, for a Gaussian beam of the form:
the variance of intensity is ω₀² / 4, so the beam waist ω₀ should be:
Thus, the current factor of 2 seems incorrect and may underestimate the beam waist.
Best,
Zhenpu