Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F68646983
setunits_4.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, Jun 28, 08:02
Size
558 B
Mime Type
text/x-python
Expires
Sun, Jun 30, 08:02 (2 d)
Engine
blob
Format
Raw Data
Handle
18614900
Attached To
rPNBODY pNbody
setunits_4.py
View Options
#!/usr/bin/env python
from
pNbody
import
*
nb
=
Nbody
(
"dsph.dat"
,
ftype
=
'gadget'
,
unitsfile
=
'params.dsph'
)
nb
.
localsystem_of_units
.
info
()
# trivial conversion factor into kpc,10**10Msol,Myr
print
"to km/s : *"
,
nb
.
localsystem_of_units
.
convertionFactorTo
(
units
.
Unit_kms
)
print
"to g/cm**3 : *"
,
nb
.
localsystem_of_units
.
convertionFactorTo
(
units
.
Unit_g
/
units
.
Unit_cm
**
3
)
print
"to Msol : *"
,
nb
.
localsystem_of_units
.
convertionFactorTo
(
units
.
Unit_Msol
)
print
"to Msol/yr : *"
,
nb
.
localsystem_of_units
.
convertionFactorTo
(
units
.
Unit_Msol
/
units
.
Unit_yr
)
Event Timeline
Log In to Comment