spacetelescope / poppy

Physical Optics Propagation in Python
https://poppy-optics.readthedocs.io
BSD 3-Clause "New" or "Revised" License
217 stars 72 forks source link

Zernike Noll indexing different from what Anand expects? #112

Closed mperrin closed 6 years ago

mperrin commented 6 years ago

Issue by josePhoenix Monday Aug 31, 2015 at 18:29 GMT Originally opened as https://github.com/mperrin/poppy/issues/112


Anand says tip and tilt are swapped, and maybe entries on lower rows of the Zernike pyramid as well. Note to self to check this and see if I can reproduce.

mperrin commented 6 years ago

Comment by josePhoenix Thursday Sep 03, 2015 at 19:17 GMT


Can confirm that at least tip/tilt are swapped: zernike.noll_indices(2) returns (1, 1) when it should be (1, -1) for the first entry on the second row of the triangle. Everything else looks fine up to Z_15

mperrin commented 6 years ago

Comment by mperrin Thursday Sep 03, 2015 at 19:27 GMT


I am confused.

Both wikipedia (https://en.wikipedia.org/wiki/Zernike_polynomials#Noll.27s_sequential_indices) and the Online Encyclopedia of Integer Sequences (https://oeis.org/A176988) indicate a mapping of j=2 --> (n,m) = (1,1). I.e. those agree with what is currently coded in poppy.

What reference are you using for j=2 --> (1, -1) ?

mperrin commented 6 years ago

Comment by mperrin Thursday Sep 03, 2015 at 19:31 GMT


See also:

In [7]: poppy.zernike.noll_indices(2)
Out[7]: (1, 1)

In [8]: poppy.zernike.str_zernike(1,1)
Out[8]: '\\sqrt{4}* ( 1 r^1  ) * \\cos(1 \\theta)'

This agrees with the definition for $Z_2 = 2 r \cos \theta$ given in Table 1 of Noll 1976. See the following horrible URL:

https://www.osapublishing.org/view_article.cfm?gotourl=https%3A%2F%2Fwww%2Eosapublishing%2Eorg%2FDirectPDFAccess%2FCEE5519A%2DB678%2D4BF5%2D371C8DC6335E764C%5F56041%2Fjosa%2D66%2D3%2D207%2Epdf%3Fda%3D1%26id%3D56041%26seq%3D0%26mobile%3Dno&org=

mperrin commented 6 years ago

Comment by josePhoenix Thursday Sep 03, 2015 at 19:33 GMT


Ah, Wikipedia is not in agreement with itself. I was going off what Anand said and this figure: https://upload.wikimedia.org/wikipedia/commons/9/9f/ZernikePolynome6.svg

mperrin commented 6 years ago

Comment by mperrin Thursday Sep 03, 2015 at 19:39 GMT


Argh. Perhaps the appropriate bug fix here is replacing that figure on wikipedia?

Wait, ha, if you click through to the figure page, the caption has an erratum that the Noll indices for tip and tilt are interchanged. See https://en.wikipedia.org/wiki/Zernike_polynomials#/media/File:ZernikePolynome6.svg

Yeah that should just flat out be fixed on wikipedia. Do you want to edit the svg or shall I?

mperrin commented 6 years ago

Comment by josePhoenix Thursday Sep 03, 2015 at 19:44 GMT


I can do it. Took me a minute to find my login info.

mperrin commented 6 years ago

Comment by josePhoenix Thursday Sep 03, 2015 at 19:55 GMT


Ugh, uploading proves more complicated than anticipated.

mperrin commented 6 years ago

Comment by josePhoenix Thursday Sep 03, 2015 at 19:58 GMT


https://commons.wikimedia.org/wiki/Commons:FAQ#How_can_I_upload_a_new_version_of_a_file.3F

Guess I'll check back next week!

mperrin commented 6 years ago

Comment by josePhoenix Monday Sep 21, 2015 at 21:57 GMT


Fixed the picture on Wikipedia (and the copy I pinned to my wall)