[yt-users] chemical species abundances discrepancy

Matthew Turk matthewturk at gmail.com
Mon Jan 27 09:23:30 PST 2014


On Mon, Jan 27, 2014 at 12:20 PM, Stefano Bovino <poetaste at gmail.com> wrote:
> Hi Matt,
> thanks for the quick reply.
> I'm using simple data from the enzo Collapse Test (27).
> It seems is mainly related to the size of the sphere I'm taking... but I
> don't know.
>
> Here following a piece of my script:
>
>  pf3=load("DD0003/DD0003")
> c3= pf3.h.find_max("Density")[1]
> sph3 = pf3.h.sphere(c3, (100, 'pc'))
> prof3.add_fields("H2I_Density")
> prof3.add_fields("H2I_Fraction")
> prof3.add_fields("Radius")

By default, these will be unweighted values.  So it's summing them up
in the bins.  I don't know how prof3 is defined, but the "binning"
field is specified in its constructor.  You probably don't want to do
either weighted or unweighted radius field addition.  The yt method
paper and the yt docs go into some detail about the way that profiles
function, including averaging, binning fields, and so on.

Hope that helps,

Matt

>
> ...
> ...
>
> d_ax2.loglog(prof3['Radius'], prof3['H2I_Density']/prof3['Density'],
>             lw=1.5, linestyle='--', color='r')
> d_ax2.loglog(prof3['Radius'], prof3['H2I_Fraction'],
>             lw=1.5, linestyle=':', color='y')
>
> Thanks in advance
> Stefano
>
>
> On Mon, Jan 27, 2014 at 6:11 PM, Matthew Turk <matthewturk at gmail.com> wrote:
>>
>> On Mon, Jan 27, 2014 at 12:14 PM, poetaste at gmail.com <poetaste at gmail.com>
>> wrote:
>> > Hi Guys,
>> > I did a simple test with enzo and I tried to plot a radial profile of
>> > the
>> > chemical species fractions with YT.
>> >
>> > The problem is that if I use the YT function which intrinsically plot
>> > the
>> > fraction for a species, let's say H2I_Fraction (as usual), and compare
>> > this
>> > with a direct evaluation of the mass fraction:
>> >
>> > data['H2I_Density']/data['Density']
>> >
>> > I obtain some slightly different results, mostly at large radii.
>> >
>> > Anyone might explain this discrepancy!? This happens with all the
>> > species.
>>
>> Without knowing what "data" here is, or how you generated it, it's tough
>> to say.
>>
>> -Matt
>>
>> >
>> > Thank you in advance
>> > Stefano_______________________________________________
>> > yt-users mailing list
>> > yt-users at lists.spacepope.org
>> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list