[yt-users] Saving and loading Arbitrary grid data
Nathan Goldbaum
nathan12343 at gmail.com
Thu Oct 19 15:08:54 PDT 2017
Hi,
I think this is due to a bug that was recently fixed by Britton Smith, see
https://github.com/yt-project/yt/pull/1569. When I run your script using
the current master branch in the yt git repository I don't see any errors.
To get the fix right now you'll need to build the development version of yt
from the git repository, see
http://yt-project.org/docs/dev/installing.html#installing-yt-from-source
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.
Apologies for the trouble and thank you for the detailed report, hope
that's helpful.
-Nathan
On Thu, Oct 19, 2017 at 4:35 PM, Li,Qi <pg3552 at ufl.edu> wrote:
> Dear user group,
>
> 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.
>
> To clarify, I smooth yt sample data — FIRE_M12i_ref11 onto a 64**3 grid,
> the code is like this:
>
> 1 import yt
> 2
> 3 ytname='FIRE_M12i_ref11/snapshot_600.hdf5'
> 4 ds=yt.load(ytname)
> 5
> 6 # define the region
> 7 left = ds.domain_left_edge
> 8 right = ds.domain_right_edge
> 9
> 10 #now create an abitrary grid and save
> 11 arb = ds.arbitrary_grid(left, right,dims=[64, 64, 64])
> 12
> 13 fn = arb.save_as_dataset(fields=[('PartType0','density')])
> 14
> 15 arb_ds = yt.load('snapshot_600_arbitrary_grid.h5')
> 16 print arb_ds.field_list
>
> And it returns an error:
>
> Traceback (most recent call last):
> File "arbgrid_clean.py", line 16, in <module>
> * print arb_ds.field_list*
> ...
> ...
> File "/Users/heavyfat/anaconda/lib/python2.7/site-packages/yt/frontends/ytdata/io.py",
> line 244, in _initialize_index
> pos[:,0] = _get_position_array(ptype, f, "x")
> *ValueError: could not broadcast input array from shape (64,64,64) into
> shape (262144)*
>
> So, how I can save/load a usable arbitrary grid dataset?
> Thanks and looking forward to your suggestions.
>
> Best regards,
> Qi
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20171019/b8777226/attachment-0001.html>
More information about the yt-users
mailing list