[yt-users] Find clumps - callback

David Collins dcollins at physics.ucsd.edu
Thu Nov 19 10:55:14 PST 2009


On Thu, Nov 19, 2009 at 10:33 AM, Britton Smith <brittonsmith at gmail.com> wrote:
> I think you're missing an import of the clump_tools modules.
> Add this:
> import yt.extensions.clump_tools

I have minor clarification to Britton's response--

if you do

>>> import yt.extensions.clump_tools

then you need to call

>>> all_clumps = yt.extensions.clump_toolsreturn_all_clumps(master_clump)
but if you import as

>>> import yt.extensions.clump_tools as clump_tools

then the call simplifies to

>>> all_clumps = clump_tools.return_all_clumps(master_clump)

Happy Clumping,
d.

>

> That should do it.
>
> Britton
>
> On Thu, Nov 19, 2009 at 11:21 AM, Elizabeth Harper-Clark
> <h-clark at cita.utoronto.ca> wrote:
>>
>> mmm, I seem to be having a problem:
>>
>> Traceback (most recent call last):
>>   File "find_clumps.py", line 55, in <module>
>>     all_clumps = clump_tools.return_all_clumps(master_clump)
>> NameError: name 'clump_tools' is not defined
>>
>> python file attached. I tried clump_tool (no s) but that did not work.
>>
>> What am I doing wrong?
>>
>> libby
>>
>>
>> 2009/11/13 David Collins <dcollins at physics.ucsd.edu>
>>>
>>> Hi Libby (and everyone else)
>>>
>>> I've added a new module called  yt.extensions.clump_tools to the
>>> trunk.  This module has three functions that should make it easier to
>>> visualize your clumps.
>>>
>>> So Britton's Clump attaches the clump hierarchy to whatever you call
>>> find_clumps on.  This is somewhat like what Rosolowsky et al 2008 do
>>> with their Dendrograms.  Two of these functions (return_all_clumps and
>>> return_bottom_clumps) return flatten arrays of clumps from what
>>> find_clumps does.  The third function in the module (clump_list_sort)
>>> sorts the list for ease of plotting.
>>>
>>> So first you'll do something like
>>> region = pf.h.sphere( radius = 0.1, center = [0.5]*3)
>>> base = Clump(region, *args)
>>> find_clumps(base, *args)
>>>
>>> base then has children, each of which then also have children, etc.
>>> This second generation of children is more fun because you don't have
>>> to feed them but you still get to buy them fun toys.
>>>
>>> To plot the entire hierarchy, you'd do something like this
>>> all_clumps = clump_tools.return_all_clumps(base)
>>> sorted = clump_tools.clump_list_sort(all_clumps)
>>> p.modify["clumps"](sorted)
>>>
>>> If you only want to plot the single objects, more akin to what one
>>> would find from CLUMPFIND, then use
>>> clump_tools.return_bottom_clumps
>>>
>>> return_all_clumps also adds a number, parentnumber, and level to each
>>> clump.
>>>
>>> There are two additional routines in the module, which are the
>>> recursive functions.  Ignore them, just call the wrapper.
>>>
>>> Hope this helps!
>>> d.
>>>
>>>
>>> On Mon, Nov 9, 2009 at 11:44 AM, Elizabeth Harper-Clark
>>> <h-clark at cita.utoronto.ca> wrote:
>>> > Hi Guys,
>>> >
>>> > I am (trying) to use the find_clumps routine to identify clumps in my
>>> > data
>>> > and I would then like to visualize it. How do I get the data from the
>>> > find_clumps routine into the callback:  p.modify["clumps"]() so I can
>>> > put it
>>> > on projections/slices? What should it then look like?
>>> >
>>> > Many thanks,
>>> >
>>> > Libby
>>> >
>>> > --
>>> > Elizabeth Harper-Clark MA MSci
>>> > PhD Candidate, Astrophysics, UofT
>>> >
>>> > www.astro.utoronto.ca/~h-clark
>>> > h-clark at cita.utoronto.ca
>>> > AIM: edphc1
>>> > MSN: edphc1 at hotmail.com
>>> > Skype: eharperclark
>>> > Office phone: 416-978-5759
>>> >
>>> > _______________________________________________
>>> > yt-users mailing list
>>> > yt-users at lists.spacepope.org
>>> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Sent from my Stone Tablet and carried by my Pterodactyl.
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>>
>> --
>> Elizabeth Harper-Clark MA MSci
>> PhD Candidate, Astrophysics, UofT
>>
>> www.astro.utoronto.ca/~h-clark
>> h-clark at cita.utoronto.ca
>> AIM: edphc1
>> MSN: edphc1 at hotmail.com
>> Skype: eharperclark
>> Office phone: 416-978-5759
>>
>> _______________________________________________
>> 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
>
>



-- 
Sent from my Stone Tablet and carried by my Pterodactyl.



More information about the yt-users mailing list