AOtools / aotools

A useful set of tools for Adaptive Optics in Python
GNU Lesser General Public License v3.0
109 stars 43 forks source link

Fix missing iteration over the subharmonic matrix #60

Closed KlenM closed 3 years ago

KlenM commented 4 years ago

Hi, I think there is a little mistake with a big problem in generating phase screens with subharmonics. In lines 57-61 we create a 3 by 3 frequency matrix. The matrix cn (line 73) has the same shape. But on lines 78-79 with the code xrange(0,2) we only iterate over the four elements (0,0), (0,1), (1,0), (1,1), not over the full size of matrix 3 by 3. This leads to an incorrect calculation of the phase screens. The structure function is very different from what is expected. If we iterate over the entire matrix with code xrange(0, 3), the structure function is much closer to the theoretical one.

codecov[bot] commented 4 years ago

Codecov Report

Merging #60 (5b67055) into master (1773d8d) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #60   +/-   ##
=======================================
  Coverage   93.70%   93.70%           
=======================================
  Files          24       24           
  Lines        1191     1191           
=======================================
  Hits         1116     1116           
  Misses         75       75           
Impacted Files Coverage Δ
aotools/turbulence/phasescreen.py 98.38% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1773d8d...5b67055. Read the comment docs.

matthewtownson commented 3 years ago

Hi Nikita, thanks for adding this. Sorry, its taking a bit longer than usual for us to test and merge changes at the moment, but we're not ignoring you!