Trying to use radial_velocity, doesn't look right

Hi all, I'm trying to use "gas", "radial velocity" to compare inflows and outflows in a simulation, but the results don't really look right. using radial_velocity as a binary field, I defined new fields as follows def inflow_density(field,data): tr = data['gas','density']*((data['gas','radial_velocity'])<0).astype(float) return tr def outflow_density(field,data): tr = data['gas','density']*((data['gas','radial_velocity'])>0).astype(float) return tr A ProjectionPlot gives one side which is all inflow, one side which is all outflow. This resembles what you get if you have an incorrect bulk_velocity field, but when I correct for it like this sp = ds.sphere(center, (Rvir, "kpc")) bulk_velocity = sp.quantities.bulk_velocity() plot = yt.ProjectionPlot(ds, 0, center=center, fields=('gas','inflow_density'), width = (w,"kpc"), field_parameters={'bulk_velocity':bulk_velocity}) it doesn't change at all. Am I using this right? Thanks, Clayton

Hi Clayton, Is it possible that this is related to a recent pull request John ZuHone issued to fix some lingering bugs? https://github.com/yt-project/yt/pull/2338 On Tue, Sep 24, 2019 at 6:53 PM Clayton Strawn via yt-users <yt-users@python.org> wrote:
Hi all, I'm trying to use "gas", "radial velocity" to compare inflows and outflows in a simulation, but the results don't really look right.
using radial_velocity as a binary field, I defined new fields as follows
def inflow_density(field,data): tr = data['gas','density']*((data['gas','radial_velocity'])<0).astype(float) return tr def outflow_density(field,data): tr = data['gas','density']*((data['gas','radial_velocity'])>0).astype(float) return tr
A ProjectionPlot gives one side which is all inflow, one side which is all outflow. This resembles what you get if you have an incorrect bulk_velocity field, but when I correct for it like this
sp = ds.sphere(center, (Rvir, "kpc")) bulk_velocity = sp.quantities.bulk_velocity() plot = yt.ProjectionPlot(ds, 0, center=center, fields=('gas','inflow_density'), width = (w,"kpc"), field_parameters={'bulk_velocity':bulk_velocity})
it doesn't change at all. Am I using this right?
Thanks, Clayton _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

This would only apply to SPH data.
On Sep 30, 2019, at 11:42 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Clayton,
Is it possible that this is related to a recent pull request John ZuHone issued to fix some lingering bugs?
https://github.com/yt-project/yt/pull/2338
On Tue, Sep 24, 2019 at 6:53 PM Clayton Strawn via yt-users <yt-users@python.org> wrote:
Hi all, I'm trying to use "gas", "radial velocity" to compare inflows and outflows in a simulation, but the results don't really look right.
using radial_velocity as a binary field, I defined new fields as follows
def inflow_density(field,data): tr = data['gas','density']*((data['gas','radial_velocity'])<0).astype(float) return tr def outflow_density(field,data): tr = data['gas','density']*((data['gas','radial_velocity'])>0).astype(float) return tr
A ProjectionPlot gives one side which is all inflow, one side which is all outflow. This resembles what you get if you have an incorrect bulk_velocity field, but when I correct for it like this
sp = ds.sphere(center, (Rvir, "kpc")) bulk_velocity = sp.quantities.bulk_velocity() plot = yt.ProjectionPlot(ds, 0, center=center, fields=('gas','inflow_density'), width = (w,"kpc"), field_parameters={'bulk_velocity':bulk_velocity})
it doesn't change at all. Am I using this right?
Thanks, Clayton _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (3)
-
Clayton Strawn
-
John ZuHone
-
Matthew Turk