Particle Velocity Magnitude without bulk velocity correction
Dear all, I tried the following defination of Particle Velocity Magnitude without bulk velocity correction. def _ParticleVelocityMagnitudenoBVcor(field, data): return ( data["particle_velocity_x"]**2.0 + \ data["particle_velocity_y"]**2.0 + \ data["particle_velocity_z"]**2.0 )**(1.0/2.0) add_field("ParticleVelocityMagnitudenoBVcor", function=_ParticleVelocityMagnitudenoBVcor, take_log=False, units=r"\rm{cm/s}" ) and tried to calculate the weighted average value of it with the following line vrms_dm_no_bv_cor = sphere.quantities["WeightedAverageQuantity"]("ParticleVelocityMagnitudenoBVcor", "ParticleMass") But I am getting the following error IndexError: too many indices for array What could be the reason? How can I compute Particle Velocity Magnitude without bulk velocity correction? Thanks -- Reju Sam John
On Wed, Mar 29, 2017 at 4:41 AM, Reju Sam John <rejusamjohn@gmail.com> wrote:
Dear all,
I tried the following defination of Particle Velocity Magnitude without bulk velocity correction.
def _ParticleVelocityMagnitudenoBVcor(field, data):
return ( data["particle_velocity_x"]**2.0 + \ data["particle_velocity_y"]**2.0 + \ data["particle_velocity_z"]**2.0 )**(1.0/2.0)
add_field("ParticleVelocityMagnitudenoBVcor", function=_ ParticleVelocityMagnitudenoBVcor, take_log=False, units=r"\rm{cm/s}" )
This is a particle field so you need to specify that in your add_field call. Try adding particle_type=True.
and tried to calculate the weighted average value of it with the following line
vrms_dm_no_bv_cor = sphere.quantities["WeightedAverageQuantity"](" ParticleVelocityMagnitudenoBVcor", "ParticleMass")
But I am getting the following error
IndexError: too many indices for array
What could be the reason? How can I compute Particle Velocity Magnitude without bulk velocity correction?
Thanks -- Reju Sam John
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Thanks Nathan.. It working 😊😊 On Wed, Mar 29, 2017 at 8:27 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Wed, Mar 29, 2017 at 4:41 AM, Reju Sam John <rejusamjohn@gmail.com> wrote:
Dear all,
I tried the following defination of Particle Velocity Magnitude without bulk velocity correction.
def _ParticleVelocityMagnitudenoBVcor(field, data):
return ( data["particle_velocity_x"]**2.0 + \ data["particle_velocity_y"]**2.0 + \ data["particle_velocity_z"]**2.0 )**(1.0/2.0)
add_field("ParticleVelocityMagnitudenoBVcor", function=_ParticleVelocityMagnitudenoBVcor, take_log=False, units=r"\rm{cm/s}" )
This is a particle field so you need to specify that in your add_field call. Try adding particle_type=True.
and tried to calculate the weighted average value of it with the following line
vrms_dm_no_bv_cor = sphere.quantities["WeightedAve rageQuantity"]("ParticleVelocityMagnitudenoBVcor", "ParticleMass")
But I am getting the following error
IndexError: too many indices for array
What could be the reason? How can I compute Particle Velocity Magnitude without bulk velocity correction?
Thanks -- Reju Sam John
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Reju Sam John
participants (2)
-
Nathan Goldbaum -
Reju Sam John