<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 22, 2014 at 3:17 PM, Junhwan Choi (최준환) <span dir="ltr"><<a href="mailto:choi.junhwan@gmail.com" target="_blank">choi.junhwan@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have read more about the "generic array data" from the document in yt webpage.<br>
I found that the the how to set data dict and call "load_uniform_grid"<br>
by yt-2.6 and yt-3.0 are quite different, and it looks that yt-3.0<br>
supports better unit treatment.<br>
<br>
However, my yt-3.0 looks use old formate for load_uniform_grid as follow:<br>
.....<br>
def load_uniform_grid(data, domain_dimensions, sim_unit_to_cm, bbox=None,<br>
                      nprocs=1, sim_time=0.0, periodicity=(True, True, True)):<br>
....<br>
<br>
This load_uniform_grid arguments are different with those presented in<br>
yt-3.0 document.<br>
I think this is part of the reason that I have a difficulty.<br>
<br></blockquote><div><br></div><div>Sorry for the difficulty - we're in the middle of updating the docs so there is still come confusing incorrect information in the 3.0-dev documentation.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


How can I use that load_uniform_grid for the version shown in yt-3.0 document?<br>
<br>
Thank you,<br>
Junhwan<br>
<br>
On Fri, May 16, 2014 at 11:28 AM, Junhwan Choi (최준환)<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>> wrote:<br>
> Here, I post my script in <a href="http://paste.yt-project.org/show/4641" target="_blank">http://paste.yt-project.org/show/4641</a><br>
><br>
> Thank you,<br>
> Junhwan<br>
><br>
> On Thu, May 15, 2014 at 11:56 PM, John ZuHone <<a href="mailto:jzuhone@gmail.com">jzuhone@gmail.com</a>> wrote:<br>
>> Junhwan,<br>
>><br>
>> Can you post your script somewhere? It might be easier to debug it that way.<br>
>><br>
>> Best,<br>
>><br>
>> John Z<br>
>><br>
>> On May 16, 2014, at 12:46 AM, Junhwan Choi <<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>> wrote:<br>
>><br>
>> Hi Nathan,<br>
>><br>
>> I think that I am using the yt 3.0 unless there is stabke yt 3.0 version.<br>
>><br>
>> Junhwan<br>
>><br>
>><br>
>><br>
>> On May 15, 2014, at 11:29 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>> wrote:<br>
>><br>
>> Hi Junhwan,<br>
>><br>
>> Just to clarify (since the answers you receive will be different depending<br>
>> on your response) is this for the in-development yt 3.0 release or the<br>
>> current stable release?<br>
>><br>
>> Nathan<br>
>><br>
>> On Friday, May 16, 2014, Junhwan Choi (최준환) <<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>> wrote:<br>
>>><br>
>>> 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<br>
>>> "/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<br>
>>> "/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<br>
>>> "/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="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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
_______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div></div>