diff --git a/pylinac/core/profile.py b/pylinac/core/profile.py index 5161e1195..747fae364 100644 --- a/pylinac/core/profile.py +++ b/pylinac/core/profile.py @@ -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, @@ -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: