Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92695397
pget_VirialRadius
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, Nov 22, 20:53
Size
1 KB
Mime Type
text/x-python
Expires
Sun, Nov 24, 20:53 (2 d)
Engine
blob
Format
Raw Data
Handle
22488609
Attached To
rGTOOLS Gtools
pget_VirialRadius
View Options
#!/usr/bin/env python
from optparse import OptionParser
import Ptools as pt
from pNbody import *
from pNbody import units
from pNbody import ctes
import string
from pNbody import units,io,ctes
from scipy.optimize import bisect as bisection
def parse_options():
usage = "usage: %prog [options] file"
parser = OptionParser(usage=usage)
parser.add_option("--dX",
action="store",
dest="dX",
type="float",
default = 200,
help="over density",
metavar=" STRING")
parser.add_option("--Rmax",
action="store",
dest="Rmax",
type="float",
default = 100,
help="max radius",
metavar=" FLOAT")
parse = pt.add_units_options(parser)
parser = pt.add_ftype_options(parser)
(options, args) = parser.parse_args()
files = args
return files,options
########################################################################
# MAIN
########################################################################
if __name__ == '__main__':
files,opt = parse_options()
for file in files:
nb = Nbody(file,ftype=opt.ftype)
# define local units
unit_params = pt.do_units_options(opt)
#system_of_units = units.Set_SystemUnits_From_Params(unit_params)
nb.set_local_system_of_units(params=unit_params)
if not nb.isComovingIntegrationOn():
nb.omega0 = unit_params['Omega0']
nb.GetVirialRadius(X=opt.dX,Rmax=opt.Rmax)
Event Timeline
Log In to Comment