<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Sam,<div><br></div><div>Constructing KDTree for the whole box apparently take a much much longer time</div><div>(first it ran  out of memory so I increased the RAM/CPU ratio): it used to take about 1 min</div><div>and the test run I put in has taken 80 mins and is still in the KDTree building phase,</div><div>so it might not be practical for me with this approach.</div><div><br></div><div>Best,</div><div>Renyue</div><div> <br><div><div>On Jan 14, 2013, at 10:01 AM, Sam Skillman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi Renyue,<div><br></div><div style="">I've been travelling all over the place and have had flaky (at best) internet, so sorry for the delay.  </div><div style=""><br></div><div style="">Unfortunately that error means that the AMRKDTree is failing for some of it's constructions, which is a fairly difficult problem to track down.  The most robust way to fix the problem is to build the full volume and even though it will be much slower, it will fix the problem.  There are improvements in an outstanding pull request for the new AMRKDTree that will fix this, but for now (until I'm done travelling at the end of this week) the best solution is to just hand it the full volume.  Note that if you can automate through each of the galaxies and only build the volume once, you can then switch the camera positions to go look around at all the galaxies.  </div>

<div style=""><br></div><div style="">The only other option I can think of is to force le= and re= equal to root grid cell boundaries.  So if you had your original LE= <span style="font-family:arial,sans-serif;font-size:13px">c-0.5*WW and RE = c+0.5*WW</span></div>

<div style=""><span style="font-family:arial,sans-serif;font-size:13px">Then I would do: </span></div><div style=""><span style="font-family:arial,sans-serif;font-size:13px">le = <a href="http://np.int/">np.int</a>(LE*pf.domain_dimensions) * pf.domain_width / pf.domain_dimensions</span></div>

<div style=""><span style="font-family:arial,sans-serif;font-size:13px">re = (<a href="http://np.int/">np.int</a>(RE*pf.domain_dimensions)+1) * pf.domain_width / pf.domain_dimensions</span><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div style=""><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style=""><font face="arial, sans-serif">I'm not positive that it will fix the problem, so if that doesn't work then please go back to the full domain (not specifying le, re).  Sorry for the trouble.</font></div>

<div style=""><font face="arial, sans-serif"><br></font></div><div style=""><font face="arial, sans-serif">Sam</font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 14, 2013 at 6:47 AM, Renyue Cen <span dir="ltr"><<a href="mailto:cen@astro.princeton.edu" target="_blank">cen@astro.princeton.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Sam,<div><br></div><div>This problem that I mentioned in the attached email sent earlier appears to be</div>

<div>a bit more common that I thought. I mean, it occurs for multiple galaxies at</div><div>different redshifts. The data files appear ok in that I could make projection plots</div><div>in the same regions just fine without using the AMTKDTree, and a same data file</div>

<div>looks ok for AMRKDTree for a different galaxy at a different location.</div><div><br></div><div>This is a bit critical for me because I need to be able to analyze all these galaxies</div><div>to gain a full physical understanding.</div>

<div><br></div><div>Your help is appreciated,</div><div><br></div><div>Best,</div><div>Renyue</div><div><div class="h5"><div><br></div><div><br></div><div><div><div>On Jan 9, 2013, at 10:57 PM, Renyue Cen wrote:</div><br>

<blockquote type="cite"><div style="word-wrap:break-word">Hi Sam,<div><br></div><div>I have succeeded in volume rendering regions around some galaxies with the transpose=false fix.</div><div>But, occasionally, for some reason, the exact same piece of yt code on some galaxies</div>

<div>failed with the following error:</div><div><br></div><div><div>AttributeError: 'NoneType' object has no attribute 'id'</div><div>Building kd-Tree  0% |                                        | ETA:  --:--:-- ^MTraceback (most recent call last):</div>

<div>  File "test.py", line 318, in <module></div><div>    le=c-0.5*WW, re=c+0.5*WW)</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4-py2.7-linux-x86_64.egg/yt/utilities/amr_kdtree/amr_kdtree.py", line 376, in __init__</div>

<div>    self._build(root_grids, None, self.domain_left_edge, self.domain_right_edge)</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4-py2.7-linux-x86_64.egg/yt/utilities/amr_kdtree/amr_kdtree.py", line 1059, in _build</div>

<div>    set_leaf(current_node, current_node.parent_grid, current_node.l_corner, current_node.r_corner)</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4-py2.7-linux-x86_64.egg/yt/utilities/amr_kdtree/amr_kdtree.py", line 154, in set_leaf</div>

<div>    thisnode.grid = <a href="http://grid_id.id/" target="_blank">grid_id.id</a></div><div>AttributeError: 'NoneType' object has no attribute 'id'</div><div><br></div><div><br></div><div>I am not sure what is causing this.</div>

<div><br></div><div>Thanks very much,</div><div>Renyue</div><div><br></div><div><br></div><div><div>On Jan 8, 2013, at 12:08 PM, Renyue Cen wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">Hi Sam,<div>

<br></div><div>your transpose fix DOES change things and it indeed may working now. </div><div>Here is the first images I got for comparison.</div><div>I am going to make a few more pictures to see if things are all good.</div>

<div>Thanks very much,</div><div><span><test1.png></span><span><test2.png></span></div><div>Best,</div><div>Renyue</div><div><br></div><div><div><div>On Jan 8, 2013, at 11:25 AM, Sam Skillman wrote:</div><br>
<blockquote type="cite">
<div dir="ltr"><p dir="ltr">Hi Renyue,</p><p dir="ltr">I have actually seen this on one other system but I could never reproduce it. Could you tell me the version of yt you are using? If you run "yt instinfo" it should tell you. I haven't seen this bug for the last few months so I thought it was gone.  </p><p dir="ltr">Additionally, can you try the following at the end of your script:</p><p dir="ltr">im=cam.snapshot('test1.png')<br>
</p><p>write_bitmap(im, 'test2.png', transpose=False)</p><p>I think there may have been something wrong with the transposing of the image for a short time period a few months ago.  I have very sporadic and unreliable internet at AAS but I'll try to respond as quickly as possible.</p><p>Sorry for the trouble,</p><p>Sam</p><p><br></p>
<div class="gmail_quote">On Jan 7, 2013 10:11 AM, "Renyue Cen" <<a href="mailto:cen@astro.princeton.edu" target="_blank">cen@astro.princeton.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div style="word-wrap:break-word">Hi,<div><br></div><div>I did some simple volume rendering with the following script:</div><div><br></div><div><div>    volume2 = AMRKDTree(pf, fields=["Dark_Matter_Density"],</div>




<div>                no_ghost=False, tree_type="domain",</div><div>                le=c-0.5*WW, re=c+0.5*WW)</div><div>    cam = pf.h.camera(c, L, W, N, tf, volume=volume2, no_ghost=False,</div><div>                north_vector=L, steady_north=True)</div>




<div>    cam.snapshot(fn="%s_iso-DMdensity-%3.3d.png" % (filenameTHIS, j))</div></div><div><br></div><div><br></div><div>I got rather strange results in that the pictures look symmetric, which I am pretty</div>



<div>
sure can not be true.</div><div>I attach the obtained plot.</div><div>Note that I am using KD tree and using 32 cores. </div><div><br></div><div>Your help at your earliest convenience is appreciated.</div><div>Best,</div>




<div>Renyue</div><div><br></div><div><br></div><div><span><C15z1600.0043_iso-DMdensity-000.png></span></div></div></blockquote></div>
</div>
</blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>