In [2]:
import os
import sys
import random
import time
from random import seed, randint
import argparse
import platform
from datetime import datetime
import imp
import numpy as np
import fileinput
from itertools import product
import pandas as pd
from scipy.interpolate import griddata
from scipy.interpolate import interp2d
import seaborn as sns
from os import listdir

import matplotlib.pyplot as plt
import seaborn as sns
from scipy.interpolate import griddata
import matplotlib as mpl
sys.path.insert(0,'..')
from notebookFunctions import *
# from .. import notebookFunctions

%matplotlib inline
plt.rcParams['figure.figsize'] = (10,6.180)    #golden ratio
# %matplotlib notebook
%load_ext autoreload
%autoreload 2

In [75]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 370
location = pre + "/second_2/_280-350/2d_z_qw/force_0.05/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[75]:
[<matplotlib.lines.Line2D at 0x1a224c69b0>]

In [74]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 370
location = pre + "/second_2/_280-350/2d_z_qw/more_temp_force_0.05/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[74]:
[<matplotlib.lines.Line2D at 0x1a3d506e80>]

In [62]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 370
location = pre + "/second_2/_280-350/2d_z_qw/force_0.1/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[62]:
[<matplotlib.lines.Line2D at 0x1a22c475f8>]

In [73]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 370
location = pre + "/second_2/_280-350/2d_z_qw/real_force_0.0/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[73]:
[<matplotlib.lines.Line2D at 0x1a23e66630>]

In [66]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/real_force_0.0/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[66]:
[<matplotlib.lines.Line2D at 0x1a227acd68>]

In [53]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/force_0.05/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[53]:
[<matplotlib.lines.Line2D at 0x1a2368db00>]

In [42]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/high_temp_with_perturb_force_0.05/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[42]:
[<matplotlib.lines.Line2D at 0x1a1887a748>]

In [36]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/high_temp_with_perturb_force_0.05/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[36]:
[<matplotlib.lines.Line2D at 0x1a210e9390>]

In [34]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/high_temp_with_perturb_quicker/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[34]:
[<matplotlib.lines.Line2D at 0x1a20069780>]

In [33]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/high_temp_with_perturb/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[33]:
[<matplotlib.lines.Line2D at 0x1a221529b0>]

In [18]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second_2/_280-350/2d_z_qw/high_temp_with_perturb/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1a08de65c0>
Out[18]:
[<matplotlib.lines.Line2D at 0x1a231a07f0>]

In [14]:
data.columns


Out[14]:
Index(['Step', 'Run', 'Temp', 'Qw', 'Energy', 'DisReal', 'Dis_h56',
       'z_average', 'abs_z_average', 'z_h1', 'z_h2', 'z_h3', 'z_h4', 'z_h5',
       'z_h6', 'AMH', 'AMH_3H', 'Distance', 'AMH-Go', 'Membrane', 'Rg', 'rg1',
       'rg2', 'rg3', 'rg4', 'rg5', 'rg6', 'rg_all', 'Lipid', 'Lipid1',
       'Lipid2', 'Lipid3', 'Lipid4', 'Lipid5', 'Lipid6', 'Lipid7', 'Lipid8',
       'Lipid9', 'Lipid10', 'Lipid11', 'Lipid12', 'Lipid13', 'Lipid14',
       'Lipid15', 'TotalE', 'BiasTo', 'TempT'],
      dtype='object')

In [12]:
rerun7 = pd.read_feather("/Users/weilu/Research/server/may_2018/second/rerun_7_17_May_211310.feather")
rerun6 = pd.read_feather("/Users/weilu/Research/server/may_2018/second/rerun_6_17_May_211310.feather")
data = pd.concat([rerun6, rerun7])
dic = {"T0":300, "T1":335, "T2":373, "T3":417, "T4":465, "T5":519, "T6":579, "T7":645, "T8":720, "T9":803, "T10":896, "T11":1000}
data["TempT"] = data["Temp"].apply(lambda x: dic[x])
chosen = data.query("TempT < 400")
chosen.reset_index().to_feather("/Users/weilu/Research/server/may_2018/02_week/all_data_folder/second_may17.feather")

In [3]:
data = pd.read_feather("/Users/weilu/Research/server/may_2018/second/rerun_7_17_May_211310.feather")
dic = {"T0":300, "T1":335, "T2":373, "T3":417, "T4":465, "T5":519, "T6":579, "T7":645, "T8":720, "T9":803, "T10":896, "T11":1000}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
rerun7 = data
t = a.query("Temp < 400").groupby(["BiasTo","Temp"])[["DisReal","Run"]].mean().reset_index()
t["Diff"] = t["DisReal"]-t["BiasTo"].apply(pd.to_numeric)
t["BiasTo"] = t["BiasTo"].apply(pd.to_numeric)
fg = sns.FacetGrid(data=t, hue='Temp', size=8, aspect=1.61)
fg.map(plt.scatter, 'BiasTo', 'Diff').add_legend()


Out[3]:
<seaborn.axisgrid.FacetGrid at 0x10503b198>

In [5]:
data.query("Temp == 335").plot.hexbin("z_h6", "Qw", cmap="seismic", sharex=False)


Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x1035996d8>

In [7]:
data.columns


Out[7]:
Index(['Step', 'Run', 'Temp', 'Qw', 'Energy', 'DisReal', 'Dis_h56',
       'z_average', 'abs_z_average', 'z_h1', 'z_h2', 'z_h3', 'z_h4', 'z_h5',
       'z_h6', 'AMH', 'AMH_3H', 'Distance', 'AMH-Go', 'Membrane', 'Rg', 'rg1',
       'rg2', 'rg3', 'rg4', 'rg5', 'rg6', 'rg_all', 'Lipid', 'Lipid1',
       'Lipid2', 'Lipid3', 'Lipid4', 'Lipid5', 'Lipid6', 'Lipid7', 'Lipid8',
       'Lipid9', 'Lipid10', 'Lipid11', 'Lipid12', 'Lipid13', 'Lipid14',
       'Lipid15', 'TotalE', 'BiasTo'],
      dtype='object')

In [10]:
data.query("Temp == 373 and z_h6 < -10").plot.hexbin("AMH_3H", "Qw", cmap="seismic", sharex=False)


Out[10]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a0efc9588>

In [9]:
data.query("Temp == 335").plot.hexbin("AMH_3H", "Qw", cmap="seismic", sharex=False)


Out[9]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a0ccd8a20>

In [8]:
data.query("Temp == 335 and z_h6 < -10").plot.hexbin("AMH_3H", "Qw", cmap="seismic", sharex=False)


Out[8]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a0c8266a0>

In [169]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 330
location = pre + "/second/_280-350/2d_z_qw/middle_temp/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[169]:
[<matplotlib.lines.Line2D at 0x1a2da5e320>]

In [171]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 360
location = pre + "/second/_280-350/2d_z_qw/high_temp_force_0.05/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[171]:
[<matplotlib.lines.Line2D at 0x1a2da76c18>]

force 0.1 is too large for temp373


In [140]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 360
location = pre + "/second/_280-350/2d_z_qw/high_temp_force_0.1/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[140]:
[<matplotlib.lines.Line2D at 0x1a2d8b1d30>]

In [197]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 370
location = pre + "/second/_280-350/2d_z_qw/high_temp/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), end=(28,20),block=[-15,-10,0.1,0.3],save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[197]:
[<matplotlib.lines.Line2D at 0x1a2e502f28>]

In [195]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second/_280-350/2d_z_qw/high_temp/"
location2 = location + f"perturbation-2-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[195]:
[<matplotlib.lines.Line2D at 0x1a2f01d2b0>]

lower right


In [118]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/perturb/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(10, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[118]:
[<matplotlib.lines.Line2D at 0x1a2b43ee10>]

In [107]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/perturb/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(13, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[107]:
[<matplotlib.lines.Line2D at 0x1a28b41048>]

At sampling temperature, energy doesn't matter (300 here)


In [81]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/quick/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(13, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[81]:
[<matplotlib.lines.Line2D at 0x1a25d5b320>]

In [86]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 280
location = pre + "/second/_280-350/2d_z_qw/quick/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(13, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[86]:
[<matplotlib.lines.Line2D at 0x1a24157eb8>]

In [85]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 280
location = pre + "/second/_280-350/2d_z_qw/zero_energy/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[85]:
[<matplotlib.lines.Line2D at 0x1a22fddf60>]

In [84]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/zero_energy/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[84]:
[<matplotlib.lines.Line2D at 0x1a2890b828>]

In [95]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 270
location = pre + "/second/_280-350/2d_z_qw/amh_energy/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(10, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[95]:
[<matplotlib.lines.Line2D at 0x1a29bb9be0>]

In [58]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 290
location = pre + "/second/_280-350/2d_z_qw/amh_energy_x10/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[58]:
[<matplotlib.lines.Line2D at 0x1a261e0128>]

In [14]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 310
location = pre + "/second/_280-350/2d_z_qw/force_0.13/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[14]:
[<matplotlib.lines.Line2D at 0x1a21e9a7b8>]

In [83]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 310
location = pre + "/second/_280-350/2d_z_qw/force_0.15/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=20,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[83]:
[<matplotlib.lines.Line2D at 0x1a28725f98>]

In [104]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 320
location = pre + "/second/_280-350/2d_z_qw/force_0.13/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[104]:
[<matplotlib.lines.Line2D at 0x1a2a48ea20>]

In [ ]:
### pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/force_0.15/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)

In [74]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/force_0.15/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),block=[-15,-10,0.3,0.5],save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[74]:
[<matplotlib.lines.Line2D at 0x1a26ce6390>]

In [106]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 270
location = pre + "/second/_280-350/2d_z_qw/perturb/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(25,25),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[106]:
[<matplotlib.lines.Line2D at 0x1a284f0a58>]

In [105]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 270
location = pre + "/second/_280-350/2d_z_qw/perturb/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(25,25),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[105]:
[<matplotlib.lines.Line2D at 0x1a25cc49e8>]

In [92]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/remove_test2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(25,25),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[92]:
[<matplotlib.lines.Line2D at 0x1a2425dda0>]

In [80]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second/_280-350/2d_z_qw/remove_test/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(25,25),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


<matplotlib.colors.LinearSegmentedColormap object at 0x1155c3ef0>
Out[80]:
[<matplotlib.lines.Line2D at 0x1a27d04f28>]

In [165]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 380
location = pre + "/second/_280-350/2d_z_qw/distance_high_temp/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 5), end=(28,20),save=False, xlabel="z_H6", ylabel="Qw", zmax=25,res=30)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=120)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)


---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-165-95c2a2a1be15> in <module>()
      7 # plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
      8 location3 = location + f"evpb-{temp}.dat"
----> 9 (xi,yi,zi) = plot2d(location3, zmax=120)
     10 plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
     11 # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)

~/opt/notebook/notebookFunctions.py in plot2d(location, temp, res, zmin, zmax, z, xlabel, ylabel, title, outname)
    191 def plot2d(location, temp="450", res=30, zmin=0, zmax=30, z=3, xlabel="xlabel", ylabel="ylabel", title="", outname=None):
    192     titlefontsize = 28
--> 193     data = np.loadtxt(location)
    194     xi, yi, zi = getxyz(data, zmin=zmin, zmax=zmax,res=res, z=z)
    195     # plt.contour(xi, yi, zi, 50, linewidths=0.25,colors='k')

~/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin)
    896                 fh = iter(open(fname, 'U'))
    897             else:
--> 898                 fh = iter(open(fname))
    899         else:
    900             fh = iter(fname)

FileNotFoundError: [Errno 2] No such file or directory: '/Users/weilu/Research/server/may_2018/02_week/second/_280-350/2d_z_qw/distance_high_temp/evpb-380.dat'

In [ ]: