[yt-users] how to call HaloMassFcn

Matthew Turk matthewturk at gmail.com
Wed Sep 8 19:21:26 PDT 2010


Hi Mike and Geoffrey,

To help alleviate with this, I've added a new list (which is created
at runtime, but can be re-created) called "available_analysis_modules"
to yt.mods.  So right now it looks like this:

>>> from yt.mods import *
>>> available_analysis_modules

['coordinate_transformation', 'halo_finding', 'halo_mass_function',
'halo_merger_tree', 'halo_profiler', 'hierarchy_subset', 'level_sets',
'light_cone', 'light_ray', 'simulation_handler',
'spectral_integrator', 'star_analysis', 'two_point_functions']

So you can then import from any of the api's in those directories.
This just uses a very simple guess at where the directory
analysis_modules is located, and won't support things like extensions
in external packages etc etc.  But it should get us most of the way
there...

-Matt

On Wed, Sep 8, 2010 at 7:06 PM, Michael Kuhlen <mqk at astro.berkeley.edu> wrote:
>
> I ran into the same problem today. The following works for me:
>
> from yt.mods import *
> from yt.analysis_modules.halo_mass_function.api import *
>
> I figured this out by looking in $YTDIR/yt/analysis_modules/.
>
> Mike
>
>
> gso at physics.ucsd.edu wrote:
>>
>> I'm getting this error on an old script I used to create the halo mass
>> function on Triton
>>
>> I had on top
>> from yt.analysis_modules.halo_finding.api import HaloMassFcn
>>
>> and got:
>>
>> Traceback (most recent call last):
>>  File "parallelHF.py", line 52, in <module>
>>    hmf = HaloMassFcn(pf, halo_file=filename[3]+"ParallelHopAnalysis.out",
>> NameError: name 'HaloMassFcn' is not defined
>>
>> I was wondering if this is because yt was updated to 2.0 on triton?
>> in the email there's an example of what to use for HaloFinder
>>
>> from yt.analysis_modules.halo_finding.api import HaloFinder
>>
>> so for HaloMassFcn do I do
>>
>> from yt.analysis_modules.halo_????.api import HaloMassFcn
>>
>> can someone fill in what ???? is, or how I can find that information?  Or
>> is the 2.0 manual out that I'm not aware of that has this information
>> already?
>>
>> From
>> G.S.
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
> --
> *********************************************************************
> *                                                                   *
> *  Dr. Michael Kuhlen              Theoretical Astrophysics Center  *
> *  email: mqk at astro.berkeley.edu   UC Berkeley                      *
> *  cell phone: (831) 588-1468      601 Campbell Hall                *
> *  skype username: mikekuhlen      Berkeley, CA 94720               *
> *                                                                   *
> *********************************************************************
> _______________________________________________
> 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