From 71c82ef647f915e912e00c9c5595707ce28c7c94 Mon Sep 17 00:00:00 2001 From: Saransh Singh Date: Fri, 3 May 2024 17:06:43 -0700 Subject: [PATCH] still not corrected. --- hexrd/wppf/WPPF.py | 2 +- hexrd/wppf/phase.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hexrd/wppf/WPPF.py b/hexrd/wppf/WPPF.py index 45a326925..b93ee0fab 100644 --- a/hexrd/wppf/WPPF.py +++ b/hexrd/wppf/WPPF.py @@ -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): """ diff --git a/hexrd/wppf/phase.py b/hexrd/wppf/phase.py index fe6c81505..48f9dc08c 100644 --- a/hexrd/wppf/phase.py +++ b/hexrd/wppf/phase.py @@ -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):