parameters: (workspace, normalization, indices=None, withError=False)
return_statement: return dim_arrays, data, err
docstring: Generic function to extract data from an MDHisto workspace
  
      :param workspace: :class:`mantid.api.IMDHistoWorkspace` containing data
      :param normalization: if :class:`mantid.api.MDNormalization.NumEventsNormalization`
          it will divide intensity by the number of corresponding MDEvents
      :param indices: slice indices to select data
      :param withError: flag for if the error is calculated. If False, err is returned as None
  
      returns a tuple containing bin boundaries for each dimension, the (maybe normalized)
      signal and error arrays
docstring_summary: Generic function to extract data from an MDHisto workspace
docstring_tokens: Generic function to extract data from an MDHisto workspace
function: def get_md_data(workspace, normalization, indices=None, withError=False):
      """
      Generic function to extract data from an MDHisto workspace
  
      :param workspace: :class:`mantid.api.IMDHistoWorkspace` containing data
      :param normalization: if :class:`mantid.api.MDNormalization.NumEventsNormalization`
          it will divide intensity by the number of corresponding MDEvents
      :param indices: slice indices to select data
      :param withError: flag for if the error is calculated. If False, err is returned as None
  
      returns a tuple containing bin boundaries for each dimension, the (maybe normalized)
      signal and error arrays
      """
      if indices is None:
          dims = workspace.getNonIntegratedDimensions()
          indices = Ellipsis
      else:
          dims = [workspace.getDimension(n) for n in range(workspace.getNumDims()) if indices[n] == slice(None)]
      dim_arrays = [_dim2array(d) for d in dims]
      # get data
      data = workspace.getSignalArray()[indices].copy()
      if normalization == mantid.api.MDNormalization.NumEventsNormalization:
          nev = workspace.getNumEventsArray()[indices]
          data /= nev
      err = None
      if withError:
          err2 = workspace.getErrorSquaredArray()[indices].copy()
          if normalization == mantid.api.MDNormalization.NumEventsNormalization:
              err2 /= (nev * nev)
          err = np.sqrt(err2)
      data = data.squeeze().T
      data = np.ma.masked_invalid(data)
      if err is not None:
          err = err.squeeze().T
          err = np.ma.masked_invalid(err)
      return dim_arrays, data, err
function_tokens: def get_md_data ( workspace , normalization , indices = None , withError = False ) : if indices is None : dims = workspace . getNonIntegratedDimensions ( ) indices = Ellipsis else : dims = [ workspace . getDimension ( n ) for n in range ( workspace . getNumDims ( ) ) if indices [ n ] == slice ( None ) ] dim_arrays = [ _dim2array ( d ) for d in dims ] # get data data = workspace . getSignalArray ( ) [ indices ] . copy ( ) if normalization == mantid . api . MDNormalization . NumEventsNormalization : nev = workspace . getNumEventsArray ( ) [ indices ] data /= nev err = None if withError : err2 = workspace . getErrorSquaredArray ( ) [ indices ] . copy ( ) if normalization == mantid . api . MDNormalization . NumEventsNormalization : err2 /= ( nev * nev ) err = np . sqrt ( err2 ) data = data . squeeze ( ) . T data = np . ma . masked_invalid ( data ) if err is not None : err = err . squeeze ( ) . T err = np . ma . masked_invalid ( err ) return dim_arrays , data , err