<div dir="ltr">One issue I've run into in the past is that binning by 'x' with BinnedProfile1D may not produce exactly what one would like. In particular, if your data has non-uniform cell sizes, then in the derefined regions the 1D profile will have peaks at the positions of cell centers. For instance if my coarsest grid extends from x=0 to x=4 with 8 cells, and much of my grid is not refined, my 1D profile will have features at x=0.25, 0.75, etc. I'm not sure if any built-in yt functionality which gets around this issue (if you run into it). Maybe you could create a FixedResolutionBuffer and do whatever sum you want manually over one dimension of the corresponding numpy array?<div>
<br></div><div>Good luck,</div><div>John</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 22, 2013 at 5:45 AM, j s oishi <span dir="ltr"><<a href="mailto:jsoishi@gmail.com" target="_blank">jsoishi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I think Sasha may want a simpler, unweighted average. You can do this by setting the weight field to Ones. If you set the weight to None, you'll get a sum across x. </p>

<p dir="ltr">You'll probably want to set n_bins to the number of x cells to get what you are looking for.</p>
<p dir="ltr">Hope this is helpful,</p>
<p dir="ltr">Jeff</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Oct 22, 2013 8:25 AM, "Matthew Turk" <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi Sasha,<div><br></div><div>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:</div>



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



<div><br></div><div>Does that help?</div><div><br></div><div>Best,</div><div><br></div><div>Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 11:29 PM, Alexander Philippov <span dir="ltr"><<a href="mailto:philippo@astro.princeton.edu" target="_blank">philippo@astro.princeton.edu</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I would like to plot 1D profile of quantity (say, density) averaged over 1 axis<br>
(say, x) from two-dimensional data. Is there any cheap way to do it?<br>
<br>
Thanks in advance,<br>
Sasha<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div>
</div></div><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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>