[yt-users] yt-hop: particle IDs question
Stephen Skory
stephenskory at yahoo.com
Wed May 13 16:01:04 PDT 2009
Michele,
> I am not interested in using fastBuildMerge.py, I am only looking for
> a list of particles IDs associated to each halo. I have my own code to
> track mergers.
There are several ways to get it.
If you want them from the interactive console, you can do something like this:
> from yt.mods import *
> pf = load('DD0130')
> haloes = HaloFinder(pf)
> particleIDs_biggest_halo = haloes[0]["particle_index"]
If want all the particles saved to disk, once you have the 'haloes' list
> haloes.write_paritcle_lists('parts')
This will write out a hdf5 file with the following information per halo:
login3% h5ls parts.h5/Halo00000060
particle_index Dataset {171}
particle_position_x Dataset {171}
particle_position_y Dataset {171}
particle_position_z Dataset {171}
particle_velocity_x Dataset {171}
particle_velocity_y Dataset {171}
particle_velocity_z Dataset {171}
The name of the hdf5 group uses the same ID as from the text file from .write_out().
Does that help?
_______________________________________________________
sskory at physics.ucsd.edu o__ Stephen Skory
http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student
________________________________(_)_\(_)_______________
More information about the yt-users
mailing list