Skip to content

Commit

Permalink
change position of check
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkerns committed Oct 31, 2023
1 parent 939ca3d commit 08bf9c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pylinac/core/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,8 +1217,6 @@ def __init__(
values # set initial data so we can do things like find beam center
)
self.dpmm = dpmm
if np.diff(values).min() < 0:
raise ValueError("Profile values must be monotonically increasing")
fitted_values, new_dpmm, x_indices = self._interpolate(
values,
x_values,
Expand Down Expand Up @@ -1295,6 +1293,8 @@ def _interpolate(
"""Fit the data to the passed interpolation method. Will also calculate the new values to correct the measurements such as dpmm"""
if x_values is None:
x_values = np.array(range(len(values)))
if np.diff(x_values).min() < 0:
raise ValueError("Profile values must be monotonically increasing")
if interp_method == Interpolation.NONE:
return values, dpmm, x_values # do nothing
else:
Expand Down

0 comments on commit 08bf9c8

Please sign in to comment.