Пример #1
0
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
0
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
0
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
Пример #4
0
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
Пример #5
0
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
Пример #6
0
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__
Пример #7
0
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
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
Пример #9
0
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
Пример #10
0
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
0
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
Пример #12
0
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
Пример #13
0
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
Пример #14
0
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
Пример #15
0
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__
Пример #16
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-N", dest="N", type="int",default = 10000,
                      help="number of gas particles [%default]")
    result.add_option("-t", unit=units.Myr,
                      dest="t_end", type="float", default = 1|units.Myr,
                      help="end time of the simulation [%default]")
    result.add_option("-M", unit=units.MSun,
                      dest="Mtot", type="float", default = 1000|units.MSun,
                      help="Mass of the cloud [%default]")
    result.add_option("-R", unit=units.RSun,
                      dest="Rvir", type="float", default = 10|units.parsec,
                      help="Radius of the cloud [%default]")
    return result
Пример #17
0
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
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M", unit=units.MSun,
                      dest="Mprim", type="float",default = 10|units.MSun,
                      help="Mass of the primary star [%default] MSun")
    result.add_option("-m", unit=units.MSun,
                      dest="Msec", type="float",default = 1|units.MSun,
                      help="Mass of the secondary star [%default] MSun")
    result.add_option("-N", 
                      dest="Nsph", type="int",default = 100,
                      help="Number of sph particles per MSun [%default]")
    result.add_option("-t", unit=units.Myr, 
                      dest="t_coll", type="float", default = 0.01|units.Myr,
                      help="end time of the simulation [%default] Myr")
    return result
Пример #19
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-N", dest="N", type="int", default = 10000,
                      help="number of gas particles [%default]")
    result.add_option("-t", unit=units.Myr,
                      type="float",
                      dest="t_end", default = 1.0|units.Myr,
                      help="radiation time [%default]")
    result.add_option("-L", unit=units.LSun,
                      type="float",
                      dest="Lstar", default = 100|units.LSun,
                      help="luminosity of ionizing source [%default]")
    result.add_option("-d", unit=units.parsec,
                      dest="boxsize", default = 10|units.parsec,
                      help="size of the density box [%default]")
    return result
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("--tcoll", unit=units.Myr,
                      dest="tcoll", type="float",default = 1|units.Myr,
                      help="moment of collision [%default]")
    result.add_option("--tend", unit=units.Myr,
                      dest="tend", type="float",default = 1|units.Myr,
                      help="evolution after the collision [%default]")
    result.add_option("-M", unit=units.MSun,
                      dest="Mprim", type="float",default = 1|units.MSun,
                      help="Primary ZAMS mass [%default]")
    result.add_option("-m", unit=units.MSun,
                      dest="Msec", type="float",default = 1|units.MSun,
                      help="Secondary ZAMS mass [%default]")

    return result
Пример #21
0
def new_option_parser():
    result = OptionParser()
    result.add_option("-n", dest="n_steps", type="int", default = 1,
                      help="number of diagnostics time steps [10]")
    result.add_option("-f", dest="filename", default = None,
                      help="write output filename")
    result.add_option("-t", unit=units.Myr, 
                      dest="t_end", type="float", default = 0.000001|units.Myr,
                      help="end time of the simulation [0.0000001] %unit")
    return result
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f", 
                      dest="filename",default="XiTau_orbital_evolution.pkl")
#                      dest="filename",default="HD97131_orbital_evolution.pkl")    
    result.add_option("--nj", dest="nj",type="float",default=6)
    result.add_option("-t", unit=units.day,
                      dest="t_start",type="float",default=0|units.day)
    return result
Пример #23
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M", dest="Mprim", type="float",default = 5,
                      help="Mass of the primary star [%default] MSun")
    result.add_option("-m", dest="Msec", type="float",default = 3,
                      help="Mass of the secondary star [%default] MSun")
    result.add_option("-t", unit=units.Myr, dest="t_coll",
                      type="float", default = 1.0|units.Myr,
                      help="end time of the simulation [%default] Myr")
    return result
Пример #24
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-N", dest="Nsph", type="int", default = 20000,
                      help="number of gas particles [%default]")
    result.add_option("-M", unit=units.MSun,
                      dest="mass", type="float", default = 5.5|units.MSun,
                      help="mass of the star [%default]")
    result.add_option("-R", unit=units.AU,
                      dest="radius", type="float", default = 0.42|units.AU,
                      help="Size of star [%default]")
    return result
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M", unit= units.MSun,
                      dest="M", type="float",default = 2.0 | units.MSun,
                      help="stellar mass [1.0] %unit")
    result.add_option("-o", 
                      dest="output_filename", default ="merger_stellar_density_profile",
                      help="output filename [%default]")
    result.add_option("-z", dest="z", type="float", default = 0.02,
                      help="metalicity [0.02]")
    return result
Пример #26
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-n", dest="n_steps", type="int", default = 100,
                      help="number of diagnostics time steps [10]")
    result.add_option("-f", dest="filename", default = None,
                      help="write output filename")
    result.add_option("-t", unit=units.yr,
                      dest="t_end", type="float", default = 500|units.yr,
#                      dest="t_end", type="float", default = 1678|units.yr,
                      help="end time of the simulation [%default]")
    return result
Пример #27
0
def parse_arguments():
    parser = OptionParser()
    parser.add_option("-t", dest="timestep", type="float",
                      unit=units.Myr, default=0.1,
                      help="The timestep of the integrator [%default %unit].")
    parser.add_option("-a", dest="current_age", type="float",
                      unit=units.Myr, default=3.5,
                      help="The current age of the cluster [%default %unit].")
    parser.add_option("-c", dest="codes", action="append", type="string",
                      help="The code to evolve the particle (can be used"
                      "multiple times). Available codes: {}."
                      .format(codelist.keys()))
    parser.add_option("-f", dest="filename", type="string", default=None,
                      help="Save the plot in a file with 'name'"
                      "[show matplotlib if not given].")

    options, args = parser.parse_args()
    codes = options.codes or ["huayno"]
    filename = options.filename
    parameters = options.__dict__
    del parameters['codes']
    del parameters['filename']
    return codes, filename, parameters
Пример #28
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-N", 
                      dest="Nsph", type="int", 
                      default = 1000,
                      help="number of SPH particles[%default]")
    result.add_option("-M", unit=units.MSun,
                      dest="mass", type="float", 
                      default = 0.6 | units.MSun,
                      help="stellar mass [%default]")
    result.add_option("-t", unit=units.Myr,
                      dest="age", type="float", 
                      default = 10 | units.Myr,
                      help="stellar age [%default]")
    result.add_option("-o", unit=units.day**-1,
                      dest="omega", type="float", 
                      default = (24.47 | units.day)**-1,
                      help="stellar rotation [%default]")
    return result
Пример #29
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M", unit= units.MSun,
                      dest="M", type="float",default = 1.0 | units.MSun,
                      help="stellar mass [%default]")
    result.add_option("-t", unit = units.Myr,
                      dest="model_time", type="float", 
                      default = 4700.0|units.Myr,
                      help="end time of the simulation [%default]")
    result.add_option("-z", dest="z", type="float", 
                      default = 0.02, help="metalicity [%default]")
    return result
Пример #30
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("--tcoll", unit=units.Myr,
                      dest="tcoll", type="float", 
                      default = 150|units.Myr,
                      help="evolution time scale [%default]")
    result.add_option("--tend", unit=units.Myr,
                      dest="tend", type="float", 
                      default = 2|units.Gyr,
                      help="evolution time scale [%default]")
    result.add_option("-M", unit=units.MSun,
                      dest="Mprim", type="float", 
                      default = 3|units.MSun,
                      help="stellar mass [%default]")
    result.add_option("-m", unit=units.MSun,
                      dest="Msec", type="float", 
                      default = 1|units.MSun,
                      help="stellar mass [%default]")
    return result
Пример #31
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-N",
                      dest="Ndisk",
                      type="int",
                      default=100,
                      help="number of stars [10]")
    result.add_option("-n",
                      dest="n_steps",
                      type="int",
                      default=10,
                      help="number of steps [10]")
    result.add_option("-t",
                      dest="t_end",
                      type="float",
                      default=1,
                      help="end time of the simulation in bump orbits")
    result.add_option("-M",
                      dest="Mstar",
                      type="float",
                      default=1 | units.MSun,
                      help="Mass of the central star [%default]")
    result.add_option("--Mdisk",
                      dest="Mdisk",
                      type="float",
                      default=0.9 | units.MSun,
                      help="Mass of the disk [%default]")
    result.add_option("-r",
                      unit=units.AU,
                      dest="Rmin",
                      type="float",
                      default=10 | units.AU,
                      help="inner disk radius [%default]")
    result.add_option("-R",
                      unit=units.AU,
                      dest="Rmax",
                      type="float",
                      default=100 | units.AU,
                      help="outer disk radius [%default]")
    result.add_option("--Mbump",
                      unit=units.MSun,
                      dest="Mbump",
                      type="float",
                      default=0.1 | units.MSun,
                      help="bump mass [%default]")
    result.add_option("--Rbump",
                      unit=units.AU,
                      dest="Rbump",
                      type="float",
                      default=10 | units.AU,
                      help="bump radius [%default]")
    result.add_option("-a",
                      unit=units.AU,
                      dest="abump",
                      type="float",
                      default=20 | units.AU,
                      help="distance of bump from star [%default]")
    return result
Пример #32
0
def parse_options():
    parser = OptionParser()
    parser.add_option("-N", dest="Ncl", type="int",
        default = 1000, help="number of stars [%default]")
    parser.add_option("-M", dest="Mstar", unit=units.MSun,
        type="float", default = 100|units.MSun,
        help="Maximum stellar mass [%default]")
    parser.add_option("-m", dest="Mcut", unit=units.MSun,
        type="float", default = 0.3|units.MSun,
        help="Cut-off mass [%default]")
    parser.add_option("-r", dest="Rcl", unit=units.parsec,
        type="float", default = 3|units.parsec,
        help="cluster virial radius [%default]")
    parser.add_option("-t", dest="dt", unit=units.Myr,
        type="float", default = 0.1|units.Myr,
        help="Time resolution of the simulation [%default]")
    parser.add_option("-T", dest="t_end", unit=units.Myr,
        type="float", default = 10|units.Myr,
        help="End time of the simulation [%default]")
    parser.add_option("-f", dest="filename",
        type="string", default="CA_Exam_TLRH_hybrid.amuse",
        help="The file in which to save the data [%default]")

    options, arguments = parser.parse_args()
    return options.__dict__
Пример #33
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f", 
                      dest="filename", default = "starandplanets.amuse",
                      help="input filename [%default]")
    result.add_option("-F", 
                      dest="outfile", default = None,
                      help="output filename [%default]")
    result.add_option("--n_comets", 
                      dest="n_comets", type="int", default = 100,
                      help="number of comets [%default]")
    result.add_option("--m_comets", unit=units.MEarth,
                      dest="m_comets", type="float", default = 0|units.MEarth,
                      help="mass of all comets for a 1MSun star[%default]")
    result.add_option("--seed", 
                      dest="seed", type="int", default = None,
                      help="random number seed [%default]")
    result.add_option("--q_min", unit=units.au,
                      dest="q_min", type="float",default = 32|units.au,
                      help="initial minimal pericenter distance [%default]")
    result.add_option("--q_max", unit=units.au,
                      dest="q_max", type="float",default = 100000.|units.au,
                      help="initial maximum pericenter distance [%default]")
    result.add_option("--a_min", unit=units.au,
                      dest="a_min", type="float",default = 3000.|units.au,
                      help="initial maximum distance [%default]")
    result.add_option("--a_max", unit=units.au,
                      dest="a_max", type="float",default = 100000.|units.au,
                      help="initial maximum distance [%default]")
    result.add_option("--m_min", unit=units.MSun,
                      dest="m_min", type="float",default = 0.0|units.MSun,
                      help="maximum stellar mass with comets [%default]")
    result.add_option("--m_max", unit=units.MSun,
                      dest="m_max", type="float",default = 100.|units.MSun,
                      help="maximum stellar mass with comets [%default]")
    return result
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f",
                      dest="filename",
                      default=None,
                      help="input filename [%default]")
    result.add_option("-F",
                      dest="outfile",
                      default=None,
                      help="output filename [%default]")
    result.add_option("--name",
                      dest="name",
                      default="Sun",
                      help="disk mass [%default]")
    result.add_option("--fdisk",
                      dest="fdisk",
                      type="float",
                      default=-1,
                      help="disk mass fraction [%default]")
    result.add_option("--Mdisk",
                      dest="Mdisk",
                      type="float",
                      unit=units.MSun,
                      default=0.01 | units.MSun,
                      help="disk mass [%default]")
    result.add_option("--mdisk",
                      unit=units.kg,
                      dest="mdisk",
                      type="float",
                      default=0.0 | units.kg,
                      help="mass of individual disk particles [%default]")
    result.add_option("--ndisk",
                      dest="ndisk",
                      type="int",
                      default=100,
                      help="number of disk particles per MSun [%default]")
    result.add_option("--rmin",
                      unit=units.au,
                      dest="rmin",
                      type="float",
                      default=10 | units.au,
                      help="minimal disk radius [%default]")
    result.add_option("--rmax",
                      unit=units.au,
                      dest="rmax",
                      type="float",
                      default=100 | units.au,
                      help="maximal disk radius [%default]")
    result.add_option("-Q",
                      dest="Q",
                      type="float",
                      default=1.0,
                      help="Toomre Q parameter [%default]")
    result.add_option("-a",
                      dest="alpha",
                      type="float",
                      default=1.5,
                      help="Disk density profile [%default]")
    result.add_option("--seed",
                      dest="seed",
                      type="int",
                      default=-1,
                      help="random number seed [%default]")
    return result
Пример #35
0
def arguments():
    from amuse.units.optparse import OptionParser
    from shutil import copy2
    import cPickle

    result = OptionParser()
    result.add_option("--dir",
                      dest="directory",
                      default="./output",
                      help="Input/output file directory [%default]")
    #~ result.add_option("-i",
    #~ dest="file_index", default = 0, type="int", help="Input file index [%default]")
    result.add_option("--plot",
                      dest="do_plot",
                      default=False,
                      help="show plot [%default]")
    result.add_option("--end",
                      dest="end_time",
                      default=10 | units.day,
                      unit=units.day,
                      type=float,
                      help="end time of simulation in %unit[%default]")
    result.add_option("--step",
                      dest="output_step",
                      default=10,
                      type="int",
                      help="steps between output [%default]")
    result.add_option(
        "--force",
        dest="forcing",
        default="elevation",
        help="forcing used on boundary (elevation or flow) [%default]")

    o, a = result.parse_args()

    #~ label=str(abs(hash(str(vars(o)))))
    label = "run"
    with open(os.path.join(o.directory, label + ".args"), "w") as f:
        f.write(str(vars(o)))
        #~ cPickle.dump(str(vars(o)),f)

    copy2(__file__, o.directory)

    return o, a
Пример #36
0
def parse_options():
    parser = OptionParser()
    parser.add_option("-N",
                      dest="Ncl",
                      type="int",
                      default=128,
                      help="number of stars [%default]")
    parser.add_option("-M",
                      dest="Mcl",
                      unit=units.MSun,
                      type="float",
                      default=10**6 | units.MSun,
                      help="clustermass [%default]")
    parser.add_option("-R",
                      dest="Rcl",
                      unit=units.parsec,
                      type="float",
                      default=10 | units.parsec,
                      help="cluster half-mass radius [%default]")
    parser.add_option("-n",
                      dest="Ngas",
                      type="int",
                      default=1024,
                      help="number of gas particles [%default]")
    parser.add_option("-m",
                      dest="Mgas",
                      unit=units.MSun,
                      type="float",
                      default=10**7 | units.MSun,
                      help="gas mass [%default]")
    parser.add_option("-r",
                      dest="Rgas",
                      unit=units.parsec,
                      type="float",
                      default=100 | units.parsec,
                      help="gas radius [%default]")
    parser.add_option("-d",
                      dest="d",
                      unit=units.parsec,
                      type="float",
                      default=150 | units.parsec,
                      help="Impact parameter of the encounter [%default]")
    parser.add_option("-v",
                      dest="v_inf",
                      unit=units.kms,
                      type="float",
                      default=1 | units.kms,
                      help="Cluster velocity at infinity [%default]")
    parser.add_option("-T",
                      dest="dt",
                      unit=units.Myr,
                      type="float",
                      default=0.2 | units.Myr,
                      help="Snapshot output timestep [%default]")
    parser.add_option(
        "-f",
        dest="filename",
        type="string",
        default="test.amuse",
        help="The file in which to save the snapshots [%default]")

    options, arguments = parser.parse_args()
    return options.__dict__
Пример #37
0
def new_option_parser(usage=None):
    from amuse.units.optparse import OptionParser
    result = OptionParser(usage=usage)
    result.add_option("--wind",
                      dest="u10",
                      default=10. | units.m / units.s,
                      unit=units.m / units.s,
                      type=float,
                      help="wind velocity at 10m [%default]")
    result.add_option("--depth",
                      dest="depth",
                      default=100. | units.m,
                      unit=units.m,
                      type=float,
                      help="depth [%default]")
    result.add_option("--box",
                      dest="L",
                      default=100. | units.km,
                      unit=units.km,
                      type=float,
                      help="boxsize [%default]")
    result.add_option("--flow",
                      dest="flow",
                      default=0.0521 | units.rev / units.s,
                      unit=units.rev / units.s,
                      type=float,
                      help="lowest freq [%default]")
    result.add_option("--fhigh",
                      dest="fhigh",
                      default=1. | units.rev / units.s,
                      unit=units.rev / units.s,
                      type=float,
                      help="high freq [%default]")
    result.add_option("--grav",
                      dest="grav",
                      default=9.81 | units.m / units.s**2,
                      unit=units.m / units.s**2,
                      type=float,
                      help="gravitational acceleration [%default]")
    result.add_option("--air",
                      dest="rho_air",
                      default=1.28 | units.kg / units.m**3,
                      unit=units.kg / units.m**3,
                      type=float,
                      help="density of air [%default]")
    result.add_option("--water",
                      dest="rho_water",
                      default=1025. | units.kg / units.m**3,
                      unit=units.kg / units.m**3,
                      type=float,
                      help="density of water [%default]")
    result.add_option("--N",
                      dest="N",
                      default=100,
                      type=int,
                      help="resolution [%default]")
    result.add_option("--aspect",
                      dest="aspect",
                      default=0.2,
                      type=float,
                      help="aspect ratio of domain [%default]")
    result.add_option("--frelax",
                      dest="under_relaxation_factor",
                      default=0.001,
                      type=float,
                      help="solver under relaxation factor [%default]")
    result.add_option("--nfreq",
                      dest="msc",
                      default=32,
                      type=int,
                      help="number of frequency bins [%default]")
    result.add_option("--ndir",
                      dest="mdc",
                      default=36,
                      type=int,
                      help="number of directional bins [%default]")
    result.add_option("--visc",
                      dest="viscosity",
                      default=0. | units.cm**2 / units.s,
                      unit=units.cm**2 / units.s,
                      type=float,
                      help="kinematic/turbulent viscosity in %unit [%default]")
    return result
Пример #38
0
def new_option_parser():
    result = OptionParser()
    result.add_option("--seed",
                      dest="seed",
                      type="int",
                      default=666,
                      help="random number seed [%default]")
    result.add_option("-N",
                      dest="Nstars",
                      type="int",
                      default=3,
                      help="Number of stars [%default]")
    result.add_option("-f",
                      dest="filename",
                      default="initial_cluster.amuse",
                      help="input filename")
    result.add_option("-R",
                      unit=units.parsec,
                      dest="Rcluster",
                      type="int",
                      default=1000 | units.AU,
                      help="Cluster size [%default]")
    result.add_option("-n",
                      dest="n",
                      type="int",
                      default=100,
                      help="Number of pebbels per star [%default]")
    return result
Пример #39
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M",
                      unit=units.MSun,
                      dest="Mprim",
                      type="float",
                      default=12 | units.MSun,
                      help="primar mass [%defailt]")
    result.add_option("-m",
                      unit=units.MSun,
                      dest="Msec",
                      type="float",
                      default=10 | units.MSun,
                      help="secondary mass [%defailt]")
    result.add_option("-T",
                      unit=units.Myr,
                      dest="end_time",
                      type="float",
                      default=25.0 | units.Myr,
                      help="end time of the simulation [%defailt]")
    result.add_option("-a",
                      unit=units.RSun,
                      dest="a",
                      type="float",
                      default=205 | units.RSun,
                      help="orbital separation [%defailt]")
    result.add_option("-e",
                      dest="e",
                      type="float",
                      default=0.0,
                      help="orbital eccentricity [%defailt]")
    result.add_option("-n",
                      dest="n_steps",
                      type="float",
                      default=100,
                      help="number of output steps [%defailt]")
    return result
Пример #40
0
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
Пример #41
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f",
                      dest="filename",
                      default=None,
                      help="input filename [%default]")
    result.add_option("-F",
                      dest="outfile",
                      default=None,
                      help="output filename [%default]")
    result.add_option("-p",
                      dest="phi",
                      type="float",
                      default=None,
                      help="rotate under x-axis [%default]")
    result.add_option("-t",
                      dest="theta",
                      type="float",
                      default=-62.5,
                      help="rotate under y-axis [%default]")
    result.add_option("--type",
                      dest="rotate_type",
                      default="",
                      help="rotate particle type [%default]")
    result.add_option("-c",
                      dest="chi",
                      type="float",
                      default=0.0,
                      help="rotate under z-axis [%default]")
    return result
Пример #42
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-N",
                      dest="N",
                      type="int",
                      default=1000,
                      help="number of stars [%default]")
    result.add_option("-t",
                      unit=units.Myr,
                      dest="t_end",
                      default=0.1 | units.Myr,
                      help="radiation time [%default]")
    result.add_option("-L",
                      unit=units.LSun,
                      dest="Lstar",
                      default=100 | units.LSun,
                      help="luminosity of ionizing source [%default]")
    result.add_option("-p",
                      unit=units.amu / units.cm**3,
                      dest="rho",
                      default=1 | units.amu / units.cm**3,
                      help="interstellar density [%default] amu/cm^3")
    result.add_option("-d",
                      unit=units.parsec,
                      dest="boxsize",
                      default=100 | units.parsec,
                      help="size of the density box [%default]")
    return result
Пример #43
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-n",
                      dest="n_steps",
                      type="int",
                      default=1000,
                      help="number of diagnostics time steps [%default]")
    result.add_option("-N",
                      dest="Ngas",
                      type="int",
                      default=1024,
                      help="number of gas particles [%default]")
    result.add_option("-M",
                      unit=units.MSun,
                      dest="Mgas",
                      type="float",
                      default=1 | units.MSun,
                      help="Mass of the gas [%default]")
    result.add_option("-R",
                      unit=units.AU,
                      dest="Rgas",
                      type="float",
                      default=1 | units.AU,
                      help="Size of the gas distribution [%default]")
    result.add_option("-a",
                      unit=units.AU,
                      dest="a",
                      type="float",
                      default=0.2 | units.AU,
                      help="initial orbital separation [%default]")
    result.add_option("-e",
                      dest="ecc",
                      type="float",
                      default=0.0,
                      help="initial orbital eccentricity [%default]")
    result.add_option("-t",
                      unit=units.yr,
                      dest="t_end",
                      type="float",
                      default=10 | units.yr,
                      help="end time of the simulation [%default]")
    return result
Пример #44
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f", dest="filename", default = "hydro_outflow.h5",
                      help="output filename [hydro.hdf5]")
    return result
Пример #45
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M", unit=units.MSun,
                      dest="mdonor",type="float",default=5.50|units.MSun)
    result.add_option("-m", unit=units.MSun,
                      dest="macc",type="float",default=6.30|units.MSun)
    result.add_option("--dMd", unit=units.MSun,
                      dest="dmd",type="float",default=-0.06|units.MSun)
    result.add_option("--dma", unit=units.MSun,
                      dest="dma",type="float",default=0.02|units.MSun)
    result.add_option("-a", unit=units.AU,
                      dest="a",type="float",default=1.2272459225|units.AU)
    result.add_option("--dt", unit=units.day,
                      dest="dt",type="float",default=1400.|units.day)
    result.add_option("--nj", 
                      dest="nj",type="float",default=3)
    return result
Пример #46
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f",
                      dest="filename",
                      default="Plummer.amuse",
                      help="input filename [%default]")
    result.add_option("-F",
                      dest="outfile",
                      default=None,
                      help="output filename [%default]")
    result.add_option("--f_binaries",
                      dest="f_binaries",
                      type="float",
                      default=0.5,
                      help="binary fraction [%default]")
    result.add_option("-m",
                      unit=units.MSun,
                      type="float",
                      dest="mmin",
                      default=0 | units.MSun,
                      help="minimum stellar mass for binary [%default]")
    result.add_option("-M",
                      unit=units.MSun,
                      type="float",
                      dest="mmax",
                      default=1000 | units.MSun,
                      help="maximum stellar mass for binary [%default]")
    result.add_option("-a",
                      unit=units.au,
                      type="float",
                      dest="amin",
                      default=1.0 | units.au,
                      help="minimum binary separation [%default]")
    result.add_option("-A",
                      unit=units.au,
                      type="float",
                      dest="amax",
                      default=1.0e+8 | units.au,
                      help="maximum binary separation [%default]")
    result.add_option("--seed",
                      dest="seed",
                      type="int",
                      default=None,
                      help="random number seed [%default]")
    return result
Пример #47
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-n",
                      dest="N",
                      type="int",
                      default="2",
                      help="number of particles [%default]")
    result.add_option("-s",
                      dest="seed",
                      type="int",
                      default="42",
                      help="random seed [%default]")
    result.add_option("-e",
                      dest="eps2",
                      type="float",
                      default="0.01",
                      help="softening length eps [%default]")
    result.add_option("-d",
                      dest="dt",
                      type="float",
                      default="0.01",
                      help="time step [%default]")
    result.add_option("-t",
                      dest="t_end",
                      type="float",
                      default="10.0",
                      help="integration interval [%default]")
    return result
Пример #48
0
def new_option_parser():
    result = OptionParser()
    result.add_option("-t",
                      dest="t_end",
                      type="float",
                      default=250,
                      unit=units.Myr,
                      help="end time [%unit]")
    result.add_option("-d",
                      dest="dt_diag",
                      type="float",
                      default=10,
                      unit=units.Myr,
                      help="diagnostic timestep [%unit]")
    result.add_option("-P",
                      dest="potential",
                      default="MilkyWay",
                      help="name of potential")
    result.add_option("-M",
                      dest="mass",
                      type="float",
                      default=1.e+11,
                      unit=units.MSun,
                      help="mass of the galaxy [%unit]")
    result.add_option("-e",
                      dest="eps",
                      type="float",
                      default=0.0,
                      unit=units.parsec,
                      help="softening of the potential [%unit]")
    result.add_option("-x",
                      dest="x",
                      type="float",
                      default=8500,
                      unit=units.parsec,
                      help="x-position [%unit]")
    result.add_option("-y",
                      dest="y",
                      type="float",
                      default=0,
                      unit=units.parsec,
                      help="y-position [%unit]")
    result.add_option("-z",
                      dest="z",
                      type="float",
                      default=0,
                      unit=units.parsec,
                      help="z-position [%unit]")
    result.add_option("--vx",
                      dest="vx",
                      type="float",
                      default=0,
                      unit=units.km / units.s,
                      help="x-velocity [%unit]")
    result.add_option("--vy",
                      dest="vy",
                      type="float",
                      default=220,
                      unit=units.km / units.s,
                      help="y-velocity [%unit]")
    result.add_option("--vz",
                      dest="vz",
                      type="float",
                      default=0,
                      unit=units.km / units.s,
                      help="z-velocity [%unit]")
    return result
Пример #49
0
def new_option_parser():
    #    from optparse import OptionParser
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M",
                      unit=units.MSun,
                      dest="M",
                      type="float",
                      default=1 | units.MSun,
                      help="stellar mass [%default]")
    result.add_option("-m",
                      unit=units.MJupiter,
                      dest="m",
                      type="float",
                      default=0.001 | units.MJupiter,
                      help="planet mass [%default]")
    result.add_option("-a",
                      unit=units.RSun,
                      dest="a",
                      type="float",
                      default=1 | units.RSun,
                      help="planet semi major axis [%default]")
    result.add_option("-e",
                      dest="e",
                      type="float",
                      default=0.6,
                      help="planet eccentricity [%default]")
    result.add_option("-t",
                      unit=units.Myr,
                      dest="tend",
                      type="float",
                      default=1 | units.Myr,
                      help="end time of integration [%default]")
    result.add_option("-O",
                      unit=units.s**-1,
                      dest="Omega_sun",
                      type="float",
                      default=2.6e-6 | units.s**-1,
                      help="Stellar angular something [%default]")
    return result
def parse_arguments():
    parser = OptionParser()
    parser.add_option("-t", dest="timestep", type="float",
                      unit=units.Myr, default=0.1,
                      help="The timestep of the integrator [%default %unit].")
    parser.add_option("-a", dest="current_age", type="float",
                      unit=units.Myr, default=3.5,
                      help="The current age of the cluster [%default %unit].")
    parser.add_option("-c", dest="codes", action="append", type="string",
                      help="The code to evolve the particle (can be used"
                      "multiple times). Available codes: {}."
                      .format(codelist.keys()))
    parser.add_option("-f", dest="filename", type="string", default=None,
                      help="Save the plot in a file with 'name'"
                      "[show matplotlib if not given].")

    options, args = parser.parse_args()
    codes = options.codes or ["huayno"]
    filename = options.filename
    parameters = options.__dict__
    del parameters['codes']
    del parameters['filename']
    return codes, filename, parameters
Пример #51
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-n",
                      type="int",
                      dest="np",
                      default=1,
                      help="number of plots [%default]")
    result.add_option("-N",
                      type="int",
                      dest="N",
                      default=10000,
                      help="number of gas particles [%default]")
    result.add_option("-t",
                      unit=units.Myr,
                      type="float",
                      dest="t_end",
                      default=1.0 | units.Myr,
                      help="radiation time [%default]")
    result.add_option("-L",
                      unit=units.LSun,
                      type="float",
                      dest="Lstar",
                      default=1.e2 | units.LSun,
                      help="luminosity of ionizing source [%default]")
    result.add_option("-d",
                      unit=units.parsec,
                      dest="boxsize",
                      default=10 | units.parsec,
                      help="size of the density box [%default]")
    result.add_option("-w",
                      type='int',
                      dest="which",
                      default=1,
                      help="which model [%default]")
    return result
Пример #52
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-t",
                      unit=units.s,
                      dest="t_end",
                      type="float",
                      default=500.0 | units.s,
                      help="end time of the simulation [%default]")
    result.add_option("-d",
                      unit=units.s,
                      dest="dt_diag",
                      type="float",
                      default=50.0 | units.s,
                      help="diagnostic time step [%default]")
    result.add_option("-M",
                      unit=units.MSun,
                      dest="stellar_mass",
                      type="float",
                      default=3 | units.MSun,
                      help="Mass of the star [%default]")
    result.add_option("-R",
                      unit=units.RSun,
                      dest="stellar_radius",
                      type="float",
                      default=1 | units.RSun,
                      help="Radius of the star [%default]")
    result.add_option("-m",
                      unit=units.MSun,
                      dest="core_mass",
                      type="float",
                      default=1.4 | units.MSun,
                      help="Mass of the stellar core [%default]")
    result.add_option("-n",
                      dest="resolution",
                      type="int",
                      default=300,
                      help="Resolution of the grid [%default]")
    result.add_option("-r",
                      unit=units.RSun,
                      dest="core_radius",
                      type="float",
                      default=0.1 | units.RSun,
                      help="Radius of the stellar core [%default]")
    return result
Пример #53
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("--end_time",
                      unit=units.Myr,
                      dest="end_time",
                      type="float",
                      default=5.0 | units.Myr,
                      help="integration time [%default]")
    result.add_option("--N_output",
                      dest="N_output",
                      type="int",
                      default=400,
                      help="number of output steps [%default]")
    result.add_option("--m1",
                      unit=units.MSun,
                      dest="m1",
                      type="float",
                      default=1.0 | units.MSun,
                      help="mass of object 1 [%default]")
    result.add_option("--m2",
                      unit=units.MSun,
                      dest="m2",
                      type="float",
                      default=0.8 | units.MSun,
                      help="mass of object 2 [%default]")
    result.add_option("--m3",
                      unit=units.MSun,
                      dest="m3",
                      type="float",
                      default=1.1 | units.MSun,
                      help="mass of object 3 [%default]")
    result.add_option("--m4",
                      unit=units.MSun,
                      dest="m4",
                      type="float",
                      default=0.9 | units.MSun,
                      help="mass of object 4 [%default]")
    result.add_option("--aA",
                      unit=units.AU,
                      dest="aA",
                      type="float",
                      default=1.0 | units.AU,
                      help="semimajor axis of orbit A [%default]")
    result.add_option("--aB",
                      unit=units.AU,
                      dest="aB",
                      type="float",
                      default=1.2 | units.AU,
                      help="semimajor axis of orbit B [%default]")
    result.add_option(
        "--aC",
        unit=units.AU,
        dest="aC",
        type="float",
        default=100.0 | units.AU,
        help="semimajor axis of orbit C (the `superorbit') [%default]")
    result.add_option("--eA",
                      dest="eA",
                      type="float",
                      default=0.1,
                      help="eccentricity of orbit A [%default]")
    result.add_option("--eB",
                      dest="eB",
                      type="float",
                      default=0.1,
                      help="eccentricity of orbit B [%default]")
    result.add_option(
        "--eC",
        dest="eC",
        type="float",
        default=0.3,
        help="eccentricity of orbit C (the `superorbit') [%default]")
    result.add_option("--iA",
                      dest="iA",
                      type="float",
                      default=75.0,
                      help="inclination of orbit A in degrees [%default]")
    result.add_option("--iB",
                      dest="iB",
                      type="float",
                      default=80.0,
                      help="inclination of orbit B in degrees [%default]")
    result.add_option(
        "--iC",
        dest="iC",
        type="float",
        default=0.001,
        help="inclination of orbit C (the `superorbit') in degrees [%default]")
    result.add_option(
        "--ApA",
        dest="ApA",
        type="float",
        default=10.0,
        help="argument of periapsis of orbit A in degrees [%default]")
    result.add_option(
        "--ApB",
        dest="ApB",
        type="float",
        default=30.0,
        help="argument of periapsis of orbit B in degrees [%default]")
    result.add_option(
        "--ApC",
        dest="ApC",
        type="float",
        default=60.0,
        help=
        "argument of periapsis of orbit C (the `superorbit') in degrees [%default]"
    )
    result.add_option(
        "--LANA",
        dest="LANA",
        type="float",
        default=0.001,
        help="longitude of the ascending node of orbit A in degrees [%default]"
    )
    result.add_option(
        "--LANB",
        dest="LANB",
        type="float",
        default=0.001,
        help="longitude of the ascending node of orbit B in degrees [%default]"
    )
    result.add_option(
        "--LANC",
        dest="LANC",
        type="float",
        default=0.001,
        help=
        "longitude of the ascending node of orbit C (the `superorbit') in degrees [%default]"
    )

    return result
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-t", action="store_true",
                      dest="threadded", help="run threadded [%default]")
    return result
def new_option_parser():
    result = OptionParser()
    result.add_option("--sim_number",
                      dest="sim_number",
                      type="int",
                      default=9999,
                      help="simulation id number [%default]")
    result.add_option("--num_format",
                      dest="num_format",
                      type="int",
                      default=6,
                      help="number of digits in simulation id [%default]")
    result.add_option("-n",
                      dest="n_steps",
                      type="int",
                      default=32,
                      help="number of steps [%default]")
    result.add_option("--fout",
                      dest="fout",
                      default="outfile",
                      help="output file base name[%default]")
    result.add_option("--snap_dir",
                      dest="snap_dir",
                      default="sim",
                      help="snapshot directory base name [%default]")
    result.add_option(
        "--m0",
        unit=units.MSun,
        dest="m0",
        type="float",
        default=1.0 | units.MSun,
        help="mass of the disk-central star (with disk) in MSun [%default]")
    result.add_option(
        "--m1",
        unit=units.MSun,
        dest="m1",
        type="float",
        default=1.0 | units.MSun,
        help="mass of the passing star (with no disk) in MSun [%default]")
    result.add_option("--peri",
                      unit=units.AU,
                      dest="peri",
                      type="float",
                      default=100 | units.AU,
                      help="pericenter of the orbit in AU  [%default]")
    result.add_option("--ecc",
                      dest="ecc",
                      type="float",
                      default=1.0,
                      help="eccentricity of the orbit  [%default]")
    result.add_option("--incl",
                      dest="incl",
                      type="float",
                      default=0.0,
                      help="inclination of the orbit in deg [%default]")
    result.add_option(
        "--omega",
        dest="omega",
        type="float",
        default=90.0,
        help="argument of periapsis [%default]")  # was 90.0 before
    ###### EXPERIMENT #####
    result.add_option(
        "--rel_force",
        dest="rel_force",
        type="float",
        default=0.1,
        help=
        "initial relative force from m1 and m0 at the r_disk_out [%default]")
    ###### EXPERIMENT #####
    result.add_option("--n_disk",
                      dest="n_disk",
                      type="int",
                      default=1000,
                      help="number of disk particles [%default]")
    result.add_option("--r_in",
                      unit=units.AU,
                      dest="r_in",
                      type="float",
                      default=40 | units.AU,
                      help="inner radius of the disk in AU [%default]")
    result.add_option("--r_out",
                      unit=units.AU,
                      dest="r_out",
                      type="float",
                      default=100 | units.AU,
                      help="outer radius of the disk in AU [%default]")
    result.add_option(
        "--power",
        dest="power",
        type="float",
        default=1.5,
        help=
        "negative index of the power-law surface number density of the disk particles [%default]"
    )  ### Careful with this one!! (and it is negative) ###
    result.add_option("--eta",
                      dest="eta",
                      type="float",
                      default=0.001,
                      help="Huayno eta parameter (~timestep) [%default]"
                      )  # Huayno timestep here
    result.add_option("--fredir",
                      dest="fredir",
                      type="string",
                      default=None,
                      help="redirection file [%default]")
    ###### EXPERIMENT #####
    result.add_option(
        "--br_dt",
        dest="br_dt",
        type="float",
        default=0.01,
        help="bridge timestep -- fraction of inner disk period [%default]"
    )  # Bridge timestep here
    ###### EXPERIMENT #####
    result.add_option(
        "--num_T",
        dest="num_T",
        type="float",
        default=4.0,
        help="total simulation time (in 'pericenter arc' units) [%default]")
    result.add_option(
        "--nb_end",
        dest="nb_end",
        type="float",
        default=1.5,
        help="end n-body time (in 'pericenter arc' units) [%default]")
    result.add_option("--seed",
                      dest="seed",
                      type="int",
                      default=42,
                      help="random seed for disk generator [%default]")

    return result
Пример #56
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-f", dest="filename", default = "gravity_stellar.hdf5",
                      help="output filename [%default]")
    result.add_option("-N", dest="N", type="int",default = 10,
                      help="number of stars [%default]")
    result.add_option("--dt", unit=units.Myr,
                      dest="dt", type="float",default = 1|units.Myr,
                      help="output timesteps [%default]")
    result.add_option("-M", unit=units.MSun,
                      dest="Mmax", type="float",default = 100,
                      help="maximal stellar mass [%default.value_in(units.MSun))]")
    result.add_option("-m", unit=units.MSun,
                      dest="Mmin", type="float",default = 10,
                      help="minimal stellar mass [%default.value_in(units.MSun)]")
    result.add_option("-R", unit=units.parsec,
                      dest="Rvir", type="float",default = 0.1,
                      help="cluser virial radius [%default.value_in(units.parsec)]")
    result.add_option("-t", unit=units.Myr,
                      dest="t_end", type="float", default = 50.0,
                      help="end time of the simulation [%default.value_in(units.Myr]")
    result.add_option("-W", dest="W0", type="float", default = 12.0,
                      help="Dimension-less depth of the King potential (W0) [%default]")
    result.add_option("-z", dest="z", type="float", default = 0.02,
                      help="metalicity [%default]")
    return result
Пример #57
0
def new_option_parser():
    result = OptionParser()
    result.add_option("-C",
                      dest="C",
                      default="SeBa",
                      help="stellar evolution code [SeBa]")
    result.add_option("-d",
                      unit=units.Myr,
                      dest="dt",
                      type="float",
                      default=100.0 | units.Myr,
                      help="diagnostics time step [%defailt]")
    result.add_option("-f",
                      dest="filename",
                      default="stellar.hdf5",
                      help="output filename [stellar.hdf5]")
    result.add_option("-N",
                      dest="N",
                      type="int",
                      default=100,
                      help="number of stars [%defailt]")
    result.add_option("-M",
                      unit=units.MSun,
                      dest="Mmax",
                      type="float",
                      default=100 | units.MSun,
                      help="maximal stellar mass [%defailt]")
    result.add_option("-m",
                      unit=units.MSun,
                      dest="Mmin",
                      type="float",
                      default=1.0 | units.MSun,
                      help="minimal stellar mass [%defailt]")
    result.add_option("-t",
                      unit=units.Myr,
                      dest="t_end",
                      type="float",
                      default=100.0 | units.Myr,
                      help="end time of the simulation [%defailt]")
    result.add_option("-z",
                      dest="z",
                      type="float",
                      default=0.02,
                      help="metalicity [%defailt]")
    return result
Пример #58
0
def new_option_parser():
    from amuse.units.optparse import OptionParser
    result = OptionParser(usage=__doc__)
    result.add_option("--resolution",
                      dest="N",
                      default=50,
                      type=int,
                      help="grid resolution [%default]")
    result.add_option("--tend",
                      dest="tend",
                      default=100 | units.day,
                      unit=units.day,
                      type=float,
                      help="end time of simulation in %unit [%default]")
    result.add_option("--dt",
                      dest="dtplot",
                      default=10 | units.day,
                      unit=units.day,
                      type=float,
                      help="plot time step in %unit [%default]")
    result.add_option("--depth",
                      dest="H",
                      default=4000. | units.m,
                      unit=units.m,
                      type=float,
                      help="ocean depth in %unit [%default]")
    result.add_option("--boxsize",
                      dest="L",
                      default=1000. | units.km,
                      unit=units.km,
                      type=float,
                      help="box size in %unit [%default]")
    #~ result.add_option("--reynolds_number",
    #~ dest="reynolds_number", default = 1., type=float,
    #~ help="Reynolds number [%default]")
    result.add_option("--wind_model",
                      dest="wind_model",
                      default="single",
                      type=str,
                      help="wind model: single, dijkstra or jan [%default]")
    result.add_option("--viscosity",
                      dest="A",
                      default=1000. | units.m**2 / units.s,
                      unit=units.m**2 / units.s,
                      type=float,
                      help="lateral viscosity %unit [%default]")
    result.add_option("--wind_stress",
                      dest="tau",
                      default=0.04 | units.Pa,
                      unit=units.Pa,
                      type=float,
                      help="wind_stress %unit [%default]")
    result.add_option("--dry_run",
                      dest="dry_run",
                      default=False,
                      action="store_true",
                      help="dry run [%default]")

    return result
Пример #59
0
def new_option_parser(a_default=10000 | units.RSun,
                      e_default=0.68,
                      m_default=15 | units.MSun,
                      M_default=15 | units.MSun):
    from amuse.units.optparse import OptionParser
    result = OptionParser()
    result.add_option("-M",
                      unit=units.MSun,
                      type="float",
                      dest="mprim",
                      default=M_default,
                      help="primary mass [%default]")
    result.add_option("-m",
                      unit=units.MSun,
                      type="float",
                      dest="msec",
                      default=m_default,
                      help="secondary mass [%default]")
    result.add_option("-a",
                      unit=units.RSun,
                      type="float",
                      dest="semimajor_axis",
                      default=a_default,
                      help="semi-major axis [%default]")
    result.add_option("-e",
                      type="float",
                      dest="eccentricity",
                      default=e_default,
                      help="eccentricity [%default]")
    result.add_option("-k",
                      type="float",
                      nargs=2,
                      dest="kaps",
                      default=[0.14, 0.14],
                      help="apsidal constant [%default]")
    result.add_option("--tau",
                      type="float",
                      nargs=2,
                      dest="taulag",
                      default=[100, 100] | units.s,
                      unit=units.s,
                      help="timelag in seconds [%default]")
    return result
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.Gyr,
                      dest="t_end",
                      type="float",
                      default=4.5 | units.Gyr,
                      help="end time of the simulation [%default]")
    result.add_option("-n",
                      dest="n_steps",
                      type="float",
                      default=300,
                      help="number of diagnostics output steps [%default]")
    result.add_option("-m",
                      unit=units.parsec,
                      dest="mcl",
                      type="float",
                      default=10**7 | units.MSun,
                      help="cluster mass [%default]")
    result.add_option("-r",
                      unit=units.parsec,
                      dest="rcl",
                      type="float",
                      default=100 | units.parsec,
                      help="cluster half-mass radius [%default]")
    result.add_option("-R",
                      unit=units.kpc,
                      dest="Rgal",
                      type="float",
                      default=8.5 | units.kpc,
                      help="distance to the GC [%default]")
    result.add_option("-v",
                      unit=units.parsec,
                      dest="vgal",
                      type="float",
                      default=100 | units.kms,
                      help="orbital velocity of the CDG [%default]")
    result.add_option(
        "-W",
        dest="W0",
        type="float",
        default=7.0,
        help="Dimension-less depth of the King potential (W0) [%default]")
    return result