示例#1
0
    iom_o = IOManager()
    iom_s = IOManager()

    # NOTE
    #
    # first cmd-line data file is spawning data
    # second cmd-line data file is reference data

    # Read file with new simulation data
    try:
        iom_s.open_file(filename=sys.argv[1])
    except IndexError:
        iom_s.open_file()

    # Read file with original reference simulation data
    try:
        iom_o.open_file(filename=sys.argv[2])
    except IndexError:
        iom_o.open_file()

    # The axes rectangle that is plotted
    view = [-8.5, 8.5]

    gids = iom_s.get_group_ids(exclude=["global"])

    for gid in gids:
        plot_frames(iom_o, iom_s, gid, view=view)

    iom_o.finalize()
    iom_s.finalize()
示例#2
0
        ax.plot(time, normsum[0] - normsum)

    ax.grid(True)
    ax.ticklabel_format(style="sci", scilimits=(0,0), axis="y")
    ax.set_xlabel(r"Time $t$")
    ax.set_ylabel(r"$\|\Psi(t=0)\| - \|\Psi(t)\|$")
    ax.set_title(r"Drift of the total norm $\|\Psi\|$")
    fig.savefig("norms_sumall_drift_group"+str(gid)+GD.output_format)
    close(fig)




if __name__ == "__main__":
    iom = IOManager()

    # Read the file with the simulation data
    try:
        iom.open_file(filename=sys.argv[1])
    except IndexError:
        iom.open_file()

    gids = iom.get_group_ids()

    for gid in gids:
        params, data = read_data(iom, gid)
        plot_norms(gid, params, data)

    iom.finalize()