[yt-users] Gadget velocity question

Nathan Goldbaum nathan12343 at gmail.com
Mon Oct 17 13:34:00 PDT 2016


Hi Jared!

On Mon, Oct 17, 2016 at 3:20 PM, Jared Coughlin <Jared.W.Coughlin.29 at nd.edu>
wrote:

> Hello! Just a quick question about the gadget velocities. For cosmological
> simulations, the default gadget snapshot does not actually contain the
> peculiar velocities v_pec, but, rather, the quantity u, where v_pec = u *
> sqrt(a), and a is the scale factor. My question is this: When I do:
>
> ds = yt.load("snapshot")
>
> and then access the velocity field, is yt giving me u or v_pec? That is,
> is yt doing the conversion from u to v_pec behind the scenes or not? I
> tried looking in the source code to find some conversion, but I didn't
> really know where to look.  Thanks!
>

"code" velocity units will include the factor of sqrt(a) for cosmology
simulations:

https://bitbucket.org/yt_analysis/yt/src/f7ef0effe08bb79cd7a1d3ef4126975957d870b9/yt/frontends/gadget/data_structures.py?at=yt&fileviewer=file-view-default#data_structures.py-248

You can see for yourself what impact this has by taking a look at the
velocity fields in a gadget dataset:

http://paste.yt-project.org/show/6882/

"universal" yt fields [like ('gas', 'velocity_x'), fields that are defined
in the same way for all frontends] will be returned in CGS, but the
conversion factor will have already been applied.

In general, it's safe to trust the units of the return value of a field
access in yt :)


> -Jared
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20161017/ac6ff006/attachment.htm>


More information about the yt-users mailing list