In [1]:
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 [16]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 310
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.13_2/"
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=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 0x1a142d3ef0>
Out[16]:
[<matplotlib.lines.Line2D at 0x1a215444e0>]

In [19]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 310
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.16/"
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=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 0x1a142d3ef0>
Out[19]:
[<matplotlib.lines.Line2D at 0x1a20853320>]

In [18]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 310
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.15/"
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=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 0x1a142d3ef0>
Out[18]:
[<matplotlib.lines.Line2D at 0x1a20b2b278>]

In [10]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 320
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.13_40bins/"
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=20,res=40)
# 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 0x1a142d3ef0>
Out[10]:
[<matplotlib.lines.Line2D at 0x1a1fa62ac8>]

In [6]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 320
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.12/"
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=15,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 0x1a142d3ef0>
Out[6]:
[<matplotlib.lines.Line2D at 0x10dad5c88>]

In [7]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 320
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.1/"
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=15,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 0x1a142d3ef0>
Out[7]:
[<matplotlib.lines.Line2D at 0x1a20239a20>]

In [3]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 320
location = pre + "/second_combine/_280-350/2d_z_qw/quick_force_0.15/"
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 0x1a142d3ef0>
Out[3]:
[<matplotlib.lines.Line2D at 0x1a203d4b70>]

In [2]:
pre = "/Users/weilu/Research/server/may_2018/01_week"
temp = 320
location = pre + "/second_combine/_280-350/2d_z_qw/force_0.1/"
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 0x1a142d3ef0>
Out[2]:
[<matplotlib.lines.Line2D at 0x1a1fb64128>]

In [44]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.12/"
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 0x1a142d3ef0>
Out[44]:
[<matplotlib.lines.Line2D at 0x1a20ff2588>]

In [45]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15/"
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 0x1a142d3ef0>
Out[45]:
[<matplotlib.lines.Line2D at 0x10daf29e8>]

In [59]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/enhance_force_0.15_temp300/"
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 0x1a142d3ef0>
Out[59]:
[<matplotlib.lines.Line2D at 0x1a22faf438>]

In [58]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15_temp300/"
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 0x1a142d3ef0>
Out[58]:
[<matplotlib.lines.Line2D at 0x1a1f79e4e0>]

Force 0.15 is too large


In [42]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 310
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15/"
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 0x1a142d3ef0>
Out[42]:
[<matplotlib.lines.Line2D at 0x1a20a927b8>]

In [27]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 310
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.1/"
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 0x1a142d3ef0>
Out[27]:
[<matplotlib.lines.Line2D at 0x1a219830f0>]

In [54]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15_diz_z_temp300/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(28, 10), end=(0, 23),save=False, xlabel="z_H6", ylabel="Dis", 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-54-42df17bab53c> 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_short_and_long/_280-350/2d_z_qw/quick_force_0.15_diz_z_temp300/evpb-300.dat'

In [53]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15_diz_z_temp300/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(28, 10), end=(0, 23), block=[-10,10,80,100],save=False, xlabel="z_H6", ylabel="Dis", 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-53-8ad3458e3daf> 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_short_and_long/_280-350/2d_z_qw/quick_force_0.15_diz_z_temp300/evpb-300.dat'

In [62]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/enhance_force_0.15_dis_z_temp300/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(28, 10), end=(0, 23),save=False, xlabel="z_H6", ylabel="Dis", 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-62-b9102908e6e0> 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_short_and_long/_280-350/2d_z_qw/enhance_force_0.15_dis_z_temp300/evpb-300.dat'

In [63]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/enhanceMore_force_0.15_dis_z_temp300/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(28, 10), end=(0, 23),save=False, xlabel="z_H6", ylabel="Dis", 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-63-d9e848bd0713> 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_short_and_long/_280-350/2d_z_qw/enhanceMore_force_0.15_dis_z_temp300/evpb-300.dat'

In [50]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 300
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15_dis_z/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(28, 10), end=(0, 23), block=[-10,10,80,100],save=False, xlabel="z_H6", ylabel="Dis", 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-50-29a823b7389b> 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_short_and_long/_280-350/2d_z_qw/quick_force_0.15_dis_z/evpb-300.dat'

In [46]:
pre = "/Users/weilu/Research/server/may_2018/02_week"
temp = 310
location = pre + "/second_short_and_long/_280-350/2d_z_qw/quick_force_0.15_energy_z/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(28, 10), end=(0, 23), block=[-10,10,80,100],save=False, xlabel="z_H6", ylabel="Dis", 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-46-5da19884816a> 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_short_and_long/_280-350/2d_z_qw/quick_force_0.15_energy_z/evpb-310.dat'

In [ ]: