Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rietveld phase fraction fix #645

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading