Skip to content

Commit

Permalink
fix: operate over ordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 12, 2024
1 parent b0d73a9 commit fcc1f98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pdf_agents/peakfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def fit_roi(self, xroi: tuple, fit_func: str, pos_percent_lim: float, maxcycles:
peak_gamma: float
Lorentzian broadening parameter
"""
roi_indices = np.where((self._recent_x >= xroi[0]) & (self._recent_x <= xroi[1]))
roi_indices = np.where((self._ordinate >= xroi[0]) & (self._ordinate <= xroi[1]))

x_roi = self._recent_x[roi_indices]
x_roi = self._ordinate[roi_indices]
y_roi = self._recent_y[roi_indices]

# find maximum y within ROI
Expand Down Expand Up @@ -313,6 +313,7 @@ def report(self) -> Dict[str, ArrayLike]:
norm_region=self.norm_region,
observable_uid=self._recent_uid,
independent_variable=self._recent_x,
ordinate=self._ordinate,
observable=self._recent_y,
xrois=self.xrois,
fit_func=self.fit_func,
Expand Down

0 comments on commit fcc1f98

Please sign in to comment.