[yt-users] volume-weighted 1D profiles

Nathan Goldbaum nathan12343 at gmail.com
Wed Nov 18 18:39:36 PST 2015


On Wed, Nov 18, 2015 at 8:34 PM, Mateusz Ruszkowski <mateuszr at umich.edu>
wrote:

>
>
>    Hi,
>
> I am trying to understand how Profile1D works. I would like to produce a
> volume-weighted 1D profile in a sphere. For a uniform grid, even if the
> radial bins/shells are not spaced logarithmically (i.e., if they are spaced
> uniformly in r), there are obviously more zones in shells located at larger
> radii, so the volume effect should be accounted for automatically.
>
> So do I need specify weight_field = “cell_volume” in this case, or do I
> set it to “None” in order to generate a volume-weighted profile? That is,
> do I do this
>
>    prof = yt.Profile1D(sp, “r", rbins, prof_min, prof_max, True,
> weight_field="cell_volume”)
>

This will produce a volume weighted averaged of whatever field you profile
later.


>
> or
>
>    prof = yt.Profile1D(sp, “r", rbins, prof_min, prof_max, True,
> weight_field=“None”)
>
>
This will produce a profile of the total of the field to be profiled.


Which you want will depend on the analysis you want to do. For example, if
I wanted to find the volume weighted average density as a function of
radius, I would profile the 'density' field and use weight_field =
'cell_volume'. If I wanted to find the total mass in each radial bin as a
function of radius, I would profile the 'cell_mass' field and use
weight_field = None.


>
> Thanks,
>     Mateusz
> _______________________________________________
> 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/20151118/88d278f2/attachment.html>


More information about the yt-users mailing list