[yt-dev] gdf frontend and standards in tension?

j s oishi jsoishi at gmail.com
Wed Jan 29 14:22:28 PST 2014


Hi all,

I've adapted yt's gdf_writer.py into a standalone class called pygdf (
https://bitbucket.org/jsoishi/pygdf). I've done this so that any python
code can now save data in the gdf format.

While doing this, I came across something in the yt gdf frontend that I'm
not quite sure I understand. In the grid metadata, yt expects
/grid_particle_count to be a 2-D array, but the gdf standard clearly states
this should be a 1-D (int64, N) array, where N is the number of grids.
Further complicating the issue is the fact that if I create a 1-D array for
/grid_particle_count, the failure point in the following script

from yt.mods import *
pf = load("/tmp/blah.gdf")

sp = SlicePlot(pf, 2, "Density")

is actually in data_objects/grid_patch.py, not in the gdf frontend itself.
The file /tmp/blah.gdf can be generated by running the test.py script in
pygdf.

The obvious workaround is to simply make /grid_particle_count a 2D array
(this is especially so since I'm not actually using particles at the
moment), but I'm not sure why this should be so. The total count of
particles in N grids seems to be better fit in a 1-D array to me. However,
I'd like to understand better what's going on. Any pointers or
clarification would be very helpful.

Also, any feedback on pygdf would be most welcome!

thanks,

j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20140129/c9b483bf/attachment.htm>


More information about the yt-dev mailing list