[yt-users] Saving and loading Arbitrary grid data
    Li,Qi 
    pg3552 at ufl.edu
       
    Thu Oct 19 14:35:01 PDT 2017
    
    
  
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20171019/23f2fa88/attachment.html>
    
    
More information about the yt-users
mailing list