[yt-users] ProfilePlot in YT-3.0

Nathan Goldbaum nathan12343 at gmail.com
Sun Sep 28 01:17:22 PDT 2014


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140928/f2618a98/attachment.html>


More information about the yt-users mailing list