original_docstring: 
      Grid's positional data by trying to match each point to the nearest grid
      point. Nreps is calculated and enforced by throwing away any data that
      overfills a gridpoint.
      
docstring: Grid's positional data by trying to match each point to the nearest grid
  point. Nreps is calculated and enforced by throwing away any data that
  overfills a gridpoint.
docstring_tokens: Grid ' s positional data by trying to match each point to the nearest grid point . Nreps is calculated and enforced by throwing away any data that overfills a gridpoint .
code: def fuzzyGrid(pos, xaxis, yaxis, zaxis, precision=0.1):
      """
      Grid's positional data by trying to match each point to the nearest grid
      point. Nreps is calculated and enforced by throwing away any data that
      overfills a gridpoint.
      """
      #Round to within the precision given
      #+0.0 prevents weird -0's being in the resulting array
      xpos = np.round(pos[:,0]/precision, 0)*precision + 0.0
      ypos = np.round(pos[:,1]/precision, 0)*precision + 0.0
      zpos = np.round(pos[:,2]/precision, 0)*precision + 0.0
      
      
      nx, ny, nz, nreps = calcNpoints(pos, xaxis, yaxis, zaxis)
      
      nshots = int(nx*ny*nz*nreps)
      
      
      #This array will be used to count the number of reps we've found in each place
      #that will make sure each one gets a unique rep number
      countgrid = np.zeros((nx,ny,nz))
      
  
      #This array will hold the grid indices for each shot
      shotindarr = np.zeros([nshots, 4],  dtype=np.int32)
      
      for i in range(nshots):
          xi = np.argmin( np.abs(xaxis - xpos[i]) )
          yi = np.argmin( np.abs(yaxis - ypos[i]) )
          zi = np.argmin( np.abs(zaxis - zpos[i]) )
          irep = countgrid[xi,yi,zi]
          
          # Only add up to nreps at each spot.
          # After that, shots will just be thrown away
          if irep < nreps:
              shotindarr[i,:] = np.array( (xi,yi,zi, irep )   )
              countgrid[xi,yi,zi] = countgrid[xi,yi,zi] + 1
  
      return shotindarr
code_tokens: def fuzzyGrid ( pos , xaxis , yaxis , zaxis , precision = 0.1 ) : xpos = np . round ( pos [ : , 0 ] / precision , 0 ) * precision + 0.0 ypos = np . round ( pos [ : , 1 ] / precision , 0 ) * precision + 0.0 zpos = np . round ( pos [ : , 2 ] / precision , 0 ) * precision + 0.0 nx , ny , nz , nreps = calcNpoints ( pos , xaxis , yaxis , zaxis ) nshots = int ( nx * ny * nz * nreps ) countgrid = np . zeros ( ( nx , ny , nz ) ) shotindarr = np . zeros ( [ nshots , 4 ] , dtype = np . int32 ) for i in range ( nshots ) : xi = np . argmin ( np . abs ( xaxis - xpos [ i ] ) ) yi = np . argmin ( np . abs ( yaxis - ypos [ i ] ) ) zi = np . argmin ( np . abs ( zaxis - zpos [ i ] ) ) irep = countgrid [ xi , yi , zi ] if irep < nreps : shotindarr [ i , : ] = np . array ( ( xi , yi , zi , irep ) ) countgrid [ xi , yi , zi ] = countgrid [ xi , yi , zi ] + 1 return shotindarr
short_docstring: Grid's positional data by trying to match each point to the nearest grid
  point.
short_docstring_tokens: Grid ' s positional data by trying to match each point to the nearest grid point .
comment: """
      Grid's positional data by trying to match each point to the nearest grid
      point. Nreps is calculated and enforced by throwing away any data that
      overfills a gridpoint.
      """$SEP$#Round to within the precision given
  $SEP$#+0.0 prevents weird -0's being in the resulting array
  $SEP$#This array will be used to count the number of reps we've found in each place
  $SEP$#that will make sure each one gets a unique rep number
  $SEP$#This array will hold the grid indices for each shot
  $SEP$# Only add up to nreps at each spot.
  $SEP$# After that, shots will just be thrown away
  