slmsuite.holography.toolbox.phase.zernike_convert_index#
- zernike_convert_index(indices, from_index='ansi', to_index='ansi')[source]#
Helper function for converting between Zernike indexing conventions.
Currently supported conventions:
"radial"The standard 2-dimensional \(n,l\) indexing for Zernike polynomials, where \(n\) is the radial index and \(l\) is the azimuthal index. Denoted \(Z_n^l\).
"ansi"1-dimensional (0-indexed) ANSI indices. This is the default
slmsuiteindex. Denoted \(Z_i\).
"noll"1-dimensional (1-indexed) Noll indices.
"fringe"1-dimensional (1-indexed) Fringe indices.
"wyant"1-dimensional (0-indexed) Wyant indices. Equivalent to
"fringe", except with starting with zero instead of one.
- Parameters:
indices (array_like) – List of indices of shape
(N, D)whereDis the dimension of the indexing (1, apart from"radial"indexing which has a dimension of 2).from_index (str) – Zernike index convention. Must be supported.
to_index (str) – Zernike index convention. Must be supported.
- Returns:
indices_converted – List of indices of shape
(N, D)whereDis the dimension of the indexing (1, apart from"radial"indexing which has a dimension of 2).- Return type:
numpy.ndarray
- Raises:
ValueError – If an invalid index number or index type is given, or an invalid indices shape is given.