<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Britton and Matt,<div>thanks very much for the clarification... the mathematics is clear but my question is the following:</div><div><br></div><div>If I have a new species which is not defined in YT as _Fraction and I would like to plot the mass fraction, how can I avoid such problems with the average quantities and binning?</div><div>Which is the right procedure starting from the mass density obtained from enzo (species_Density)?</div><div><br></div><div>Thanks in advance</div><div>Stefano</div><div><br><div><div>Il giorno 27/gen/14, alle ore 18:34, Britton Smith ha scritto:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">The reason the answers are getting closer together when you add more bins is that you are decreasing the number of points in each bin, and as you do that the difference between<div>mean(f * g) and mean(f) * mean(g) will get smaller, though it will not be identical until you have exactly one cell in each bin.</div> </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 27, 2014 at 5:29 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 ok,<br></div>it seems that increasing a lot the number of bins the two approaches are matching better... is there any reason for that? <br> <br></div><div>A second question: how it works for the electrons? In enzo the electrons are usually initialized considering a factor of mp/me, YT takes into account this rescaling?<br> </div><div><br>Thanks again<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: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><div><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></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> _______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote></div><br></div></body></html>