Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80129730
setunits_9.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Aug 30, 01:26
Size
526 B
Mime Type
text/x-python
Expires
Sun, Sep 1, 01:26 (2 d)
Engine
blob
Format
Raw Data
Handle
20306072
Attached To
rPNBODY pNbody
setunits_9.py
View Options
#!/usr/bin/env python
from
pNbody
import
units
,
io
,
ctes
from
numpy
import
*
gadgetparameterfile
=
"params.dSphCZ"
params
=
io
.
read_params
(
gadgetparameterfile
)
system_of_units
=
units
.
Set_SystemUnits_From_Params
(
params
)
G
=
ctes
.
GRAVITY
.
into
(
system_of_units
)
H
=
ctes
.
HUBBLE
.
into
(
system_of_units
)
HubbleParam
=
params
[
'HubbleParam'
]
rhoc
=
pow
(
HubbleParam
*
H
,
2
)
*
3
/
(
8
*
pi
*
G
)
print
rhoc
,
rhoc
*
80
,
"free of h"
rhoc
=
pow
(
H
,
2
)
*
3
/
(
8
*
pi
*
G
)
print
rhoc
,
rhoc
*
80
,
"in code units, including h"
H
=
0.1
G
=
43000.1
print
pow
(
H
,
2
)
*
3
/
(
8
*
pi
*
G
)
Event Timeline
Log In to Comment