Example #1
0
def run():
    """
    <Description>

    Args:
        param1: This is the first param.
    
    Returns:
        This is a description of what is returned.
    """
    input_dir = "../../../Data/FECs180307/"
    out_dir = "./"
    force = True
    q_interp, energy_list_arr, q_offset_nm,n_fecs = \
        CheckpointUtilities.getCheckpoint("./cache.pkl",read_data,
                                          force,input_dir)
    G_no_peg = FigureUtil.read_non_peg_landscape()
    #_giant_debugging_plot(out_dir, energy_list_arr)
    base = out_dir + "FigureS6_LandscapeComparison"
    kw_name_arr = [
        [dict(add_annotations=True), base],
        [dict(add_annotations=False), base + "_0"],
        [dict(add_annotations=False, limit_plot=1), base + "_1"],
    ]
    for kw, name in kw_name_arr:
        fig = PlotUtilities.figure(figsize=(3, 3))
        make_comparison_plot(q_interp, energy_list_arr, G_no_peg, **kw)
        base = name
        PlotUtilities.save_twice(fig, base + ".jpeg", base + ".svg")
Example #2
0
def _G0_plot(plot_dir, data_sliced, landscape, fmt):
    # XXX why is this necessary?? screwing up absolute values
    previous_JCP = FigureUtil.read_non_peg_landscape(base="../../FigData/")
    offset_s = np.mean([d.Separation[0] for d in data_sliced])
    G_hao = landscape.G0_kcal_per_mol
    idx_zero = np.where(landscape.q_nm <= 100)
    G_hao = G_hao - landscape.G0_kcal_per_mol[0]
    G_JCP = previous_JCP.G0_kcal_per_mol - previous_JCP.G0_kcal_per_mol[0] + 50
    offset_jcp_nm = min(previous_JCP.q_nm)
    landscape_offset_nm = min(landscape.q_nm)
    q_JCP_nm = previous_JCP.q_nm - offset_jcp_nm + 5
    q_Hao_nm = landscape.q_nm - landscape_offset_nm
    fig = FigureUtil._fig_single(y=6)
    xlim, ylim = FigureUtil._limits(data_sliced)
    ax1 = plt.subplot(2, 1, 1)
    FigureUtil._plot_fec_list(data_sliced, **fmt)
    FigureUtil._plot_fmt(ax1, **fmt)
    ax2 = plt.subplot(2, 1, 2)
    plt.plot(q_Hao_nm, G_hao, label="Aligned, IWT")
    plt.plot(q_JCP_nm, G_JCP, 'r--', label="JCP landscape")
    FigureUtil._plot_fmt(ax2,
                         ylabel="G (kcal/mol)",
                         is_bottom=True,
                         xlim=xlim,
                         ylim=[None, None])
    PlotUtilities.legend(ax=ax2, handlelength=2)
    ax2.set_xlim(fmt['xlim'])
    PlotUtilities.savefig(fig, plot_dir + "FigureSX_LandscapeComparison.png")