[yt-users] ProfilePlot in YT-3.0

John Regan johnanthonyregan at gmail.com
Sun Sep 28 08:54:32 PDT 2014


Hi Nathan,

Thanks for that. I'll have a look at what helper functions would be useful
as I use the ProfilePlot routine and I can issue a PR then. I think it
would be worth updating the docs with info like you just sent me.

Cheers,
John

On Sun, Sep 28, 2014 at 11:17 AM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> Hi John,
>
> ProfilePlot is a wrapper around the Profile1D class, which calculates and
> stores the histograms.  To access the underlying data you need to access
> the profile object via the profiles attribute of the ProfilePlot:
>
> import yt
> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
> plot = yt.ProfilePlot(ds.all_data(), 'radius', 'density')
> profile = plot.profiles[0]
> print profile.x_field, profile.x
> print profile.field_data.keys(), profile['density']
>
> There are probably a number of ways that the current API can be improved
> to make it more straightforward to access this data.  PRs along this front
> would be very welcome, I think.
>
> -Nathan
>
> On Sun, Sep 28, 2014 at 1:05 AM, John Regan <johnanthonyregan at gmail.com>
> wrote:
>
>> HI All,
>>
>> Is there an easy way to access the x_field and the y_fields in the
>> ProfilePlot function?
>>
>> So for example
>>
>> prof = ProfilePlot(sphere, "radius", "density")
>>
>>
>> print prof.x_field
>> print prof.y_field[0]
>>
>> I inserted a couple of hack functions into the ProfilePlot class to
>> return the x_field and the .items() tuple but there is probably a better
>> way?
>>
>> John
>>
>> _______________________________________________
>> 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/20140928/383cb91d/attachment.htm>


More information about the yt-users mailing list