[yt-users] need to set omega_baryon in yt-3

Nathan Goldbaum nathan12343 at gmail.com
Mon Aug 18 19:05:44 PDT 2014


On Mon, Aug 18, 2014 at 7:02 PM, Brian O'Shea <bwoshea at gmail.com> wrote:

> Hi Matt,
>
>
>  >
>> > plot1 =
>> >
>> yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region)
>>
>> You should set it via "field_parameters = {'omega_baryon':
>> your_favorite_cosmology}" in this function call.  There was some
>> recent back and forth about this in a pull request and whether or not
>> it goes into my_region, but this should certainly work.
>>
>
> That did the trick, thank you!
>
> Now, followup question: I am also attempting to create a 2D phase plot of
> the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot
> does not seem to take the field_parameters dictionary, and neither does
> yt.create_profile.  Should I try another avenue to create a phase plot?
>
> --Brian
>

You should be able to call set_field_parameter on the data object you use
to create the phase plot.

Presumably we could add a field_parameters keyword argument to make these
APIs consistent, but it makes less sense here since you are directly
passing in a data source to create a PhasePlot or a ProfileND object.


>
>
>
>
>
>>
>> -Matt
>>
>> >
>> > (with c, my_region being previously defined).  When I do this, it
>> complains:
>> >
>> > yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
>> >
>> > which certainly makes sense from a physical perspective, and which Enzo
>> > doesn't natively carry around. I tried to set this by hand:
>> >
>> >
>> > _______________________________________________
>> > 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140818/4dc59a79/attachment.htm>


More information about the yt-users mailing list