code: def _write_particle_information(gsd_file, structure, xyz, ref_distance,
          ref_mass, ref_energy, rigid_bodies):
      
  
      gsd_file.particles.N = len(structure.atoms)
      gsd_file.particles.position = xyz / ref_distance
  
      types = [atom.name if atom.type == '' else atom.type
               for atom in structure.atoms]
  
      unique_types = list(set(types))
      unique_types.sort(key=natural_sort)
      gsd_file.particles.types = unique_types
  
      typeids = np.array([unique_types.index(t) for t in types])
      gsd_file.particles.typeid = typeids
  
      masses = np.array([atom.mass for atom in structure.atoms])
      masses[masses==0] = 1.0
      gsd_file.particles.mass = masses / ref_mass
  
      charges = np.array([atom.charge for atom in structure.atoms])
      e0 = 2.39725e-4
      '''
      Permittivity of free space = 2.39725e-4 e^2/((kcal/mol)(angstrom)),
      where e is the elementary charge
      '''
      charge_factor = (4.0*np.pi*e0*ref_distance*ref_energy)**0.5
      gsd_file.particles.charge = charges / charge_factor
  
      if rigid_bodies:
          rigid_bodies = [-1 if body is None else body for body in rigid_bodies]
      gsd_file.particles.body = rigid_bodies
docs: Write out the particle information.