diff --git a/src/cal_tools/agipdlib.py b/src/cal_tools/agipdlib.py
index 115a88a102e19745ccf6f39e38884438ab433efc..5c46384d01307e94dcf4c0d97048f5e93391062f 100644
--- a/src/cal_tools/agipdlib.py
+++ b/src/cal_tools/agipdlib.py
@@ -252,7 +252,7 @@ class AgipdCorrections:
         self.gain_mode = gain_mode
         self.comp_threads = comp_threads
 
-        self.pulses_lst = self._validate_selected_pulses(max_pulses, max_cells)
+        self._validate_selected_pulses(max_pulses, max_cells)
 
         # Correction parameters
         self.baseline_corr_noise_threshold = -1000
@@ -871,9 +871,6 @@ class AgipdCorrections:
         :param max_pulses: a list of at most 3 elements defining the
         range of pulses to calibrate.
         :param max_cells: operating memory cells.
-
-        :return :
-           - pulses_list: a list of pulses to calibrate.
         """
 
         # Validate selected pulses range:
@@ -888,41 +885,41 @@ class AgipdCorrections:
                 "maximum pulse."
             )
 
-        # Create list of pulses out of selected range.
-        try:
-            pulses_lst = (
-                list(range(*pulses_range))
-                if pulses_range != [0]
-                else pulses_range
-            )
-        except TypeError as e:
-            print(
-                f"ERROR: Wrong type for \"max_pulses\": {max_pulses}."
-                f"\n{traceback.format_exc()}"
-            )
+        value_error = False
+        if len(pulses_range) == 1:
+            self.start = 0
+            self.last = pulses_range[0]
+            self.step = 1
+        elif len(pulses_range) == 2:
+            self.start = pulses_range[0]
+            self.last = pulses_range[1]
+            self.step = 1
+            if pulses_range[0] > pulses_range[1]:
+                value_error = True
+        elif len(pulses_range) == 3:
+            self.start = pulses_range[0]
+            self.last = pulses_range[1]
+            self.step = pulses_range[2]
+            if pulses_range[0] > pulses_range[1]:
+                value_error = True
+        else:
+            value_error = True
 
-        try:
-            if len(pulses_lst) > 1:
-                print(
-                    f"A range of {len(pulses_lst)} pulse indices "
-                    f"is selected: from {pulses_lst[0]} to "
-                    f"{pulses_lst[-1] +(pulses_lst[1] - pulses_lst[0])}"
-                    f" with a step of {pulses_lst[1] - pulses_lst[0]}."
-                )
-            else:
-                print(
-                    "One pulse is selected: a pulse of idx"
-                    f" {pulses_lst[0]}."
-                )
-        except ValueError as e:
-            print(
-                f"ERROR: A list of pulses: {pulses_lst}, is given to"
-                "calibrate. Please check the given value for "
-                f"\"max_pulses\": {max_pulses}.\n"
-                f"{traceback.format_exc()}."
-            )
+        if value_error:
+            raise ValueError(
+                "ERROR: Wrong given range of pulse indices to correct. "
+                "Please check the given range for \"max_pulses\":"
+                f"{max_pulses}. \"max_pulses\" needs to be a list of "
+                "3 elements, [start, last, step]")
+
+        if not np.all([isinstance(p, int) for p in max_pulses]):
+            raise TypeError(
+                    "ERROR: \"max_pulses\" elements needs to be integers:"
+                    f" {max_pulses}.")
 
-        return pulses_lst
+        print(
+            "A range of pulse indices is selected to correct:"
+            f" {pulses_range}")
 
     def choose_selected_pulses(self, allpulses: np.array,
                                can_calibrate: np.array) -> np.array:
@@ -939,27 +936,17 @@ class AgipdCorrections:
                                selected pulses
         """
 
-        # collect the pulses to be calibrated
-        cal_pulses = allpulses[self.pulses_lst]
-
-        # Check if a non-contiguous pulses list will be calibrated.
-        if (
-            len(self.pulses_lst) > 1 and
-            self.pulses_lst[1] - self.pulses_lst[0] > 1
-        ):
-            can_calibrate = np.logical_and(
-                can_calibrate,
-                np.isin(allpulses, cal_pulses),
-            )
-        else:
-            # Check interesection between array of booleans and
-            # array of pulses to calibrate.
-            can_calibrate = np.logical_and(
+        # Check interesection between array of booleans and
+        # array of pulses to calibrate.
+        can_calibrate = np.logical_and(
+            np.logical_and(
                 can_calibrate,
-                (allpulses <= np.max(cal_pulses)),
-                (allpulses >= np.min(cal_pulses)),
-            )
-
+                np.logical_and(
+                    allpulses >= allpulses[self.start],
+                    allpulses <= allpulses[self.last-1]),
+            ),
+            ((allpulses - allpulses[self.start]) % allpulses[self.step]) == 0,
+        )
         return can_calibrate
 
     def gen_valid_range(self, first_index: int, last_index: int,