Skip to content

Commit

Permalink
Merge pull request #72 from x113f/Fix_Power_FB
Browse files Browse the repository at this point in the history
Added dx**2 to power function to be correct
  • Loading branch information
ldoyle committed Jul 2, 2023
2 parents bb25e6e + 79a4231 commit 6eb8f59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions LightPipes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,8 @@ def Power(Fin):
>>> P = Power(F) # returns the power of the field F
"""
#TODO why does Normal() also sum dx**2 (==integral) while this does not??
I = _np.abs(Fin.field)**2
return I.sum()
return I.sum() * Fin.dx**2

@backward_compatible
def RandomIntensity(Fin, seed = 123, noise = 1.0, ):
Expand Down

0 comments on commit 6eb8f59

Please sign in to comment.