pm_errors#
- pyrost.bin.pm_errors(I_n: numpy.ndarray, W: numpy.ndarray, sigma: numpy.ndarray, I0: numpy.ndarray, u: numpy.ndarray, di: numpy.ndarray, dj: numpy.ndarray, ds_y: float, ds_x: float, num_threads: int = 1)#
Return the residuals for the pixel mapping fit.
- Parameters
I_n (numpy.ndarray) – Measured intensity frames.
W (numpy.ndarray) – Measured frames’ white-field.
sigma (numpy.ndarray) – The standard deviation of I_n.
I0 (numpy.ndarray) – Reference image of the sample.
u (numpy.ndarray) – The discrete geometrical mapping of the detector plane to the reference image.
di (numpy.ndarray) – Sample’s translations along the vertical detector axis in pixels.
dj (numpy.ndarray) – Sample’s translations along the fast detector axis in pixels.
ds_y (float) – Sampling interval of reference image in pixels along the vertical axis.
ds_x (float) – Sampling interval of reference image in pixels along the horizontal axis.
num_threads (int) – Number of threads.
- Returns
Residual profile of the pixel mapping fit.
- Return type
See also
pyrost.bin.pm_gsearch()
: Description of error metric which is being minimized.Notes
The error metric is given by:
\[\varepsilon_{pm}[i, j] = \frac{1}{N} \sum_{n = 0}^N f\left( \frac{I[n, i, j] - W[i, j] I_{ref}[u[0, i, j] - di[n], u[1, i, j] - dj[n]]}{\sigma} \right)\]where \(f(x)\) is the Huber loss function.