Hi Junhwan,<div><br></div><div>Just to clarify (since the answers you receive will be different depending on your response) is this for the in-development yt 3.0 release or the current stable release?</div><div><br></div><div>
Nathan<span></span><br><br>On Friday, May 16, 2014, Junhwan Choi (최준환) <<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear yt user,<br>
<br>
I try to use Generic UnicGrid Data (256^3 gas density cube + position<br>
of particle that is subset of a huge simulation).<br>
It is preliminary work, but I still have some questions.<br>
<br>
1. In order to set density unit as cgs, I made following script:<br>
......<br>
data = dict(density = (map, "g/cm**3"))  #map is 256^3 density data array<br>
bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])<br>
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,<br>
bbox=bbox, nprocs=4)<br>
.....<br>
<br>
Then, I got the following error message:<br>
Traceback (most recent call last):<br>
  File "cutout2.py", line 62, in <module><br>
    ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,<br>
bbox=bbox, nprocs=4)<br>
  File "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",<br>
line 461, in load_uniform_grid<br>
    psize = get_psize(np.array(data[key].shape), nprocs)<br>
AttributeError: 'tuple' object has no attribute 'shape'<br>
<br>
Hence, I modify "data = dict(density = (map, "g/cm**3"))" --> "data =<br>
dict(density = map)" and it work.<br>
If this is the case, how can I define the density unit and show it<br>
when I make Slice/Projection?<br>
In addition, I would like to know how I can set the unit in Generic<br>
UnicGrid Data in general?<br>
The length unit can be provide to script in load_uniform_grid(...<br>
3.086e24 ....) but I do not know how to set other units.<br>
<br>
2. When I add particle information as follow:<br>
.....<br>
npart = 100000  # number of particles<br>
data = dict(density = map,<br>
            number_of_particles = npart,<br>
            particle_position_x = posx,<br>
            particle_position_y = posy,<br>
            particle_position_z = posz)<br>
bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])<br>
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,<br>
bbox=bbox, nprocs=4)<br>
...<br>
<br>
I got the following error message:<br>
Traceback (most recent call last):<br>
  File "cutout.py", line 107, in <module><br>
    ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,<br>
bbox=bbox, nprocs=4)<br>
  File "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",<br>
line 519, in load_uniform_grid<br>
    assign_particle_data(spf, pdata)<br>
  File "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",<br>
line 371, in assign_particle_data<br>
    pdata.pop("number_of_particles")<br>
KeyError: 'number_of_particles'<br>
<br>
So, I change "number_of_particles = npart," --> "number_of_particles =<br>
100000," and it works.<br>
How could it happen?<br>
<br>
3. Can I do halo finder (hop/fof) using the above particle data?<br>
Or, what information do I need to provide to do grouping?<br>
In this case, how can I set the units and linking length?<br>
<br>
4. Can I make particle distribution to particle data like<br>
data['Dark_Matter_position_x']?<br>
This process will allow me additional analysis such as profile and<br>
obtaining total value.<br>
<br>
I may ask too many for new tool, but it will help a lot to use yt for<br>
general data set.<br>
<br>
Thank you,<br>
Junhwan<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'yt-users@lists.spacepope.org')">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div>