本文整理汇总了Python中amuse.units.optparse.OptionParser类的典型用法代码示例。如果您正苦于以下问题:Python OptionParser类的具体用法?Python OptionParser怎么用?Python OptionParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OptionParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-d", dest="Julian_date", unit=units.day,
type=float, default = 2438871.5|units.day,
help="julian date [%default]")
return result
示例2: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-o",
dest="output_filename", default ="SunVenusEarth",
help="output filename [%default]")
return result
示例3: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-f", dest="filename", default = "gravity.hdf5", help="output filename [gravty.hdf5]")
result.add_option("-l", unit=units.kpc,
dest="lim", type="float", default = -1|units.kpc, help="axis length [1000] %unit")
return result
示例4: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-t", unit=units.Myr,
dest="t_end", type="float", default = 20|units.day,
help="end time of the simulation [%default]")
return result
示例5: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-M", unit=units.MSun,
dest="Mstar", type="float",default = 10.|units.MSun,
help="stellar mass [1] %unit")
result.add_option("-z", dest="z", type="float", default = 0.02,
help="metalicity [0.02]")
return result
示例6: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-f", dest="filename", default = "proto_solar_cluster_life.hdf5",
help="output filename [%default]")
result.add_option("-t", unit=units.Gyr,
dest="tplot", type="float", default = 3|units.Gyr,
help="moment of the plot [%default]")
return result
示例7: parse_arguments
def parse_arguments():
from amuse.units.optparse import OptionParser
parser = OptionParser()
parser.add_option("--test",
dest="test",type="int",default=1,
help="")
options, args = parser.parse_args()
return options.__dict__
示例8: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-t", unit=units.s,
dest="tplot", type="float", default = 300|units.s,
help="plotting time [%default]")
result.add_option("-f",
dest="filename", default = "supernova_sph_gadget.amuse",
help="input filename [%default]")
return result
示例9: new_option_parser
def new_option_parser():
result = OptionParser()
result.add_option(
"-o", "--orbitalperiod",
default=1000 | units.yr,
dest="orbital_period",
help="initial orbital period of the binary (in years)",
type="float",
unit=units.yr
)
result.add_option(
"-k", "--kpratio",
default=0.8,
dest="kinetic_to_potential_ratio",
help="kinetec to potential energy ratio, values less than 1.0 correspond to bound systems",
type="float"
)
result.add_option(
"--periods",
default=10,
dest="periods",
help="number of orbital periods to evolve the binary",
type="int"
)
result.add_option(
"--age",
default=10 | units.Myr,
dest="age",
help="initial age of the stars to start the simulation with",
type="float",
unit=units.Myr
)
return result
示例10: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-t", unit=units.Gyr,
dest="t_end", type="float", default = 4.5|units.Gyr,
help="end time of the simulation [%default]")
result.add_option("-f", dest="filename", default = "",
help="output filename")
return result
示例11: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-N", dest="N", type="int",default = 2000,
help="number of stars [%default]")
result.add_option("-R", dest="Rvir", type="float",
unit=units.parsec, default = 0.5|units.parsec,
help="cluser virial radius [%default]")
result.add_option("-Q", dest="Qvir", type="float",default = 0.5,
help="virial ratio [%default]")
result.add_option("-F", dest="Fd", type="float",default = 1.6,
help="fractal dimension [%default]")
return result
示例12: new_option_parser
def new_option_parser():
result = OptionParser()
result.add_option("-N", dest="N", type="int",default = 1000,
help="number of stars [10]")
result.add_option("-m", unit=units.MSun,
dest="m", type="float",default = 1|units.MSun,
help="minimum mass of the mass function [0.1] %unit")
result.add_option("-M", unit=units.MSun,
dest="M", type="float",default = 100|units.MSun,
help="maximum mass of the mass function [100] %unit")
result.add_option("-x",
dest="ximf", type="float",default = -2.35,
help="mass function slope [-2.35]")
return result
示例13: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-M", unit=units.MSun, dest="Mstar", type="float",default = 1.|units.MSun, help="stellar mass [%default]")
result.add_option("--dmdt", unit=units.MSun/units.yr, dest="dmdt", type="float", default = -0.01|(units.MSun/units.yr), help="dmdt [%default]")
result.add_option("-z", dest="z", type="float", default = 0.02, help="metalicity [%default]")
return result
示例14: parse_arguments
def parse_arguments():
parser = OptionParser()
parser.add_option("-N", dest="number_of_stars", type="int", default=100,
help="The number of stars in the cluster [%default].")
parser.add_option("-s", dest="size", type="float", unit=units.parsec, default=10,
help="The total size of the cluster [%default %unit].")
parser.add_option("-t", dest="end_time", type="float", unit=units.Gyr, default=0.1,
help="The end time of the simulation [%default %unit].")
options, args = parser.parse_args()
return options.__dict__
示例15: new_option_parser
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-N", dest="N", type="int",default = 100,
help="number of sph particles [100]")
result.add_option("-M", unit=units.MSun,
dest="Mtot", type="float", default = 1|units.MSun,
help="Mass of molcular cloud [%default]")
result.add_option("-R", unit=units.AU,
dest="Rvir", type="float", default = 100|units.AU,
help="Radius of cloud [%default]")
result.add_option("-r", unit=units.AU,
dest="rsink", type="float", default = 100|units.AU,
help="Radius of the sink [%default]")
return result