parameters: (self, iteration, species,
                             species_filter="all", **kwargs)
docstring: Get a histogram.
  
          Parameters
          ----------
          species : string
              short name of the particle species, e.g. 'e' for electrons
              (defined in ``speciesDefinition.param``)
          species_filter: string
              name of the particle species filter, default is 'all'
              (defined in ``particleFilters.param``)
          iteration : (unsigned) int [unitless]
              The iteration at which to read the data.
              A list of iterations is allowed as well.
              ``None`` refers to the list of all available iterations.
          sum : float
              emittance value [m rad] without slicing
  
          Returns
          -------
          slice_emit : np.array of float
              slice emittance [m rad] for each y_slice
              If iteration is a list, returns (ordered) dict with
              iterations as its index.
          y_slices : np.array of float
              beginning of each slice [m]
          iteration : (unsigned) int [unitless]
              The iteration at which to read the data.
              A list of iterations is allowed as well.
          dt: float
              time for itteration
docstring_summary: Get a histogram.
docstring_tokens: Get a histogram .
function: def _get_for_iteration(self, iteration, species,
                             species_filter="all", **kwargs):
          """
          Get a histogram.
  
          Parameters
          ----------
          species : string
              short name of the particle species, e.g. 'e' for electrons
              (defined in ``speciesDefinition.param``)
          species_filter: string
              name of the particle species filter, default is 'all'
              (defined in ``particleFilters.param``)
          iteration : (unsigned) int [unitless]
              The iteration at which to read the data.
              A list of iterations is allowed as well.
              ``None`` refers to the list of all available iterations.
          sum : float
              emittance value [m rad] without slicing
  
          Returns
          -------
          slice_emit : np.array of float
              slice emittance [m rad] for each y_slice
              If iteration is a list, returns (ordered) dict with
              iterations as its index.
          y_slices : np.array of float
              beginning of each slice [m]
          iteration : (unsigned) int [unitless]
              The iteration at which to read the data.
              A list of iterations is allowed as well.
          dt: float
              time for itteration
          """
          if iteration is not None:
              if not isinstance(iteration, collections.Iterable):
                  iteration = np.array([iteration])
  
          data_file_path = self.get_data_path(species, species_filter)
  
          # read whole file as pandas.DataFrame
          data = pd.read_csv(
              data_file_path,
              delimiter=" "
          )
  
          # note: only reads first row and selects the valid emittance slices
          y_slices = pd.read_csv(
              data_file_path,
              comment=None,
              nrows=0,
              delimiter=" ",
              usecols=range(2, data.shape[1]),
              dtype=np.float64
          ).columns.values.astype(np.float64)
  
          # set DataFrame column names properly
          data.columns = [
              'iteration',
              'sum'
          ] + list(y_slices)
  
          # set iteration as index
          data.set_index('iteration', inplace=True)
  
          # all iterations requested
          if iteration is None:
              iteration = np.array(data.index.values)
  
          # verify requested iterations exist
          if not set(iteration).issubset(data.index.values):
              raise IndexError('Iteration {} is not available!\n'
                               'List of available iterations: \n'
                               '{}'.format(iteration, data.index.values))
          dt = self.get_dt()
          if len(iteration) > 1:
              return data.loc[iteration].values, y_slices, iteration, dt
          else:
              return data.loc[iteration].values[0, :], y_slices, iteration, dt
function_tokens: def _get_for_iteration ( self , iteration , species , species_filter = "all" , * * kwargs ) : if iteration is not None : if not isinstance ( iteration , collections . Iterable ) : iteration = np . array ( [ iteration ] ) data_file_path = self . get_data_path ( species , species_filter ) # read whole file as pandas.DataFrame data = pd . read_csv ( data_file_path , delimiter = " " ) # note: only reads first row and selects the valid emittance slices y_slices = pd . read_csv ( data_file_path , comment = None , nrows = 0 , delimiter = " " , usecols = range ( 2 , data . shape [ 1 ] ) , dtype = np . float64 ) . columns . values . astype ( np . float64 ) # set DataFrame column names properly data . columns = [ 'iteration' , 'sum' ] + list ( y_slices ) # set iteration as index data . set_index ( 'iteration' , inplace = True ) # all iterations requested if iteration is None : iteration = np . array ( data . index . values ) # verify requested iterations exist if not set ( iteration ) . issubset ( data . index . values ) : raise IndexError ( 'Iteration {} is not available!\n' 'List of available iterations: \n' '{}' . format ( iteration , data . index . values ) ) dt = self . get_dt ( ) if len ( iteration ) > 1 : return data . loc [ iteration ] . values , y_slices , iteration , dt else : return data . loc [ iteration ] . values [ 0 , : ] , y_slices , iteration , dt