<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><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">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 class="HOEnZb"><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>_______________________________________________<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></div>