<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear user group,
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">To clarify, I smooth yt sample data — FIRE_M12i_ref11 onto a 64**3 grid, the code is like this:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(213, 59, 211); background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  1
</span><span style="font-variant-ligatures: no-common-ligatures" class="">import</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> yt</span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  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);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  3
</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">ytname=</span><span style="font-variant-ligatures: no-common-ligatures" class="">'FIRE_M12i_ref11/snapshot_600.hdf5'</span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  4
</span><span style="font-variant-ligatures: no-common-ligatures" class="">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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  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);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  6
</span><span style="font-variant-ligatures: no-common-ligatures" class=""># define the region</span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  7
</span><span style="font-variant-ligatures: no-common-ligatures" class="">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);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class="">  8
</span><span style="font-variant-ligatures: no-common-ligatures" class="">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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  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);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class=""> 10
</span><span style="font-variant-ligatures: no-common-ligatures" class="">#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);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class=""> 11
</span><span style="font-variant-ligatures: no-common-ligatures" class="">arb = ds.arbitrary_grid(left, right,dims=[</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">64</span><span style="font-variant-ligatures: no-common-ligatures" class="">,
</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">64</span><span style="font-variant-ligatures: no-common-ligatures" class="">,
</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">64</span><span style="font-variant-ligatures: no-common-ligatures" class="">])</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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""> 12 </span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class=""> 13
</span><span style="font-variant-ligatures: no-common-ligatures" class="">fn = arb.save_as_dataset(fields=[(</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">'PartType0'</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">'density'</span><span style="font-variant-ligatures: no-common-ligatures" class="">)])</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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""> 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);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class=""> 15
</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">arb_ds = yt.load(</span><span style="font-variant-ligatures: no-common-ligatures" class="">'snapshot_600_arbitrary_grid.h5'</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #cd7923" class=""> 16
</span><span style="font-variant-ligatures: no-common-ligatures; color: #33bbc8" class="">print</span><span style="font-variant-ligatures: no-common-ligatures" class=""> 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);" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
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);" class="">
<br class="">
</div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    <b class="">
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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  ...</span></div>
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  ...</span></div>
<div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">
<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">  File "/Users/heavyfat/anaconda/lib/python2.7/site-packages/yt/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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">    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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""><br class="">
</span></div>
<div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">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);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Thanks and looking forward to your suggestions.</span></div>
<div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""><br class="">
</span></div>
<div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">Best regards,</span></div>
<div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">Qi </span></div>
</span></div>
</body>
</html>