当前位置: 首页>>代码示例>>Python>>正文


Python OptionParser.add_option方法代码示例

本文整理汇总了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
开发者ID:jilkoval,项目名称:amuse,代码行数:9,代码来源:XiTau_RLOF.py

示例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
开发者ID:amusecode,项目名称:amuse,代码行数:9,代码来源:2017arXiv170307029H_Fig3.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:9,代码来源:solarsystem.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:9,代码来源:plot_gravity.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:11,代码来源:stellar_gyration_radius.py

示例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
开发者ID:amusecode,项目名称:amuse,代码行数:11,代码来源:plot_solar_cluster_in_life_galaxy.py

示例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__
开发者ID:stevemcmillan,项目名称:amuse,代码行数:11,代码来源:test_secularmultiple.py

示例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
开发者ID:amusecode,项目名称:amuse,代码行数:12,代码来源:plot_supernova_sph.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:13,代码来源:sun_and_M67.py

示例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
开发者ID:amusecode,项目名称:amuse,代码行数:37,代码来源:unstable_binary.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:17,代码来源:stellar_isochrone.py

示例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
开发者ID:amusecode,项目名称:amuse,代码行数:17,代码来源:plot_fractal_clumpy_cluster.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:19,代码来源:hydro_simple.py

示例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
开发者ID:Ingwar,项目名称:amuse,代码行数:19,代码来源:CDG_gd_imf.py

示例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
开发者ID:amusecode,项目名称:amuse,代码行数:19,代码来源:plot_solar_comparison.py


注:本文中的amuse.units.optparse.OptionParser.add_option方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。