本文整理汇总了Python中amuse.units.optparse.OptionParser.add_option方法的典型用法代码示例。如果您正苦于以下问题:Python OptionParser.add_option方法的具体用法?Python OptionParser.add_option怎么用?Python OptionParser.add_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类amuse.units.optparse.OptionParser
的用法示例。
在下文中一共展示了OptionParser.add_option方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
示例2: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-f",
dest="filename", default ="GMC_R2pcN20k_SE_T45Myr.amuse",
help="output filename [%default]")
return result
示例3: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
示例4: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
示例5: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
示例10: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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
示例11: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-C", dest="C", default = "SeBa",
help="stellar evolution code [SeBa]")
result.add_option("-N", dest="N", type="int",default = 3000,
help="number of stars [10]")
result.add_option("-t", dest="t_end", unit=units.Myr,
type="float", default = 4500.0|units.Myr,
help="end time of the simulation [100] Myr")
result.add_option("-z", dest="z", type="float", default = 0.02,
help="metalicity [0.02]")
result.add_option("-p", dest="plot", action="store_true", default = False,
help="plot")
return result
示例12: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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]")
result.add_option("-s", dest="seed", type="int",default = 12345,
help="random number seed [%default]")
return result
示例13: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
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 stars [%default]")
result.add_option("-n", dest="n_steps", type="int",default = 6,
help="number of steps [10]")
result.add_option("-t", unit=units.Myr,
dest="t_end", type="float", default = 1|units.day,
help="end time of the simulation [%default]")
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.RSun,
dest="Rvir", type="float", default = 1|units.RSun,
help="Radius of cloud [%default]")
return result
示例14: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
def new_option_parser():
from amuse.units.optparse import OptionParser
result = OptionParser()
result.add_option("-N", dest="Ncl", type="int",default = 100,
help="number of stars [%default]")
result.add_option("-t", unit=units.Myr,
dest="t_end", type="float", default = 1|units.Gyr,
help="end time of the simulation [%default]")
result.add_option("-n", dest="n_steps", type="float", default = 100,
help="number of diagnostics output steps [%default]")
result.add_option("-r", unit=units.parsec,
dest="rcl", type="float", default = 10|units.parsec,
help="cluster half-mass radius [%default]")
result.add_option("-W", dest="W0", type="float", default = 7.0,
help="Dimension-less depth of the King potential (W0) [%default]")
return result
示例15: new_option_parser
# 需要导入模块: from amuse.units.optparse import OptionParser [as 别名]
# 或者: from amuse.units.optparse.OptionParser import add_option [as 别名]
def new_option_parser():
result = OptionParser()
result.add_option("-T", unit=units.K,
dest="Tstar", type="float",default = 5778 |units.K,
help="stellar temperature [%defailt]")
result.add_option("-L", unit=units.LSun,
dest="Lstar", type="float",default = 1 |units.LSun,
help="stellar luminosity [%defailt]")
result.add_option("-m", unit=units.MSun,
dest="mass", type="float",default = 1.0 |units.MSun,
help="stellar mass [%defailt]")
result.add_option("-t", unit=units.Myr,
dest="t_end", type="float", default = 4.6 |units.Gyr,
help="end time of the simulation [%defailt]")
result.add_option("-z", dest="z", type="float", default = 0.02,
help="metalicity [%defailt]")
return result