parameters: (self, i, workspace, ws_index, funstr=None)
return_statement: return np.array(out.readX(0)), np.array(out.readY(1))
docstring: Calculate i-th spectrum.
  
          @param i: Index of a spectrum or function string
          @param workspace: A workspace used to evaluate the spectrum function.
          @param ws_index:  An index of a spectrum in workspace to use.
docstring_summary: Calculate i-th spectrum.
docstring_tokens: Calculate i - th spectrum .
function: def _calcSpectrum(self, i, workspace, ws_index, funstr=None):
          """Calculate i-th spectrum.
  
          @param i: Index of a spectrum or function string
          @param workspace: A workspace used to evaluate the spectrum function.
          @param ws_index:  An index of a spectrum in workspace to use.
          """
          alg = AlgorithmManager.createUnmanaged('EvaluateFunction')
          alg.initialize()
          alg.setChild(True)
          alg.setProperty('Function', i if isinstance(i, str) else self.makeSpectrumFunction(i))
          alg.setProperty("InputWorkspace", workspace)
          alg.setProperty('WorkspaceIndex', ws_index)
          alg.setProperty('OutputWorkspace', 'dummy')
          alg.execute()
          out = alg.getProperty('OutputWorkspace').value
          # Create copies of the x and y because `out` goes out of scope when this method returns
          # and x and y get deallocated
          return np.array(out.readX(0)), np.array(out.readY(1))
function_tokens: def _calcSpectrum ( self , i , workspace , ws_index , funstr = None ) : alg = AlgorithmManager . createUnmanaged ( 'EvaluateFunction' ) alg . initialize ( ) alg . setChild ( True ) alg . setProperty ( 'Function' , i if isinstance ( i , str ) else self . makeSpectrumFunction ( i ) ) alg . setProperty ( "InputWorkspace" , workspace ) alg . setProperty ( 'WorkspaceIndex' , ws_index ) alg . setProperty ( 'OutputWorkspace' , 'dummy' ) alg . execute ( ) out = alg . getProperty ( 'OutputWorkspace' ) . value # Create copies of the x and y because `out` goes out of scope when this method returns # and x and y get deallocated return np . array ( out . readX ( 0 ) ) , np . array ( out . readY ( 1 ) )