Skip to content

Commit

Permalink
Update proc_autophase.py
Browse files Browse the repository at this point in the history
  • Loading branch information
atomman authored Sep 16, 2016
1 parent 197615f commit bf24986
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nmrglue/process/proc_autophase.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ def _ps_acme_score(ph, data, gamma):
data = np.real(s0)

# Calculation of first derivatives
ds1 = np.abs(np.diff(data, 1))
p1 = ds1 / np.sum(ds1)
ds1 = np.diff(data, 1)
p1 = np.abs(ds1) / np.abs(np.sum(ds1))

# Calculation of entropy
h1 = -p1 * np.log(p1)
h1s = np.sum(h1)

# Calculation of penalty
fr = p1
fr = data
fr[fr >= 0] = 0
fr[fr < 0] = 1
pr = gamma * np.sum(fr * p1**2)
pr = gamma * np.sum(fr * data**2)

return h1s + pr

Expand Down

0 comments on commit bf24986

Please sign in to comment.