<div dir="ltr">Hi John,<div><br></div><div>Sure, but I guess my bigger question was: why does yt expect this to be a 2D array?</div><div><br></div><div>j</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jan 29, 2014 at 8:08 PM, John ZuHone <span dir="ltr"><<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>I might be missing something, but can't we just reshape/transform the array from GDF into the format yt wants?</div><div><br>John ZuHone<div>Laboratory for High-Energy Astrophysics<br><div>NASA/Goddard Space Flight Center</div>
<div>8800 Greenbelt Rd., Mail Code 662</div><div>Greenbelt, MD 20771</div><div>(w) <a href="tel:301-286-2531" value="+13012862531" target="_blank">301-286-2531</a></div><div>(m) <a href="tel:781-708-5004" value="+17817085004" target="_blank">781-708-5004</a></div>
</div><div><a href="mailto:john.zuhone@nasa.gov" target="_blank">john.zuhone@nasa.gov</a></div><div><a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a></div></div><div><div class="h5"><div><br>On Jan 29, 2014, at 5:22 PM, j s oishi <<a href="mailto:jsoishi@gmail.com" target="_blank">jsoishi@gmail.com</a>> wrote:<br>
<br></div><blockquote type="cite"><div><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi all,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
I've adapted yt's gdf_writer.py into a standalone class called pygdf (<a href="https://bitbucket.org/jsoishi/pygdf" target="_blank">https://bitbucket.org/jsoishi/pygdf</a>). I've done this so that any python code can now save data in the gdf format. </div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">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</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">from yt.mods import *</div><div style="font-family:arial,sans-serif;font-size:13px">pf = load("/tmp/blah.gdf")</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">sp = SlicePlot(pf, 2, "Density")</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><span style="font-family:arial,sans-serif;font-size:13px">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.</span><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">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.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Also, any feedback on pygdf would be most welcome!</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">thanks,</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">j</div></div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>yt-dev mailing list</span><br><span><a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a></span><br>
<span><a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a></span><br></div></blockquote></div><br>_______________________________________________<br>

yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div>