[yt-users] Generic UniGrid Data
John ZuHone
jzuhone at gmail.com
Mon Jun 16 10:37:44 PDT 2014
Junhwan,
Can you post your script somewhere? It might be easier to debug it that way.
Best,
John Z
> On May 16, 2014, at 12:46 AM, Junhwan Choi <choi.junhwan at gmail.com> wrote:
>
> Hi Nathan,
>
> I think that I am using the yt 3.0 unless there is stabke yt 3.0 version.
>
> Junhwan
>
>
>
>> On May 15, 2014, at 11:29 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>>
>> Hi Junhwan,
>>
>> 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?
>>
>> Nathan
>>
>>> On Friday, May 16, 2014, Junhwan Choi (최준환) <choi.junhwan at gmail.com> wrote:
>>> Dear yt user,
>>>
>>> I try to use Generic UnicGrid Data (256^3 gas density cube + position
>>> of particle that is subset of a huge simulation).
>>> It is preliminary work, but I still have some questions.
>>>
>>> 1. In order to set density unit as cgs, I made following script:
>>> ......
>>> data = dict(density = (map, "g/cm**3")) #map is 256^3 density data array
>>> bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])
>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>> bbox=bbox, nprocs=4)
>>> .....
>>>
>>> Then, I got the following error message:
>>> Traceback (most recent call last):
>>> File "cutout2.py", line 62, in <module>
>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>> bbox=bbox, nprocs=4)
>>> 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",
>>> line 461, in load_uniform_grid
>>> psize = get_psize(np.array(data[key].shape), nprocs)
>>> AttributeError: 'tuple' object has no attribute 'shape'
>>>
>>> Hence, I modify "data = dict(density = (map, "g/cm**3"))" --> "data =
>>> dict(density = map)" and it work.
>>> If this is the case, how can I define the density unit and show it
>>> when I make Slice/Projection?
>>> In addition, I would like to know how I can set the unit in Generic
>>> UnicGrid Data in general?
>>> The length unit can be provide to script in load_uniform_grid(...
>>> 3.086e24 ....) but I do not know how to set other units.
>>>
>>> 2. When I add particle information as follow:
>>> .....
>>> npart = 100000 # number of particles
>>> data = dict(density = map,
>>> number_of_particles = npart,
>>> particle_position_x = posx,
>>> particle_position_y = posy,
>>> particle_position_z = posz)
>>> bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])
>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>> bbox=bbox, nprocs=4)
>>> ...
>>>
>>> I got the following error message:
>>> Traceback (most recent call last):
>>> File "cutout.py", line 107, in <module>
>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>> bbox=bbox, nprocs=4)
>>> 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",
>>> line 519, in load_uniform_grid
>>> assign_particle_data(spf, pdata)
>>> 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",
>>> line 371, in assign_particle_data
>>> pdata.pop("number_of_particles")
>>> KeyError: 'number_of_particles'
>>>
>>> So, I change "number_of_particles = npart," --> "number_of_particles =
>>> 100000," and it works.
>>> How could it happen?
>>>
>>> 3. Can I do halo finder (hop/fof) using the above particle data?
>>> Or, what information do I need to provide to do grouping?
>>> In this case, how can I set the units and linking length?
>>>
>>> 4. Can I make particle distribution to particle data like
>>> data['Dark_Matter_position_x']?
>>> This process will allow me additional analysis such as profile and
>>> obtaining total value.
>>>
>>> I may ask too many for new tool, but it will help a lot to use yt for
>>> general data set.
>>>
>>> Thank you,
>>> Junhwan
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> _______________________________________________
> 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/20140616/840a5dd1/attachment.htm>
More information about the yt-users
mailing list