<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Junhwan,<div><br></div><div>I'm having trouble finding anything wrong with your script, actually. </div><div><br></div><div>I would recommend changing this:</div><div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 5px 0px; font-family: 'Bitstream Vera Sans Mono', monospace; font-size: 13px;">ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24, bbox=bbox, nprocs=4)</pre><div><br></div><div>to this:</div><div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 5px 0px; font-family: 'Bitstream Vera Sans Mono', monospace; font-size: 13px;">ds = load_uniform_grid(data, data['density'][0].shape, length_unit=(1.0,"Mpc"), bbox=bbox, nprocs=4)</pre><div><br></div></div><div>but I doubt that would make much of a difference. </div><div><br></div><div>Have you inspected what data["density"][0] is in your script, and what npart is? I set up an example on my own with random particle data, and I set the number_of_particles dictionary key to a variable npart that was set previously, and saw no issues there. </div><div><br></div><div>If it's possible to post the file that this script works with somewhere, that would enable me to reproduce the buggy behavior.</div><div><br></div><div>Best,</div><div><br></div><div>John Z</div><div><br></div><div><div>On May 22, 2014, at 6:19 PM, John ZuHone <<a href="mailto:jzuhone@gmail.com">jzuhone@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Junhwan,<div><br></div><div>Sorry, I kind of got lost in some other things--I'll have a look at your script tonight and get back to you.</div><div><br></div><div>Best,</div><div><br></div><div><br><div style="direction: ltr;"><div>On May 22, 2014, at 6:17 PM, Junhwan Choi (최준환) <<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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>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><<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>> wrote:<br><blockquote type="cite">Here, I post my script in <a href="http://paste.yt-project.org/show/4641">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><blockquote type="cite">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><blockquote type="cite"><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>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br><br>_______________________________________________<br>yt-users mailing list<br>yt-users@lists.spacepope.org<br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br><br><br><br>_______________________________________________<br>yt-users mailing list<br>yt-users@lists.spacepope.org<br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br><br></blockquote></blockquote>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote></div><br></div></div></blockquote></div><br></div></body></html>