From 08bf9c8f12553bdf5d35037d415cf1cafe5218b3 Mon Sep 17 00:00:00 2001 From: James Kerns Date: Tue, 31 Oct 2023 08:39:38 -0500 Subject: [PATCH] change position of check --- pylinac/core/profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylinac/core/profile.py b/pylinac/core/profile.py index 5161e119..747fae36 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: