[yt-users] 1D matter power spectrum

gso at physics.ucsd.edu gso at physics.ucsd.edu
Mon Mar 7 20:10:12 PST 2011


I just tried

from yt.mods import *
from yt.utilities.kdtree import *
amods.two_point_functions.TwoPointFunctions

at the very beginning of the last script on this page
http://yt.enzotools.org/doc/analysis_modules/two_point_functions.html?highlight=two%20point%20function#tpf-tpf

but it still gives me the same error as before saying the function isn't
defined.

From
G.S.

> Hi Geoffrey,
>
> Try:
>
> amods.two_point_functions.TwoPointFunctions
>
> amods will auto-load.
>
> -Matt
>
> On Mon, Mar 7, 2011 at 10:35 PM,  <gso at physics.ucsd.edu> wrote:
>> Got the following error at the bottom of this email.  I'm using the
>> Metadata-Version: 1.0
>> Name: yt
>> Version: 2.1dev
>> according to dev-yt/src/yt-hg/yt.egg-info/PKG-INFO
>> it's the version installed with the install script, do I have to do
>> something else to change branch? like >hg up -C yt
>> or something else?
>>
>> From
>> G.S.
>>
>> [gso at login-4-40 64_SN_nometal]$ python correlation.py
>> yt : [INFO     ] 2011-03-07 18:43:09,750 Loading plugins from
>> /home/gso/.yt/my_plugins.py
>> yt : [INFO     ] 2011-03-07 18:43:09,845 Parameters: current_time
>>    = 0.81651284466
>> yt : [INFO     ] 2011-03-07 18:43:09,845 Parameters: domain_dimensions
>>    = [64, 64, 64]
>> yt : [INFO     ] 2011-03-07 18:43:09,845 Parameters: domain_left_edge
>>    = [ 0.  0.  0.]
>> yt : [INFO     ] 2011-03-07 18:43:09,845 Parameters: domain_right_edge
>>    = [ 1.  1.  1.]
>> yt : [INFO     ] 2011-03-07 18:43:09,845 Parameters:
>> cosmological_simulation   = 1
>> yt : [INFO     ] 2011-03-07 18:43:09,846 Parameters: current_redshift
>>    = 99.0
>> yt : [INFO     ] 2011-03-07 18:43:09,846 Parameters: omega_lambda
>>    = 0.7
>> yt : [INFO     ] 2011-03-07 18:43:09,846 Parameters: omega_matter
>>    = 0.3
>> yt : [INFO     ] 2011-03-07 18:43:09,846 Parameters: hubble_constant
>>    = 0.7
>> yt : [INFO     ] 2011-03-07 18:43:09,994 Storing the binary hierarchy
>> yt : [INFO     ] 2011-03-07 18:43:10,000 Gathering a field list (this
>> may
>> take a moment.)
>> yt : [INFO     ] 2011-03-07 18:43:11,578 Adding Emissivity to list of
>> fields
>> yt : [INFO     ] 2011-03-07 18:43:11,578 Adding Grey_Radiation_Energy to
>> list of fields
>> Warning: invalid value encountered in sqrt
>> Warning: invalid value encountered in sqrt
>> 262144.0 n
>> Traceback (most recent call last):
>>  File "correlation.py", line 30, in <module>
>>    tpf = TwoPointFunctions(pf, ['Density', 'CellVolume'],
>> NameError: name 'TwoPointFunctions' is not defined
>>
>>> Geoffrey,
>>>
>>> I've just added the modification to the 'yt' branch. Update and you
>>> should
>>> have it. I've added these two parameters to the TwoPointFunctions()
>>> class:
>>>
>>> theta : Float
>>>     For random pairs of points, the second point is found by traversing
>>>     a distance along a ray set by the angle (theta, phi) from the first
>>>     point. To keep this angle constant, set ``theta`` to a value in the
>>>     range [0, 2pi). Default = None, which will randomize theta for
>>>     every pair of points.
>>> phi : Float
>>>     Similar to theta above, but the range of values is [-pi/2, pi/2].
>>>     Default = None, which will randomize phi for every pair of points.
>>>
>>> In this way you can set your constant ray to any angle.
>>>
>>> Good luck!
>>>
>>>
>>> Stephen Skory
>>> stephenskory at yahoo.com
>>> http://stephenskory.com/
>>> 510.621.3687 (google voice)
>>> _______________________________________________
>>> 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
>>
> _______________________________________________
> 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