jacopoantonello / zernike

Python code for Zernike polynomials
Apache License 2.0
132 stars 36 forks source link

Derivatives? #5

Open realWDC opened 3 years ago

realWDC commented 3 years ago

Thank you for your excellent works! I searched and it seems Zernike derivatives have not yet been implemented. Any plans for that, or which part of the code could you suggest to modify for that purpose?

Thanks, WDC

jacopoantonello commented 3 years ago

Hi! Yes, that'd be a useful feature. But at the moment I have no plans / time for it. There isn't support for that in the code. I guess the derivatives / integrals can themselves be expanded in Zernike coefficients. So some methods should be added that compute the vector of Zernike coefficients for the derivative out of a given vector of the coefficients of the original function to derive. Something like (zc_dx, zc_dy) = rzern.derivative(zc).

realWDC commented 3 years ago

Thank you for the reply! That is exactly how I ended up with.

Based on your code, I have implemented a derivative version for the real Zernike case. The idea is to have additional functions that:

I will likely submit a PR in near future when I have time to test it thoroughly ...

sidgairo18 commented 3 years ago

@realWDC could you please share the above. @jacopoantonello @realWDC also is there an existing implementation to compute the Curvature at a given point?

Thanks!