<div dir="ltr"><div>Hi,</div><div><br></div><div>I think this is due to a bug that was recently fixed by Britton Smith, see <a href="https://github.com/yt-project/yt/pull/1569">https://github.com/yt-project/yt/pull/1569</a>. When I run your script using the current master branch in the yt git repository I don't see any errors.<br></div><div><br></div><div>To get the fix right now you'll need to build the development version of yt from the git repository, see <a href="http://yt-project.org/docs/dev/installing.html#installing-yt-from-source">http://yt-project.org/docs/dev/installing.html#installing-yt-from-source</a></div><div><br></div><div>We are probably overdue for a bugfix release so I've added an entry to my todo list to do the backports necessary to generate a bugfix release.<br></div><div><br></div><div>Apologies for the trouble and thank you for the detailed report, hope that's helpful.</div><div><br></div><div>-Nathan<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 19, 2017 at 4:35 PM, Li,Qi <span dir="ltr"><<a href="mailto:pg3552@ufl.edu" target="_blank">pg3552@ufl.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Dear user group,
<div><br>
</div>
<div>I am trying to smooth particle data output from GIZMO onto an arbitrary grid,  then save the object as data set  and reload in order to do volume rendering. However I can not handle the reloaded data set.</div>
<div><br>
</div>
<div>To clarify, I smooth yt sample data — FIRE_M12i_ref11 onto a 64**3 grid, the code is like this:</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(213,59,211);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  1
</span><span style="font-variant-ligatures:no-common-ligatures">import</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> yt</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  2 </span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(195,55,32);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  3
</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">ytname=</span><span style="font-variant-ligatures:no-common-ligatures">'FIRE_M12i_ref11/<wbr>snapshot_600.hdf5'</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  4
</span><span style="font-variant-ligatures:no-common-ligatures">ds=yt.load(ytname)</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(205,121,35);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">  5 </span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(82,48,225);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  6
</span><span style="font-variant-ligatures:no-common-ligatures"># define the region</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  7
</span><span style="font-variant-ligatures:no-common-ligatures">left = ds.domain_left_edge</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">  8
</span><span style="font-variant-ligatures:no-common-ligatures">right = ds.domain_right_edge</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(205,121,35);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">  9 </span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(82,48,225);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923"> 10
</span><span style="font-variant-ligatures:no-common-ligatures">#now create an abitrary grid and save</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923"> 11
</span><span style="font-variant-ligatures:no-common-ligatures">arb = ds.arbitrary_grid(left, right,dims=[</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720">64</span><span style="font-variant-ligatures:no-common-ligatures">,
</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720">64</span><span style="font-variant-ligatures:no-common-ligatures">,
</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720">64</span><span style="font-variant-ligatures:no-common-ligatures">])</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(205,121,35);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"> 12 </span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923"> 13
</span><span style="font-variant-ligatures:no-common-ligatures">fn = arb.save_as_dataset(fields=[(</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720">'<wbr>PartType0'</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720">'density'</span><span style="font-variant-ligatures:no-common-ligatures">)])</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(205,121,35);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"> 14 </span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(195,55,32);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923"> 15
</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">arb_ds = yt.load(</span><span style="font-variant-ligatures:no-common-ligatures">'snapshot_600_<wbr>arbitrary_grid.h5'</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">)</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures;color:#cd7923"> 16
</span><span style="font-variant-ligatures:no-common-ligatures;color:#33bbc8">print</span><span style="font-variant-ligatures:no-common-ligatures"> arb_ds.field_list</span></div>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
And it returns an error: </div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
Traceback (most recent call last):</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">  File "arbgrid_clean.py", line 16, in <module></span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">    <b>
print arb_ds.field_list</b></span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">  ...</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">  ...</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures">
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">  File "/Users/heavyfat/anaconda/lib/<wbr>python2.7/site-packages/yt/<wbr>frontends/ytdata/io.py", line 244, in _initialize_index</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">    pos[:,0] = _get_position_array(ptype, f, "x")</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"><b>ValueError: could not broadcast input array from shape (64,64,64) into shape (262144)</b></span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">So, how I can save/load a usable arbitrary grid dataset?</span></div>
<div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">Thanks and looking forward to your suggestions.</span></div>
<div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">Best regards,</span></div>
<div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">Qi </span></div>
</span></div>
</div>

<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div>