<div dir="ltr">I think there is a bigger problem here.<div>When you do a profile of a field (with some weight field), the values you get out are the weight-average of the field such that:</div><div>profile (field, weight_field) = Sum (field * weight_field) / Sum(weight_field)</div>

<div><br></div><div>You are comparing</div><div>profile(H2_Density) / profile(Density)</div><div>with</div><div>profile(H2_Density / Density)</div><div><br></div><div>Mathematically, these are not the same.</div><div><br>
</div><div>Or, in other words:</div><div>mean(x * y) != mean(x) * mean(y)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 27, 2014 at 5:24 PM, Stefano Bovino <span dir="ltr"><<a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>ah... I'm binning, it also depends on the number of bins I'm using, but the discrepancy (slight) is still there):<br>
<br>prof3 = BinnedProfile1D(sph3, 64, "Radiuspc", 1.0e-6, 1.0e6)<br>
<br></div>In my initial setup I'm using a box of 300 pc.<br><br></div>Stefano<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 27, 2014 at 6:20 PM, Stefano Bovino <span dir="ltr"><<a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Matt,<br>thanks for the quick reply.<br></div>I'm using simple data from the enzo Collapse Test (27).<br>

</div><div>It seems is mainly related to the size of the sphere I'm taking... but I don't know.<br>
</div><div><br></div>Here following a piece of my script:<br><br> pf3=load("DD0003/DD0003")<br>c3= pf3.h.find_max("Density")[1]<br>sph3 = pf3.h.sphere(c3, (100, 'pc'))<br>prof3.add_fields("H2I_Density")<br>


prof3.add_fields("H2I_Fraction")<br>prof3.add_fields("Radius")<br><br>...<br>...<br><br>d_ax2.loglog(prof3['Radius'], prof3['H2I_Density']/prof3['Density'],<br>            lw=1.5, linestyle='--', color='r')<br>


d_ax2.loglog(prof3['Radius'], prof3['H2I_Fraction'],<br>            lw=1.5, linestyle=':', color='y')<br><br></div>Thanks in advance<br>Stefano<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">

<div>
On Mon, Jan 27, 2014 at 6:11 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br></div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div>On Mon, Jan 27, 2014 at 12:14 PM, <a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a> <<a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a>> wrote:<br>
> Hi Guys,<br>
> I did a simple test with enzo and I tried to plot a radial profile of the<br>
> chemical species fractions with YT.<br>
><br>
> The problem is that if I use the YT function which intrinsically plot the<br>
> fraction for a species, let's say H2I_Fraction (as usual), and compare this<br>
> with a direct evaluation of the mass fraction:<br>
><br>
> data['H2I_Density']/data['Density']<br>
><br>
> I obtain some slightly different results, mostly at large radii.<br>
><br>
> Anyone might explain this discrepancy!? This happens with all the species.<br>
<br>
</div></div>Without knowing what "data" here is, or how you generated it, it's tough to say.<br>
<br>
-Matt<br>
<br>
><br>
> Thank you in advance<br>
> Stefano_______________________________________________<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>
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></div></div><br></div>
</blockquote></div><br></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>