slmsuite.holography.analysis.image_ellipticity
- image_ellipticity(variances)[source]
Given the output of
image_variances()
, return a measure of spot ellipticity for each moment triplet. The output ofimage_variances()
contains the moments \(M_{20}\), \(M_{02}\), and \(M_{11}\). These terms make up a \(2 \times 2\) matrix, which is equivalent to a rotated elliptical scaling according to the eigenvalues \(\lambda_+\) and \(\lambda_-\) and some rotation matrix \(R(\phi)\).\[\begin{split}\begin{bmatrix} M_{20} & M_{11} \\ M_{11} & M_{02} \\ \end{bmatrix} = R(-\phi) \begin{bmatrix} \lambda_+ & 0 \\ 0 & \lambda_- \\ \end{bmatrix} R(\phi).\end{split}\]We use this knowledge, along with tricks for eigenvalue calculations on \(2 \times 2\) matrices, to build up a metric for ellipticity:
\[\mathcal{E} = 1 - \frac{\lambda_-}{\lambda_+}.\]Notice that
when \(\lambda_+ = \lambda_-\) (isotropic scaling), the metric is zero and
when \(\lambda_- = 0\) (flattened to a line), the metric is unity.
- Parameters
variances (numpy.ndarray) – The output of
image_variances()
. Shape(3, image_count)
.- Returns
Array of ellipticities for the given moments. Shape
(image_count,)
.- Return type
numpy.ndarray