Okay, looking into this a bit more has led to two I think unrelated problems. One problem, which has to do with the sphere selection:
When I loop through my particles, the sphere centered on particle_index "3" only finds particle "3". However, the sphere centered on particle "8" includes particle "3". Also, my brute-force method finds that "8" is within 6 pc of "3".
Second, my particle identification method has a problem:
So I read in a file and then do this:
ds.add_particle_filter('stars')
ad = ds.all_data()
mass = ad[("stars","particle_mass")].in_units('Msun')
age = ad[("stars","age")].in_units('Myr')
ct = ad[("stars","creation_time")].in_units('Myr')
velz = ad[("stars","particle_velocity_z")].in_units('cm/s')
velx = ad[("stars","particle_velocity_x")].in_units('cm/s')
vely = ad[("stars","particle_velocity_y")].in_units('cm/s')
pid = ad[("stars","particle_index")]
px = ad[("stars","particle_position_x")].in_units('kpc')
pz = ad[("stars","particle_position_z")].in_units('kpc')
py = ad[("stars","particle_position_y")].in_units('kpc')
Then I save all this info to play around with later. NOW things get weird. When I search around the particles identified above using their positions and ds.sphere, I find particles that NEVER were identified! (I do not have DM particles in this simulation). Any thoughts on this problem, too?
Thanks in advance,
Stephanie
--
Dr. Stephanie Tonnesen