parameters: (self, spectrum_range_start, spectrum_range_stop)
docstring: An unusual setter in the state framework. We cannot just call an automatic setter, since we have to decide
          on which detector the spectrum range lives.
  
          :param spectrum_range_start: a list of start spectra which we need to set on the right detector
          :param spectrum_range_stop: a list of stop spectra which we need to set on the right detector
docstring_summary: An unusual setter in the state framework. We cannot just call an automatic setter, since we have to decide
          on which detector the spectrum range lives.
docstring_tokens: An unusual setter in the state framework . We cannot just call an automatic setter since we have to decide on which detector the spectrum range lives .
function: def set_spectrum_range_on_detector(self, spectrum_range_start, spectrum_range_stop):
          """
          An unusual setter in the state framework. We cannot just call an automatic setter, since we have to decide
          on which detector the spectrum range lives.
  
          :param spectrum_range_start: a list of start spectra which we need to set on the right detector
          :param spectrum_range_stop: a list of stop spectra which we need to set on the right detector
          """
          instrument = self._data.instrument
          for start, stop in zip(spectrum_range_start, spectrum_range_stop):
              detector_bank_start = get_bank_for_spectrum_number(start, instrument)
              detector_bank_stop = get_bank_for_spectrum_number(stop, instrument)
              if detector_bank_start != detector_bank_stop:
                  raise ValueError("The specified spectrum mask range S{0}{1} has spectra on more than one detector. "
                                   "Make sure that all spectra in the range are on a single detector".format(start, stop))
              else:
                  detector_mask_state = self.state.detectors[detector_bank_start.value]
                  spec_range_start = detector_mask_state.spectrum_range_start
                  spec_range_stop = detector_mask_state.spectrum_range_stop
                  # Set the start spectrum range
                  if spec_range_start is not None:
                      spec_range_start.append(start)
                  else:
                      self.state.detectors[detector_bank_start.value].spectrum_range_start = [start]
  
                  # Set the stop spectrum range
                  if spec_range_stop is not None:
                      spec_range_stop.append(stop)
                  else:
                      self.state.detectors[detector_bank_start.value].spectrum_range_stop = [stop]
function_tokens: def set_spectrum_range_on_detector ( self , spectrum_range_start , spectrum_range_stop ) : instrument = self . _data . instrument for start , stop in zip ( spectrum_range_start , spectrum_range_stop ) : detector_bank_start = get_bank_for_spectrum_number ( start , instrument ) detector_bank_stop = get_bank_for_spectrum_number ( stop , instrument ) if detector_bank_start != detector_bank_stop : raise ValueError ( "The specified spectrum mask range S{0}{1} has spectra on more than one detector. " "Make sure that all spectra in the range are on a single detector" . format ( start , stop ) ) else : detector_mask_state = self . state . detectors [ detector_bank_start . value ] spec_range_start = detector_mask_state . spectrum_range_start spec_range_stop = detector_mask_state . spectrum_range_stop # Set the start spectrum range if spec_range_start is not None : spec_range_start . append ( start ) else : self . state . detectors [ detector_bank_start . value ] . spectrum_range_start = [ start ] # Set the stop spectrum range if spec_range_stop is not None : spec_range_stop . append ( stop ) else : self . state . detectors [ detector_bank_start . value ] . spectrum_range_stop = [ stop ]