Ejemplo n.º 1
0
def main():

    ### get the folder structure

    analysistype = "Energy_spectrum"
    analysisdatabase = '/usr/users/iff_th2/duman/Cells_in_LAMMPS/DATA/'
    analysisdatabase += analysistype + '/'

    datafolderbase = '/local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/'

    savebase = "/usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/"
    savefolder = "Energy_spectrum"

    ### make the parameter choice

    # motility
    fp = [1.0, 5.0, 10.0]
    eps = 1.0
    areak = 10.0
    param = fp
    param_choice = 'fp'

    # compressibility
    #    fp = 5.0
    #    eps = 5.0
    #    areak = [1.0, 10.0, 100.0]
    #    param = areak
    #    param_choice = 'areak'

    # adhesion
    #    fp = 3.0
    #    areak = 10.0
    #    eps = [0.05, 1.0, 10.0]
    #    param = eps
    #    param_choice = 'eps'

    data = {}  # carries the data per parameter set
    sims = {}  # carries the simulation information per parameter set

    for p in param:

        if param_choice == 'areak':
            datafolder, analysisfile = read_write.gen_folders(
                eps, fp, p, savefolder, datafolderbase, analysisdatabase)
        elif param_choice == 'eps':
            datafolder, analysisfile = read_write.gen_folders(
                p, fp, areak, savefolder, datafolderbase, analysisdatabase)
        elif param_choice == 'fp':
            datafolder, analysisfile = read_write.gen_folders(
                eps, p, areak, savefolder, datafolderbase, analysisdatabase)

        sims[p] = read_write.read_sim_info(datafolder)
        x, y = read_write.read_2d_analysis_data(analysisfile)
        data[p] = y

    ### plot the data as a function of the parameter

    plot_data(x, data, param_choice, sims, savebase, savefolder)

    return
Ejemplo n.º 2
0
def collect_data(args, analysisdatabase, read_analysis_func):
    """ collect analysis data per chosen parameter,
    where the chosen param is an array and the rest are scalars"""

    param = []
    param_choice = ''
    if args.eps == -1:
        param_choice = 'eps'
        param = [0.05, 1.0, 5.0, 20.0]
    if args.fp == -1:
        param_choice = 'fp'
        param = [0.5, 1.0, 5.0]
    if args.areak == -1:
        param_choice = 'areak'
        param = [1.0, 10.0, 100.0]
    if args.kappa == -1:
        param_choice = 'kappa'
        param = [1.0, 10.0, 100.0, 1000.0]

    data = {}  # carries the data per parameter set
    sims = {}  # carries the simulation information per parameter set

    for p in param:

        if param_choice == 'areak':
            datafolder, analysisfile = read_write.gen_folders(
                args.eps, args.fp, p, args.kappa, args.savefolder, args.folder,
                analysisdatabase)
        elif param_choice == 'eps':
            datafolder, analysisfile = read_write.gen_folders(
                p, args.fp, args.areak, args.kappa, args.savefolder,
                args.folder, analysisdatabase)
        elif param_choice == 'fp':
            datafolder, analysisfile = read_write.gen_folders(
                args.eps, p, args.areak, args.kappa, args.savefolder,
                args.folder, analysisdatabase)
        elif param_choice == 'kappa':
            datafolder, analysisfile = read_write.gen_folders(
                args.eps, args.fp, args.areak, p, args.savefolder, args.folder,
                analysisdatabase)

        sims[p] = read_write.read_sim_info(datafolder, True)
        out = read_analysis_func(analysisfile)
        if type(out) == tuple:
            if len(out) == 2:
                x, y = out
        else:
            y = out
        data[p] = y

    if type(out) == tuple:
        return x, data, param_choice, sims
    else:
        return param, data, param_choice, sims
Ejemplo n.º 3
0
def main():

    ### get the data folder

    parser = argparse.ArgumentParser()
    parser.add_argument("-e", "--eps", type=float, nargs="?", const=-1, \
                        help="Strength of LJ potential")
    parser.add_argument("-f", "--fp", type=float, nargs="?", const=-1, \
                        help="Propulsion force")
    parser.add_argument("-a", "--areak", type=float, nargs="?", const=-1, \
                        help="Area constraint potential strength")
    parser.add_argument("-fl", "--folder", nargs="?", \
                        const='/local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/', \
                        help="Folder containing data, as in /local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/")
    parser.add_argument("-sb", "--savebase", nargs="?", \
                        const = "/usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/", \
                        help="Folder to save the data, as in /usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/")
    parser.add_argument("-sf", "--savefolder", nargs="?", const="Vorticity_field", \
                        help="Specific folder for saving, as in Vorticity_field")
    parser.add_argument("-ti","--init_time", nargs="?", const=10, type=int, \
                        help="First frame of the video (in terms of frame number), you can also leave it empty")
    parser.add_argument("-tf","--fin_time", nargs="?", const=1000, type=int, \
                        help="Last frame of the video (in terms of frame number), you can also leave it empty")
    parser.add_argument("-s",
                        "--save_eps",
                        action="store_true",
                        help="Decide whether to save in eps or not")
    args = parser.parse_args()

    ### read the data and general information from the folder

    folder = args.folder + "eps_" + str(args.eps) + "/fp_" + str(args.fp) + \
        "/areak_" + str(args.areak) + "/"
    sim, cells, beads = read_write.read_h5_file(folder)
    beads.get_img_pos(sim.lx)
    cells.get_img_pos(sim.lx)
    print "folder = ", args.folder

    ### read the vorticity data

    analysisdatabase = '/usr/users/iff_th2/duman/Cells_in_LAMMPS/DATA/'
    analysisdatabase += args.savefolder + '/'
    datafolder, analysisfile = read_write.gen_folders(args.eps, args.fp, args.areak, \
                                                      args.savefolder, args.folder, \
                                                      analysisdatabase)

    sim = read_write.read_sim_info(datafolder)
    data = read_write.read_multid_analysis_data(analysisfile)

    ### plot the data in the given time window

    savebase = args.savebase + args.savefolder + "/"
    os.system("mkdir -p " + savebase)
    plot_vorticity(data, beads, cells, sim, args.init_time, args.fin_time,
                   savebase, args.save_eps)

    return
Ejemplo n.º 4
0
def main():

    ### get the data folder

    parser = argparse.ArgumentParser()
    parser.add_argument("-a",
                        "--areak",
                        type=float,
                        help="Area constraint potential strength")
    parser.add_argument("-fl", "--folder", nargs="?", \
                        const='/local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/', \
                        help="Folder containing data, as in /local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/")
    parser.add_argument("-sb", "--savebase", nargs="?", \
                        const = "/usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/", \
                        help="Folder to save the data, as in /usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/")
    parser.add_argument("-sf", "--savefolder", nargs="?", const="Velocity_com", \
                        help="Specific folder for saving, as in Velocity_com")
    parser.add_argument("-s",
                        "--save_eps",
                        action="store_true",
                        help="Decide whether to save in eps or not")
    args = parser.parse_args()

    ### accummulate data as a function of areak -with a dictionary-

    analysisdatabase = '/usr/users/iff_th2/duman/Cells_in_LAMMPS/DATA/'
    analysisdatabase += args.savefolder + '/'
    eps = [0.05, 0.5, 1.0, 5.0, 10.0, 20.0]
    fp = [0.0, 0.5, 1.0, 3.0, 5.0, 10.0]
    #areak = [1.0, 10.0, 100.0]
    alldata = {}  # carries the data per parameter set

    for e in eps:
        for f in fp:

            key = (e, f)
            datafolder, analysisfile = read_write.gen_folders( \
                e, f, args.areak, args.savefolder,
                args.folder, analysisdatabase)
            sim_info = read_write.read_sim_info(datafolder)
            data_info = read_write.read_single_analysis_data(analysisfile)
            alldata[key] = Data(e, f, data_info, sim_info)

    ### plot the data as a function of the parameter

    plot_data(alldata, args.areak, args.savebase, args.savefolder,
              args.save_eps)

    return
def main():

    ### get the data folder

    parser = argparse.ArgumentParser()
    parser.add_argument("-e",
                        "--eps",
                        type=float,
                        help="Strength of LJ potential")
    parser.add_argument("-f", "--fp", type=float, help="Propulsion force")
    parser.add_argument("-fl", "--folder", nargs="?", \
                        const='/local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/', \
                        help="Folder containing data, as in /local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/")
    parser.add_argument("-sb", "--savebase", nargs="?", \
                        const = "/usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/", \
                        help="Folder to save the data, as in /usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/")
    parser.add_argument("-sf", "--savefolder", nargs="?", const="Static_struct", \
                        help="Specific folder for saving, as in Static_struct")
    parser.add_argument("-s",
                        "--save_eps",
                        action="store_true",
                        help="Decide whether to save in eps or not")
    args = parser.parse_args()

    ### accummulate data as a function of areak -with a dictionary-

    analysisdatabase = '/usr/users/iff_th2/duman/Cells_in_LAMMPS/DATA/'
    analysisdatabase += args.savefolder + '/'
    areak = [1.0, 10.0, 100.0]
    data = {}  # carries the data per parameter set
    sims = {}  # carries the simulation information per parameter set

    for a in areak:

        datafolder, analysisfile = read_write.gen_folders(
            args.eps, args.fp, a, args.savefolder, args.folder,
            analysisdatabase)
        sims[a] = read_write.read_sim_info(datafolder)
        x, y = read_write.read_2d_analysis_data(analysisfile)
        data[a] = y

    ### plot the data as a function of the parameter

    plot_data(x, data, sims, args.savebase, args.savefolder, args.save_eps)

    return
def main():

    ### get the data folder

    parser = argparse.ArgumentParser()
    parser.add_argument("-e", "--eps", type=float, nargs="?", const=-1, \
                        help="Strength of LJ potential")
    parser.add_argument("-f", "--fp", type=float, nargs="?", const=-1, \
                        help="Propulsion force")
    parser.add_argument("-a", "--areak", type=float, nargs="?", const=-1, \
                        help="Area constraint potential strength")
    parser.add_argument("-fl", "--folder", nargs="?", \
                        const='/local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/', \
                        help="Folder containing data, as in /local/duman/SIMULATIONS/Cells_in_LAMMPS/density_0.8/")
    parser.add_argument("-sb", "--savebase", nargs="?", \
                        const = "/usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/", \
                        help="Folder to save the data, as in /usr/users/iff_th2/duman/Cells_in_LAMMPS/PLOTS/")
    parser.add_argument("-sf", "--savefolder", nargs="?", const="Vel_corr_length", \
                        help="Specific folder for saving, as in Vel_corr_length")
    parser.add_argument("-s",
                        "--save_eps",
                        action="store_true",
                        help="Decide whether to save in eps or not")
    args = parser.parse_args()

    ### accummulate data as a function of areak -with a dictionary-

    analysisdatabase = '/usr/users/iff_th2/duman/Cells_in_LAMMPS/DATA/'
    analysisdatabase += args.savefolder + '/'

    ### detect the parameter choice

    param = []
    param_choice = ''
    if args.eps == -1:
        param_choice = 'eps'
        param = [0.05, 0.5, 1.0, 5.0, 10.0, 20.0]
    if args.fp == -1:
        param_choice = 'fp'
        param = [0.0, 0.5, 1.0, 3.0, 5.0, 10.0]
    if args.areak == -1:
        param_choice = 'areak'
        param = [1.0, 10.0, 100.0]

    data = {}  # carries the data per parameter set
    sims = {}  # carries the simulation information per parameter set

    for p in param:

        if param_choice == 'areak':
            datafolder, analysisfile = read_write.gen_folders(
                args.eps, args.fp, p, args.savefolder, args.folder,
                analysisdatabase)
        elif param_choice == 'eps':
            datafolder, analysisfile = read_write.gen_folders(
                p, args.fp, args.areak, args.savefolder, args.folder,
                analysisdatabase)
        elif param_choice == 'fp':
            datafolder, analysisfile = read_write.gen_folders(
                args.eps, p, args.areak, args.savefolder, args.folder,
                analysisdatabase)

        sims[p] = read_write.read_sim_info(datafolder)
        x, y = read_write.read_2d_analysis_data(analysisfile)
        data[p] = y

    ### plot the data as a function of the parameter

    plot_data(x, data, param_choice, sims, args.savebase, args.savefolder,
              args.save_eps)

    return