parameters: (self, sample_ws, det_efficiency_ws, nMeasurements, nComponents)
return_statement: return output_ws
docstring: Normalises the sample data using the detector efficiency calibration workspace.
docstring_summary: Normalises the sample data using the detector efficiency calibration workspace.
docstring_tokens: Normalises the sample data using the detector efficiency calibration workspace .
function: def _normalise_sample_data(self, sample_ws, det_efficiency_ws, nMeasurements, nComponents):
          """Normalises the sample data using the detector efficiency calibration workspace."""
          normalisation_method = self.getPropertyValue('NormalisationMethod')
          if normalisation_method == 'Vanadium' and self._mode == 'SingleCrystal' \
                  and mtd[sample_ws][0].getNumberHistograms() == 2 * mtd[det_efficiency_ws][0].getNumberHistograms():
              # the length of the spectrum axis is twice the size of Vanadium, as data comes from two omega scans
              AppendSpectra(InputWorkspace1=det_efficiency_ws, InputWorkspace2=det_efficiency_ws,
                            OutputWorkspace=det_efficiency_ws)
  
          single_eff_per_numor = False
          single_eff = False
          eff_entries = mtd[det_efficiency_ws].getNumberOfEntries()
          sample_entries = mtd[sample_ws].getNumberOfEntries()
          single_eff_per_twoTheta = False
          if eff_entries == 1:
              single_eff = True
          elif eff_entries != mtd[sample_ws].getNumberOfEntries() \
                  and eff_entries == (sample_entries / nComponents):
              single_eff_per_numor = True
          elif (sample_entries / nComponents) % eff_entries == 0:
              single_eff_per_twoTheta = True
          tmp_names = []
  
          for entry_no, entry in enumerate(mtd[sample_ws]):
              det_eff_no = entry_no
              if single_eff:
                  det_eff_no = 0
              elif single_eff_per_numor:
                  det_eff_no = entry_no % nMeasurements
              elif single_eff_per_twoTheta:
                  det_eff_no = self._find_matching_twoTheta(entry.name(), det_efficiency_ws)
              elif det_eff_no >= eff_entries:
                  det_eff_no = det_eff_no % eff_entries
              ws_name = entry.name() + '_normalised'
              tmp_names.append(ws_name)
              Divide(LHSWorkspace=entry,
                     RHSWorkspace=mtd[det_efficiency_ws][det_eff_no],
                     OutputWorkspace=ws_name)
          output_ws = self.getPropertyValue('OutputWorkspace')
          GroupWorkspaces(InputWorkspaces=tmp_names, Outputworkspace=output_ws)
          if self._debug:
              clone_name = '{}_absolute_scale'.format(output_ws)
              CloneWorkspace(InputWorkspace=output_ws, OutputWorkspace=clone_name)
          return output_ws
function_tokens: def _normalise_sample_data ( self , sample_ws , det_efficiency_ws , nMeasurements , nComponents ) : normalisation_method = self . getPropertyValue ( 'NormalisationMethod' ) if normalisation_method == 'Vanadium' and self . _mode == 'SingleCrystal' and mtd [ sample_ws ] [ 0 ] . getNumberHistograms ( ) == 2 * mtd [ det_efficiency_ws ] [ 0 ] . getNumberHistograms ( ) : # the length of the spectrum axis is twice the size of Vanadium, as data comes from two omega scans AppendSpectra ( InputWorkspace1 = det_efficiency_ws , InputWorkspace2 = det_efficiency_ws , OutputWorkspace = det_efficiency_ws ) single_eff_per_numor = False single_eff = False eff_entries = mtd [ det_efficiency_ws ] . getNumberOfEntries ( ) sample_entries = mtd [ sample_ws ] . getNumberOfEntries ( ) single_eff_per_twoTheta = False if eff_entries == 1 : single_eff = True elif eff_entries != mtd [ sample_ws ] . getNumberOfEntries ( ) and eff_entries == ( sample_entries / nComponents ) : single_eff_per_numor = True elif ( sample_entries / nComponents ) % eff_entries == 0 : single_eff_per_twoTheta = True tmp_names = [ ] for entry_no , entry in enumerate ( mtd [ sample_ws ] ) : det_eff_no = entry_no if single_eff : det_eff_no = 0 elif single_eff_per_numor : det_eff_no = entry_no % nMeasurements elif single_eff_per_twoTheta : det_eff_no = self . _find_matching_twoTheta ( entry . name ( ) , det_efficiency_ws ) elif det_eff_no >= eff_entries : det_eff_no = det_eff_no % eff_entries ws_name = entry . name ( ) + '_normalised' tmp_names . append ( ws_name ) Divide ( LHSWorkspace = entry , RHSWorkspace = mtd [ det_efficiency_ws ] [ det_eff_no ] , OutputWorkspace = ws_name ) output_ws = self . getPropertyValue ( 'OutputWorkspace' ) GroupWorkspaces ( InputWorkspaces = tmp_names , Outputworkspace = output_ws ) if self . _debug : clone_name = '{}_absolute_scale' . format ( output_ws ) CloneWorkspace ( InputWorkspace = output_ws , OutputWorkspace = clone_name ) return output_ws