sklykov / zernpy

Recursive and direct calculation of real-valued Zernike polynomials and associated 2D PSF kernels
https://sklykov.github.io/zernpy/
MIT License
8 stars 3 forks source link

Units of Zernike Coefficients when input data is mm #1

Closed drose-sol closed 8 months ago

drose-sol commented 8 months ago

Hi,

I was using your repo to calculate the Z coeffs of a 3D scan of a surface. The input data is a rectangular NumPy array representing the surface. As the x- and y-values are essentially regular linspaces, I've set them as the rows and columns of this array, and the z-values the array values. The units of the z axis are mm. When this data is fed through fit_polynomials(), will the fit coeffs be in mm as well? I know typically they are represented by waves or milliwaves, but I have not entered a wavelength of light so I don't believe it is normalized.

Hope to have an answer, drose

sklykov commented 8 months ago

Hi @drose-sol ,

Thanks for your question and using of my repository for your calculations! Yes, I suppose that the calculated coefficients will be in mm, in physical units that you have used for your surface construction. The calculated coefficients are result of fitting of polynomials profiles to the surface provided by you, they connect the values of unitless Zernike values over the unit circle to the physical values in any units provided as the surface. Just note that each of polynomial, used for fitting, is normalized according to the table.

Hope that this answers your question! Sergei

drose-sol commented 8 months ago

Thank you Sergei, I appreciate your prompt response! If I have further questions I'll use this forum again.