parameters: (self, ws, curves)
docstring: Expects a workspace in ToF units. All operations are done in-place (the workspace is
          input/output). For every bank-curve pair, divides the corresponding spectra in the
          workspace by the (simulated) fitted curve. The division is done in d-spacing (the
          input workspace is converted to d-spacing inside this method, but results are converted
          back to ToF before returning from this method). The curves workspace is expected in
          d-spacing units (since it comes from fitting a sum of spectra for a bank or group of
          detectors).
  
          This method is capable of dealing with workspaces with range and bin size different from
          the range and bin size of the curves. It will rebin the curves workspace to match the
          input 'ws' workspace (using the algorithm RebinToWorkspace).
  
          @param ws :: workspace with (sample) spectra to divide by curves fitted to Vanadium spectra
  
          @param curves :: dictionary of fitting workspaces (in d-spacing), one per bank. The keys are
          the bank identifier and the values are their fitting workspaces. The fitting workspaces are
          expected as returned by the algorithm 'Fit': 3 spectra: original data, simulated data with fit,
          difference between original and simulated data.
docstring_summary: Expects a workspace in ToF units. All operations are done in-place (the workspace is
          input/output). For every bank-curve pair, divides the corresponding spectra in the
          workspace by the (simulated) fitted curve. The division is done in d-spacing (the
          input workspace is converted to d-spacing inside this method, but results are converted
          back to ToF before returning from this method). The curves workspace is expected in
          d-spacing units (since it comes from fitting a sum of spectra for a bank or group of
          detectors).
docstring_tokens: Expects a workspace in ToF units . All operations are done in - place ( the workspace is input / output ) . For every bank - curve pair divides the corresponding spectra in the workspace by the ( simulated ) fitted curve . The division is done in d - spacing ( the input workspace is converted to d - spacing inside this method but results are converted back to ToF before returning from this method ) . The curves workspace is expected in d - spacing units ( since it comes from fitting a sum of spectra for a bank or group of detectors ) .
function: def _divide_by_curves(self, ws, curves):
          """
          Expects a workspace in ToF units. All operations are done in-place (the workspace is
          input/output). For every bank-curve pair, divides the corresponding spectra in the
          workspace by the (simulated) fitted curve. The division is done in d-spacing (the
          input workspace is converted to d-spacing inside this method, but results are converted
          back to ToF before returning from this method). The curves workspace is expected in
          d-spacing units (since it comes from fitting a sum of spectra for a bank or group of
          detectors).
  
          This method is capable of dealing with workspaces with range and bin size different from
          the range and bin size of the curves. It will rebin the curves workspace to match the
          input 'ws' workspace (using the algorithm RebinToWorkspace).
  
          @param ws :: workspace with (sample) spectra to divide by curves fitted to Vanadium spectra
  
          @param curves :: dictionary of fitting workspaces (in d-spacing), one per bank. The keys are
          the bank identifier and the values are their fitting workspaces. The fitting workspaces are
          expected as returned by the algorithm 'Fit': 3 spectra: original data, simulated data with fit,
          difference between original and simulated data.
          """
          # Note that this division could use the algorithm 'Divide'
          # This is simple and more efficient than using divide workspace, which requires
          # cropping separate workspaces, dividing them separately, then appending them
          # with AppendSpectra, etc.
          ws = EnggUtils.convert_to_d_spacing(self, ws)
          for b in curves:
              # process all the spectra (indices) in one bank
              fitted_curve = curves[b]
              idxs = EnggUtils.get_ws_indices_for_bank(ws, b)
  
              if not idxs:
                  pass
  
              # This RebinToWorkspace is required here: normal runs will have narrower range of X values,
              # and possibly different bin size, as compared to (long) Vanadium runs. Same applies to short
              # Ceria runs (for Calibrate -non-full) and even long Ceria runs (for Calibrate-Full).
              rebinned_fit_curve = mantid.RebinToWorkspace(WorkspaceToRebin=fitted_curve, WorkspaceToMatch=ws,
                                                           StoreInADS=False)
  
              for i in idxs:
                  # take values of the second spectrum of the workspace (fit simulation - fitted curve)
                  ws.setY(i, np.divide(ws.dataY(i), rebinned_fit_curve.readY(1)))
  
          # finally, convert back to ToF
          EnggUtils.convert_to_TOF(self, ws)
function_tokens: def _divide_by_curves ( self , ws , curves ) : # Note that this division could use the algorithm 'Divide' # This is simple and more efficient than using divide workspace, which requires # cropping separate workspaces, dividing them separately, then appending them # with AppendSpectra, etc. ws = EnggUtils . convert_to_d_spacing ( self , ws ) for b in curves : # process all the spectra (indices) in one bank fitted_curve = curves [ b ] idxs = EnggUtils . get_ws_indices_for_bank ( ws , b ) if not idxs : pass # This RebinToWorkspace is required here: normal runs will have narrower range of X values, # and possibly different bin size, as compared to (long) Vanadium runs. Same applies to short # Ceria runs (for Calibrate -non-full) and even long Ceria runs (for Calibrate-Full). rebinned_fit_curve = mantid . RebinToWorkspace ( WorkspaceToRebin = fitted_curve , WorkspaceToMatch = ws , StoreInADS = False ) for i in idxs : # take values of the second spectrum of the workspace (fit simulation - fitted curve) ws . setY ( i , np . divide ( ws . dataY ( i ) , rebinned_fit_curve . readY ( 1 ) ) ) # finally, convert back to ToF EnggUtils . convert_to_TOF ( self , ws )