[yt-users] Recenter Halo

Britton Smith brittonsmith at gmail.com
Tue Mar 31 01:12:06 PDT 2015


Hi Jingjing,

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.

Britton

On Tue, Mar 31, 2015 at 1:55 AM, Chen Jingjing <chenjj235 at gmail.com> wrote:

> Hi Britton,
> 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.
>
> data_ds = yt.load('RD0008/RedshiftOutput0008')
>
> hc = HaloCatalog(data_ds=data_ds, finder_method='hop')
>
> hc.add_callback("iterative_center_of_mass")
>
> hc.add_filter("quantity_value", "particle_mass", ">", 1e11, "Msun")
>
> hc.create()
>
> I got a error
>
> NameError: global name 'periodic_distance' is not defined
>
> So can you tell me what would be the right way?
>
> Thanks,
> Jingjing
>
> 2015-03-30 15:08 GMT-04:00 Britton Smith <brittonsmith at gmail.com>:
>
> Hi Jingjing,
>>
>> To add that function to the HaloCatalog analysis, you need to do the
>> following:
>>
>> hc.add_callback("sphere_field_max_recenter", "density")
>>
>> Note, this callback recenters an existing sphere, so you will need to
>> have added a sphere with:
>>
>> hc.add_callback("sphere")
>>
>> 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.
>>
>> Britton
>>
>> On Mon, Mar 30, 2015 at 7:27 PM, Chen Jingjing <chenjj235 at gmail.com>
>> wrote:
>>
>>> Dear yt-users,
>>> I am having a little problem on finding the exact center of a halo. I
>>> used to do
>>>
>>> "hc = HaloCatalog(data_ds=data_ds, finder_method='hop')"
>>>
>>> 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
>>>
>>> "hc.sphere_field_max_recenter('density')"
>>>
>>> But I got an error, AttributeError: 'HaloCatalog' object has no
>>> attribute 'sphere_field_max_recenter'.
>>>
>>> Can anyone tell me what is the right way to find the center as the
>>> location of maximum gas density?
>>>
>>> Thanks,
>>> Jingjing
>>>
>>>
>>>
>>> --
>>>
>>> Jingjing Chen [ chenjj235 at gmail.com ]
>>> Department of Astronomy
>>> Columbia University
>>> 550 West 120th Street
>>> New York, New York 10027
>>> Cell Phone: +1(347)5746709
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
>
> --
>
> Jingjing Chen [ chenjj235 at gmail.com ]
> Department of Astronomy
> Columbia University
> 550 West 120th Street
> New York, New York 10027
> Cell Phone: +1(347)5746709
>
>
> _______________________________________________
> 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/20150331/7f501243/attachment.html>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list