slmsuite.holography.analysis.fitfunctions.sinc2d#
- sinc2d(xy, x0, y0, R, a=1, b=0, c=0, d=0, kx=0, ky=0)[source]#
For fitting a 2D rectangular \(\text{sinc}^2\) distribution, potentially with a sinusoidal modulation.
\[z(x,y) = d + \left(c + \frac{a}{2} \left[1+\cos(k_xx+k_yy-b) \right]\right) * \text{sinc}^2(\pi (x-x_0) / R) * \text{sinc}^2(\pi (y-y_0) / R).\]where
\[\text{sinc}(x) = \frac{\sin(x)}{x}\]- Parameters:
xy (numpy.ndarray) – Points to fit upon (x, y).
x0 (float) – Vector offset.
y0 (float) – Vector offset.
R (float) – Square radius of the sinc (radius of the first zero).
a (float) – Peak amplitude.
b (float) – Phase offset.
c (float) – Sinusoidal amplitude offset.
d (float) – Global offset.
kx (float) – Vector phase scale factor. Default is 0.
ky (float) – Vector phase scale factor. Default is 0.
- Returns:
z – Rectangular sinc fit evaluated at all
(x,y)inxy.- Return type:
numpy.ndarray