[yt-users] Accessing Information Stored in Plot.Profile.Field_Data

Nathan Goldbaum nathan12343 at gmail.com
Mon Oct 19 11:03:35 PDT 2015


Hi Madison,

Take a look at this example here:

https://gist.github.com/f1f0d5c1b2ff2037e7d2

I think the main problem you're having is accessing the profile data using
`field_data`. The profile object is designed to have a dictionary-like
interface like other yt data objects, so you access the data by doing
"profile[bin_field_name]". In your example, the bin field is 'cell_mass',
so you would do "profile['cell_mass']".

See also this page in the docs:
http://yt-project.org/doc/analyzing/generating_processed_data.html?highlight=create_profile#profiles-and-histograms

HTH,

Nathan

On Mon, Oct 19, 2015 at 10:52 AM, Madison Fitzgerald <fitzg152 at msu.edu>
wrote:

> I apologize, it had a lot of unnecessary information that I didn’t know
> was in that document—I’ve updated my script with comments that highlights
> more about what I’m trying to do (http://paste.yt-project.org/show/5987/).
>
> Essentially, what I’m trying to do is to take the data stored in
> plot.profile.field_data.values() and treat it like a YTArray, so I can
> manipulate it and use it in the same ways that we use other YTArrays. What
> I ultimately want to do with this is to find the mass at a specific
> location of radius and entropy on the plot using the plot data output.
> However, in the current format, I’m not able to do that, and I haven’t been
> able to figure out a way to make the data within the plot.profile object
> more accessible.
>
> Thank you,
> Madison Fitzgerald
>
> Astrophysics | Lyman Briggs College
> Women’s & Gender Studies | College of Arts & Letters
> LGBTQ and Sexuality Studies Specialization
> Women in Science, President
> Undergraduate Teaching Assistant
> Department of Physics and Astronomy
> Honors College
> Michigan State University
>
> On Oct 19, 2015, at 1:27 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>
>
> On Mon, Oct 19, 2015 at 9:45 AM, Madison Fitzgerald <fitzg152 at msu.edu>
> wrote:
>
>> Hello,
>>
>> I’m working on accessing the information stored by a phase plot in
>> plot.profile.field_data, but yt recognizes this as a list, so I can’t seem
>> to get the information out of this list to use.
>>
>> I’ve attached the script with how I’ve been attempting to access the data
>> (http://paste.yt-project.org/show/5985/), and then the output and
>> various procedures I’ve tried (http://paste.yt-project.org/show/5986/).
>>
>
> Hi Madison,
>
> I'm sorry, I'm having a tough time inferring the issue you're having
> reading the second pastebin.
>
> Can you explain in words a little bit more exactly what the issue is? It
> would also help if you expand the first script to get it to the point where
> you are having your issue, and then explain what information you are trying
> to get out of the profile object.
>
> -Nathan
>
>
>>
>> I’ve been working on a MacBook Pro, OS X 10.10.5, with yt version 3.2
>> (installed using miniconda, so no changeset).
>>
>> I appreciate any help you might be able to give me.
>>
>> Thank you,
>> Madison Fitzgerald
>>
>> Astrophysics | Lyman Briggs College
>> Women’s & Gender Studies | College of Arts & Letters
>> LGBTQ and Sexuality Studies Specialization
>> Women in Science, President
>> Undergraduate Teaching Assistant
>> Department of Physics and Astronomy
>> Honors College
>> Michigan State University
>>
>>
>> _______________________________________________
>> 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/20151019/ee8ce05c/attachment.htm>


More information about the yt-users mailing list