Skip to content

Commit

Permalink
fix: phil adjustments for pak fitting to get reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Maffettone committed Apr 12, 2024
1 parent fcc1f98 commit 08f4b46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion pdf_agents/gsas.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def report(self) -> Dict[str, ArrayLike]:
data_key=self.data_key,
roi_key=self.roi_key if self.roi_key is not None else "",
roi=self.roi if self.roi is not None else "",
norm_region=self.norm_region if self.norm_region is not None else "",
observable_uid=self._recent_uid,
raw_independent_variable=self._recent_x,
observable=self._recent_y,
Expand Down
17 changes: 3 additions & 14 deletions pdf_agents/peakfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ def report(self) -> Dict[str, ArrayLike]:
peak_amplitudes = []
peak_positions = []
peak_fwhms = []
ycalcs = []
ydiffs = []
x_rois = []

if self.fit_func == "voigt":
Expand All @@ -288,9 +286,6 @@ def report(self) -> Dict[str, ArrayLike]:
peak_amplitudes.append(peak_amplitude)
peak_positions.append(peak_position)
peak_fwhms.append(peak_fwhm)
ycalcs.append(ycalc)
ydiffs.append(ydiff)
x_rois.append(x_roi)

elif self.fit_func == "gaussian" or self.fit_func == "lorentzian":
for xroi in self.xrois:
Expand All @@ -302,30 +297,24 @@ def report(self) -> Dict[str, ArrayLike]:
peak_amplitudes.append(peak_amplitude)
peak_positions.append(peak_position)
peak_fwhms.append(peak_fwhm)
ycalcs.append(ycalc)
ydiffs.append(ydiff)
x_rois.append(x_roi)

return dict(
data_key=self.data_key,
roi_key=self.roi,
roi=self.roi,
norm_region=self.norm_region,
roi_key=self.roi_key if self.roi_key is not None else "",
roi=self.roi if self.roi is not None else "",
observable_uid=self._recent_uid,
independent_variable=self._recent_x,
ordinate=self._ordinate,
observable=self._recent_y,
xrois=self.xrois,
peak_fit_rois=self.xrois,
fit_func=self.fit_func,
pos_percent_lim=self.pos_percent_lim,
maxcycles=self.maxcycles,
peak_amps_poss_fwhms=np.array(peak_amps_poss_fwhms),
peak_amplitudes=np.array(peak_amplitudes),
peak_positions=np.array(peak_positions),
peak_fwhms=np.array(peak_fwhms),
ycalc=np.array(ycalcs),
ydiffs=np.array(ydiffs),
x_rois=np.array(x_rois),
)

def ask(self, batch_size):
Expand Down

0 comments on commit 08f4b46

Please sign in to comment.