Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F68639886
setunits_6.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, 07:17
Size
738 B
Mime Type
text/x-python
Expires
Sun, Jun 30, 07:17 (2 d)
Engine
blob
Format
Raw Data
Handle
18613843
Attached To
rPNBODY pNbody
setunits_6.py
View Options
#!/usr/bin/env python
from
pNbody
import
*
nb
=
Nbody
(
"/obs/nbody/cosmo/400h-1/snap.slice/snapshot_0000.slice.100"
,
ftype
=
'gadget'
,
unitsfile
=
'/obs/nbody/cosmo/400h-1/params'
)
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)
units
=
units
.
Unit_g
/
units
.
Unit_cm
**
3
print
nb
.
Rho
(
units
=
units
)
.
mean
()
# density in the code 4.97724e-08
Event Timeline
Log In to Comment