[yt-users] bug in ortho_ray and derived fields?

Matthew Turk matthewturk at gmail.com
Fri Apr 16 16:47:05 PDT 2010


Hi Michael,

> I see that all the fields, including the derived ones, are there and are
> accessible, but for some reason they don't show up as defined keys until
> I access them. Is that by design? If so, how do I iterate over the
> fields? Before I was doing something like this:

Yup, it's by design -- it loads on demand.

> But that won't work now.

You can access the full list of fields as:

pf.h.field_list # fields in the files
pf.h.derived_field_list # fields it thinks it can make

> Actually I'm not explicitly setting what kind of data object to use. I
> simply did a 'pf = load(filename)' and it decided to go with
> EnzoHierarchy1D. How would I enforce a 3D data object, and why would
> that be better?

Oh, I meant a 3D data object like a region, sphere, etc etc.

> Note that all of this is with the trunk (development) version. With the
> stable version, I couldn't get 1D simulation data to work at all.
> pf.h.find_max("Density") gave this error:
>
>  File "/home/mqk/yt/src/yt-1.6/yt/lagos/BaseDataTypes.py", line 1664,
> in _get_data_from_grid
>    return grid[field][pointI].ravel()
> IndexError: index (1) out of range (0<=index<0) in dimension 2

Ah, yes.  I think I forgot to backport a fix.  I will take a look at
this shortly.  Thanks for the heads up!

-Matt



More information about the yt-users mailing list