Skip to content

Commit

Permalink
Merge pull request #5 from andrewpaulreeves/master
Browse files Browse the repository at this point in the history
Fix saint Jaques r0 estimation
  • Loading branch information
Andrew Reeves committed Jul 4, 2016
2 parents afa7e8f + 3ffc4e6 commit 3b94ff4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aotools/wfs/wfslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def r0fromSlopes(slopes, wavelength, subapDiam):
float: An estimate of r0 for that dataset.
"""
onedSlopes = (slopes[0]**2 + slopes[1]**2)**0.5
sVar = onedSlopes.var()
r0 = ((0.162*(wavelength**2) * subapDiam**(-1./3)) / sVar)**(3./5)
slopeVar = slopes.var(axis=(-1))

r0 = ((0.162*(wavelength**2) * subapDiam**(-1./3)) / slopeVar)**(3./5)

r0 = r0.mean()

return r0

0 comments on commit 3b94ff4

Please sign in to comment.