mperrin / poppy

Physical Optics Propagation in Python
BSD 3-Clause "New" or "Revised" License
177 stars 41 forks source link

Fixes to zernike code and tests #223

Closed mperrin closed 7 years ago

mperrin commented 7 years ago

Issues noticed by @kvangorkom and originally reported in #222:

A few things I noticed that probably deserve their own issues :

  1. I'm not sure that test_zernikes_rms is performing the check quite correctly. The line

    assert 1.0 - rms < 0.001, "Zernike(j={}) has RMS value of {}".format(j, rms)

    ought to be

    assert abs(1.0 - rms) < 0.001, "Zernike(j={}) has RMS value of {}".format(j, rms)

    correct? Otherwise, RMS values > 1 sneak on by. (The latter is how I formulated it in test_arbitrary_basis_rms)

  2. I'm not sure the different combinations of rho, theta being None are handled correctly (theta=None with rho defined hits an array broadcasting error, rho=None with theta defined runs successfully with unexpected results). I get the same behaviors with zernike_basis as with arbitrary_basis, so I left it alone for now.

  3. hexike_basis ignores the outside argument.

mperrin commented 7 years ago

Fixed by #224