[yt-users] physical quantities

Nathan Goldbaum nathan12343 at gmail.com
Thu May 22 10:38:07 PDT 2014


Hey Desika,

You're right, you need to use all_data:

import yt
ds = yt.load("your_dataset")
ad = ds.all_data()
print ad["PartType0", "Coordinates"]

In general all yt data sources will print out the flattened data contained
in the source when you query them like a dictionary using an unambiguous
string field name or ('field_type', 'field name') tuple.

Nathan

On Thursday, May 22, 2014, Desika Narayanan <dnarayan at haverford.edu> wrote:

> Hi yt,
>
> I have a pretty simple question that I ought to know the answer to -  how
> do I extract the actual values in the field_list or derived_field_list of a
> ds?
>
> For example, I have a field: ('PartType0', 'Coordinates'),
>
> but printing something like pf[('PartType0','Coordinates')] doesn't return
> the list of particle type 0 coordinates (or anything for that matter).  Do
> I have to access this through a pf.all_data() command somehow?
>
> Thanks
> -desika
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140522/f1f2391b/attachment.htm>


More information about the yt-users mailing list