Skip to content

Commit

Permalink
Merge pull request #645 from HEXRD/Rietveld-fix
Browse files Browse the repository at this point in the history
Rietveld phase fraction fix
  • Loading branch information
saransh13 authored May 31, 2024
2 parents ae0a06d + 71c82ef commit 1589f7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hexrd/wppf/WPPF.py
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ def _set_params_vals_to_class(self, params, init=False, skip_phases=False):
if updated_lp or updated_atominfo:
self.calcsf()

self.phases.phase_fraction = pf
self.phases.phase_fraction = pf/np.sum(pf)

def _update_shkl(self, params):
"""
Expand Down
3 changes: 2 additions & 1 deletion hexrd/wppf/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,8 @@ def phase_fraction(self):
for k in self:
l = list(self.wavelength.keys())[0]
pf.append(self[k][l].pf)
return np.array(pf)
pf = np.array(pf)
return pf/np.sum(pf)

@phase_fraction.setter
def phase_fraction(self, val):
Expand Down

0 comments on commit 1589f7a

Please sign in to comment.