code: def return_dat(self, chan, begsam, endsam):
          
          #n_sam = self.hdr[4]
          interval = endsam - begsam
          dat = empty((len(chan), interval))
          
          #beg_block = floor((begsam / n_sam) * n_block)
          #end_block = floor((endsam / n_sam) * n_block)
                  
          for i, chan in enumerate(chan):
              k = 0
              
              with open(self.chan_files[chan], 'rt') as f:
                  f.readline()
                  
                  for j, datum in enumerate(f):
                      
                      if begsam <= j + 1 < endsam:
                          dat[i, k] = float64(datum)
                          k += 1
                          if k == interval:
                              break
          
          # calibration
          phys_range = self.phys_max - self.phys_min
          dig_range = self.dig_max - self.dig_min
          gain = phys_range / dig_range
          dat *= gain
          
          return dat
docs: Return the data as 2D numpy.ndarray.
  
          Parameters
          ----------
          chan : list of int
              index (indices) of the channels to read
          begsam : int
              index of the first sample (inclusively)
          endsam : int
              index of the last sample (exclusively)
  
          Returns
          -------
          numpy.ndarray
              A 2d matrix, with dimension chan X samples.