Skip to content

Commit

Permalink
Refs #11. force DOS to be positive
Browse files Browse the repository at this point in the history
  • Loading branch information
yxqd committed May 11, 2016
1 parent cf02fee commit 23fd3ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions multiphonon/backward/singlephonon_sqe2dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def sqe2dos(sqe, T, Ecutoff, elastic_E_cutoff, M):
# clean up data near elastic line
n_small_E = (Eplus<elastic_E_cutoff[1]).sum()
dos[:n_small_E] = Eplus[:n_small_E] ** 2 * dos[n_small_E] / Eplus[n_small_E]**2
# keep positive
dos[dos<0] = 0
# normalize
dos /= dos.sum()*dE
dos_error = dos * dos_relative_error
Expand Down

0 comments on commit 23fd3ee

Please sign in to comment.