<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 4:41 AM, Reju Sam John <span dir="ltr"><<a href="mailto:rejusamjohn@gmail.com" target="_blank">rejusamjohn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div><br></div><div>I tried the following defination of Particle Velocity Magnitude without bulk velocity correction.</div><div><br></div><div><font face="monospace, monospace" size="4">def _<wbr>ParticleVelocityMagnitudenoBVc<wbr>or(field, data):</font></div><div><font face="monospace, monospace" size="4"> </font></div><div><font face="monospace, monospace" size="4"> return ( data["particle_velocity_x"]**<wbr>2.0 + \</font></div><div><font face="monospace, monospace" size="4"> data["particle_velocity_y"]**<wbr>2.0 + \</font></div><div><font face="monospace, monospace" size="4"> data["particle_velocity_z"]**<wbr>2.0 )**(1.0/2.0)</font></div><div><font face="monospace, monospace" size="4"><br></font></div><div><font face="monospace, monospace" size="4">add_field("<wbr>ParticleVelocityMagnitudenoBVc<wbr>or", function=_<wbr>ParticleVelocityMagnitudenoBVc<wbr>or, take_log=False, units=r"\rm{cm/s}" )</font></div></div></blockquote><div><br></div><div>This is a particle field so you need to specify that in your add_field call. Try adding particle_type=True.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>and tried to calculate the weighted average value of it with the following line<div><br></div><div><font face="monospace, monospace" size="4">vrms_dm_no_bv_cor = sphere.quantities["<wbr>WeightedAverageQuantity"]("<wbr>ParticleVelocityMagnitudenoBVc<wbr>or", "ParticleMass")</font></div><div><br></div><div>But I am getting the following error </div><div><br></div><div><font face="monospace, monospace" size="4">IndexError: too many indices for array </font></div><div><br></div><div>What could be the reason? How can I compute Particle Velocity Magnitude without bulk velocity correction?</div><div><br></div><div>Thanks <span class="HOEnZb"><font color="#888888"><br><div><div>-- <br><div class="m_-4917864239097954245gmail_signature"><div dir="ltr">Reju Sam John</div></div>
</div></div></font></span></div></div>
<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div></div>