<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Works perfectly! Thank you so much!<div><br></div><div>Jingjing</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-31 4:12 GMT-04:00 Britton Smith <span dir="ltr"><<a href="mailto:brittonsmith@gmail.com" target="_blank">brittonsmith@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jingjing,<div><br></div><div>This is a bug that I thought I had fixed already.  The file is just missing an import of that function.  I have issued a pull request to fix this and it should be incorporated shortly.  Sorry about that.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Britton</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 1:55 AM, Chen Jingjing <span dir="ltr"><<a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Britton,<div><span style="font-size:12.8000001907349px">I tried to use the iterative_center_of_mass callback like this. Since you said it does not require a sphere callback, I assumed that I don't need to specify a sphere. </span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div>







<p><span>data_ds = yt.load('RD0008/RedshiftOutput0008')</span></p><span><p><span>







</span></p><p><span>hc = HaloCatalog(data_ds=data_ds, finder_method='hop')</span></p><p><span>







</span></p></span><p><span>hc.add_callback("iterative_center_of_mass")</span></p><p><span>







</span></p><p><span>hc.add_filter("quantity_value", "particle_mass", ">", 1e11, "Msun")</span></p><p><span>







</span></p><p><span>hc.create()</span></p><p>I got a error</p><p>







</p><p><span>NameError: global name 'periodic_distance' is not defined</span></p><p><span>So can you tell me what would be the right way?</span></p></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Thanks,</span></div><div><span style="font-size:12.8000001907349px">Jingjing</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-30 15:08 GMT-04:00 Britton Smith <span dir="ltr"><<a href="mailto:brittonsmith@gmail.com" target="_blank">brittonsmith@gmail.com</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jingjing,<div><br></div><div>To add that function to the HaloCatalog analysis, you need to do the following:</div><div><br></div><div>hc.add_callback("<span style="font-size:12.8000001907349px">sphere_field_max_recenter", "density")</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Note, this callback recenters an existing sphere, so you will need to have added a sphere with:</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">hc.add_callback("sphere")</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Make sure you add the sphere first.  Additionally, you might try the "iterative_center_of_mass" callback, which will calculate new centers by calculating the center of mass on a continually smaller sphere.  This one does not require a sphere callback and will actually write out the recentered positions.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Britton</span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Mar 30, 2015 at 7:27 PM, Chen Jingjing <span dir="ltr"><<a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Dear yt-users,<div>I am having a little problem on finding the exact center of a halo. I used to do</div><div><br></div><div><span>"hc = HaloCatalog(data_ds=data_ds, finder_method='</span><span>hop</span><span>')"</span></div><div><span><br></span></div><div><span>to create a halo catalog. But I think the position in the catalog is a little bit off the exact center judging from the plots I made. I need the exact center to compute the angular momentum so the off-center result could cause some problem. I tried to recenter at the maximum gas density by adding this line</span></div><div><span><br></span></div><div><span>"</span><span>hc.sphere_field_max_recenter</span><span>(</span><span>'</span><span>density</span><span>'</span><span>)</span>"</div><div><br></div><div>But I got an error, AttributeError: 'HaloCatalog' object has no attribute 'sphere_field_max_recenter'.</div><div><br></div><div>Can anyone tell me what is the right way to find the center as the location of maximum gas density?</div><div><br></div><div>Thanks,</div><div>Jingjing</div><span><font color="#888888">















<div><p><br></p><div><div><br></div>-- <br><div><div dir="ltr"><pre>Jingjing Chen [ <a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a> ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027<br>Cell Phone: <a href="tel:%2B1%28347%295746709" value="+13475746709" target="_blank">+1(347)5746709</a><br></pre></div></div>
</div></div></font></span></div>
<br></div></div>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></blockquote></div><br></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><pre>Jingjing Chen [ <a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a> ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027<br>Cell Phone: <a href="tel:%2B1%28347%295746709" value="+13475746709" target="_blank">+1(347)5746709</a><br></pre></div></div>
</div></div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></blockquote></div><br></div>
</div></div><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></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><pre>Jingjing Chen [ <a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a> ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027<br>Cell Phone: +1(347)5746709<br></pre></div></div>
</div>