stonnes@gmail.comOkay, 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 TonnesenAssociate Research ScientistCCA, Flatiron InstituteNew York, NYOn Fri, Feb 26, 2021 at 9:41 AM Matthew Turk <matthewturk@gmail.com> wrote:Hi Stephanie,Hmm, this is curious. My first inclination is to suggest comparing the particle_index or particle_ones fields rather than mass, to make sure we're looking at precisely the same information. If that's not the culprit, then we should investigate if the *grids* are being passed over by sphere selection or if the particles themselves are._______________________________________________On Thu, Feb 25, 2021 at 3:00 PM Stephanie Tonnesen <stonnes@gmail.com> wrote:Hi yt-users,_______________________________________________I have a question about spheres, because I am having a problem that I don't really know how to solve. Basically, I have clusters of stars, and I want to know how many stars are within 6 pc of each star. So, what I have done is taken a sphere at each star position with a radius of 6 pc, and then performedsp.quantities.total_quantity(["particle_mass"])Now I wanted to double-check this number by brute-force, so I calculated the distance between all the particles and then summed the masses of all the particles that were less than 6 pc.I am not getting the same values--they are close, but not the same (they seem to mostly scatter up or down by a factor of 2).So...to the question!! Because I am measuring particles in a grid code (Enzo) is there any sort of shifting to the grid position instead of using the particle positions here? Because stars are pretty packed I could imagine that this could cause the differences I am seeing.I am not sure that the problem is not something silly I am doing, but wanted to check this possibility as well.Thanks!Stephaniestonnes@gmail.com--
Dr. Stephanie TonnesenAssociate Research ScientistCCA, Flatiron InstituteNew York, NY
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: matthewturk@gmail.com
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: stonnes@gmail.com