Page MenuHomec4science

pget_VirialRadius
No OneTemporary

File Metadata

Created
Fri, Nov 22, 20:53

pget_VirialRadius

#!/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