<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 18, 2015 at 8:34 PM, Mateusz Ruszkowski <span dir="ltr"><<a href="mailto:mateuszr@umich.edu" target="_blank">mateuszr@umich.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
   Hi,<br>
<br>
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.<br>
<br>
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<br>
<br>
   prof = yt.Profile1D(sp, “r", rbins, prof_min, prof_max, True, weight_field="cell_volume”)<br></blockquote><div><br></div><div>This will produce a volume weighted averaged of whatever field you profile later.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
or<br>
<br>
   prof = yt.Profile1D(sp, “r", rbins, prof_min, prof_max, True, weight_field=“None”)<br>
<br></blockquote><div><br></div><div>This will produce a profile of the total of the field to be profiled.</div><div><br></div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
    Mateusz<br>
_______________________________________________<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/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div></div>