[yt-users] plotting average quantaties

Matthew Turk matthewturk at gmail.com
Tue Oct 22 05:24:47 PDT 2013


Hi Sasha,

I'm not sure I understand what you're looking for.  The functionality to
take averages of one field wrt another field might work for what you're
looking for, using the BinnedProfile1D object.  If so, you could bin by the
"x" field and then take a weighted average of Density.  This might look
something like this:

dd = pf.h.all_data()
prof = BinnedProfile1D(dd, n_bins, "x", pf.domain_left_edge[0],
pf.domain_right_edge[0], log_space = False)
prof.add_fields(["Density"], weight="CellMassMsun")

Does that help?

Best,

Matt


On Mon, Oct 21, 2013 at 11:29 PM, Alexander Philippov <
philippo at astro.princeton.edu> wrote:

> Hi all,
>
> I would like to plot 1D profile of quantity (say, density) averaged over 1
> axis
> (say, x) from two-dimensional data. Is there any cheap way to do it?
>
> Thanks in advance,
> Sasha
> _______________________________________________
> 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/20131022/2516ba77/attachment.htm>


More information about the yt-users mailing list