diff --git a/unpackaged/vesuvio_calibration/calibration_scripts/calibrate_vesuvio_helper_functions.py b/unpackaged/vesuvio_calibration/calibration_scripts/calibrate_vesuvio_helper_functions.py index ae86398e..9964e22a 100644 --- a/unpackaged/vesuvio_calibration/calibration_scripts/calibrate_vesuvio_helper_functions.py +++ b/unpackaged/vesuvio_calibration/calibration_scripts/calibrate_vesuvio_helper_functions.py @@ -257,19 +257,25 @@ def identify_and_set_invalid_detectors_from_range(self, detector_range, peak_tab if not self._detectors_preset and not self._invalid_detectors_front.any(): self._invalid_detectors_front = self._identify_invalid_spectra(peak_table, peak_centres, peak_centres_errors, detector_range) - self._print_invalid_detectors(self._invalid_detectors_front, detector_range) + self._print_invalid_detectors(front_detector_range=True) return self._invalid_detectors_front elif detector_range == EVSGlobals.BACKSCATTERING_RANGE: if not self._detectors_preset and not self._invalid_detectors_back.any(): self._invalid_detectors_back = self._identify_invalid_spectra(peak_table, peak_centres, peak_centres_errors, detector_range) - self._print_invalid_detectors(self._invalid_detectors_back, detector_range) + self._print_invalid_detectors(front_detector_range=False) return self._invalid_detectors_back else: raise AttributeError("Spec list invalid - must represent either front or back detectors.") - @staticmethod - def _print_invalid_detectors(invalid_detectors, detector_range): + def _print_invalid_detectors(self, front_detector_range): + if front_detector_range: + invalid_detectors = self._invalid_detectors_front + detector_range = EVSGlobals.FRONTSCATTERING_RANGE + else: + invalid_detectors = self._invalid_detectors_back + detector_range = EVSGlobals.BACKSCATTERING_RANGE + print(f'Invalid Spectra Index Found and Marked NAN: {invalid_detectors} from Spectra Index List:' f'{[x - EVSGlobals.DETECTOR_RANGE[0] for x in detector_range]}')