Hello everyone,
I am analyzing cosmological simulations with yt and I am trying to filter data by the radial velocity of a sphere with a defined center. I set the bulk velocity of the sphere using
v = sphere.quantities.bulk_velocity() sphere.set_field_parameter('bulk_velocity',v)
However, the numbers that I am having to input in order to filter out the data are extremely large even after setting the bulk velocity. Then I calculated the mean velocity of the sphere:
vx = sphere.mean('velocity_x',weight='density') vy = sphere.mean('velocity_y',weight='density') vz = sphere.mean('velocity_z',weight='density')
but even after setting the bulk velocity, the mean velocity of the sphere is not even close to being zero. The exact output is:
The bulk velocity is: [ 3629508.65339038 15948968.49831905 6561226.69040721] cm/s The mean velocity after setting bulk velocity is: [ 3495226.24285729 16714324.95702405 5505530.59033089] cm/s
I'm curious if I'm doing something simple wrong or if there is a bigger issue. Any help would be much appreciated!
Thank you! Trevor Fush
Hi Trevor,
You should use these fields instead:
“relative_velocity_x” “relative_velocity_y” “relative_velocity_z”
the original velocities are left untouched when one sets the bulk velocity. Other derived quantities (velocity_magnitude, etc) use these “relative” fields in their computations.
John
On Aug 28, 2019, at 10:57 AM, trevorfush13@gmail.com wrote:
Hello everyone,
I am analyzing cosmological simulations with yt and I am trying to filter data by the radial velocity of a sphere with a defined center. I set the bulk velocity of the sphere using
v = sphere.quantities.bulk_velocity() sphere.set_field_parameter('bulk_velocity',v)
However, the numbers that I am having to input in order to filter out the data are extremely large even after setting the bulk velocity. Then I calculated the mean velocity of the sphere:
vx = sphere.mean('velocity_x',weight='density') vy = sphere.mean('velocity_y',weight='density') vz = sphere.mean('velocity_z',weight='density')
but even after setting the bulk velocity, the mean velocity of the sphere is not even close to being zero. The exact output is:
The bulk velocity is: [ 3629508.65339038 15948968.49831905 6561226.69040721] cm/s The mean velocity after setting bulk velocity is: [ 3495226.24285729 16714324.95702405 5505530.59033089] cm/s
I'm curious if I'm doing something simple wrong or if there is a bigger issue. Any help would be much appreciated!
Thank you! Trevor Fush _______________________________________________ ytusers mailing list  ytusers@python.org To unsubscribe send an email to ytusersleave@python.org
участники (2)

John Zuhone

trevorfush13＠gmail.com