make_reference¶
-
pyrost.bin.make_reference(signatures, args, kwargs, defaults)¶ Generate an unabberated reference image of the sample based on the pixel mapping u and the measured data I_n using the simple kriging.
- Parameters
I_n (numpy.ndarray) – Measured intensity frames.
W (numpy.ndarray) – Measured frames’ whitefield.
u (numpy.ndarray) – The pixel mapping between the data at the detector’s plane and the reference image at the reference plane.
di (numpy.ndarray) – Sample’s translations along the slow detector axis in pixels.
dj (numpy.ndarray) – Sample’s translations along the fast detector axis in pixels.
sw_ss (int) – Search window size in pixels along the slow detector axis.
sw_fs (int) – Search window size in pixels along the fast detector axis.
ls (float) – Reference image length scale in pixels.
return_nm0 (bool) – If True, also returns the lower bounds (n0, m0) of the reference image in pixels.
- Returns
I0 (numpy.ndarray) – Reference image array.
n0 (int, optional) – The lower bounds of the slow detector axis of the reference image at the reference frame in pixels. Only provided if return_nm0 is True.
m0 (int, optional) – The lower bounds of the fast detector axis of the reference image at the reference frame in pixels. Only provided if return_nm0 is True.
Notes
Reference image update algorithm the detector plane to the reference plane using the pixel mapping u:
\[ii_{0}, jj_{0} = u[0, i, j] - di[n], u[1, i, j] - dj[n]\]Whereupon it generates a smoothed sample profile using simply kriging approach with the gaussian radial basis function \(\phi\):
\[I_{ref}[ii, jj] = \frac{\sum_{n, i, j} I_n[i, j] W[i, j] \phi[ii - u[0, i, j] + di[n], jj - u[1, i, j] + dj[n]]} {\sum_{n, i, j} W[i, j]^2 \phi[ii - u[0, i, j] + di[n], jj - u[1, i, j] + dj[n]]}\]\[\phi [\Delta ii_{ref}, \Delta jj_{ref}] = \exp\left[{-\frac{(\Delta ii_{ref})^2 + (\Delta jj_{ref})^2}{ls^2}}\right]\]