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 [8]:
data = pd.read_feather("/Users/weilu/Research/server/may_2018/second_start_topology/rerun_5_14_May_143016.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])
rerun5 = 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[8]:
<seaborn.axisgrid.FacetGrid at 0x1a32bff198>

In [5]:
data = pd.read_feather("/Users/weilu/Research/server/may_2018/second_start_topology/rerun_3_14_May_000912.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])
rerun3 = 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[5]:
<seaborn.axisgrid.FacetGrid at 0x1a2f72fe48>

In [6]:
rerun3.query("Temp == 335").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x1198df7f0>

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


Out[44]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a32b042e8>

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


Out[45]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a7bd00a20>

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


Out[15]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a21e2e278>

In [49]:
t = rerun5.query("Temp == 335 and z_h6 < -10 and Qw > 0.3")
t.plot.hexbin("z_h6", "Qw", cmap="seismic", sharex=False)


Out[49]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a7c7d1be0>

In [50]:
select(t)


Out[50]:
count mean std min 25% 50% 75% max
BiasTo Run
84.0 1 1423.0 81.393215 5.564351 60.871722 77.711340 81.343503 85.089099 99.247940
7 116.0 83.205295 5.751692 67.081221 79.243822 83.199307 87.014939 99.618052
88.0 0 1803.0 84.729612 5.492301 64.903350 81.037497 84.657217 88.371127 102.454786
92.0 4 2025.0 88.302857 5.334048 68.278444 84.739558 88.399934 92.051578 105.008583
94.0 7 1618.0 89.476024 5.080354 72.981274 85.975856 89.511800 93.126893 105.117783
98.0 3 254.0 93.141554 4.401653 79.081327 90.490400 93.210370 96.022300 105.878986

In [26]:
t = rerun5.query("Temp == 335 and Qw < 0.5 and Qw > 0.3")
t.plot.hexbin("z_h6", "Qw", cmap="seismic", sharex=False)


Out[26]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a219847f0>

In [41]:
t = rerun5.query("Temp == 335 and Qw < 0.5 and Qw > 0.3")
t.plot.hexbin("z_h6", "AMH", cmap="seismic", sharex=False)


Out[41]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2ed17198>

In [29]:
t.columns


Out[29]:
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', '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 [39]:
t.query("z_h6 < -10").mean() - t.query("z_h6 > -10").mean()


Out[39]:
Step            -223392.612380
Run                   0.464941
Temp                  0.000000
Qw                    0.028944
Energy                8.607668
DisReal               2.983515
Dis_h56              37.559262
z_average            -4.282559
abs_z_average         1.793494
z_h1                 -1.001620
z_h2                  0.840928
z_h3                 -1.276398
z_h4                 -0.557522
z_h5                 -8.476437
z_h6                -15.686500
AMH                 -28.557913
Distance             -1.928730
AMH-Go                5.685854
Membrane              3.166002
Rg                   -0.794932
rg1                  -0.216657
rg2                  -0.485125
rg3                   1.054752
rg4                  -0.601068
rg5                   0.524981
rg6                  -1.071815
rg_all               -0.794932
Lipid                 6.167467
Lipid1               -1.584031
Lipid2               -0.214806
Lipid3                0.587414
Lipid4                0.161079
Lipid5               -0.004109
Lipid6               -0.113974
Lipid7                0.034872
Lipid8                1.645485
Lipid9                0.106180
Lipid10              -0.219162
Lipid11              -0.289506
Lipid12               2.048641
Lipid13               1.477813
Lipid14               2.106511
Lipid15               0.425061
TotalE               14.775135
dtype: float64

In [37]:
t.plot.hexbin("z_h6", "Lipid1", cmap="seismic", sharex=False)


Out[37]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2e577f28>

In [35]:
t.plot.hexbin("z_h6", "Lipid", cmap="seismic", sharex=False)


Out[35]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2e244710>

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


Out[7]:
<matplotlib.axes._subplots.AxesSubplot at 0x11bd41208>

In [2]:
data = pd.read_feather("/Users/weilu/Research/server/may_2018/second_start_topology/rerun_1_11_May_133146.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])
rerun1 = 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[2]:
<seaborn.axisgrid.FacetGrid at 0x10ecc27b8>

In [9]:
rerun5.columns


Out[9]:
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', '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]:
rerun5.query("Temp == 335").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


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

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


Out[14]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a21e346a0>

In [3]:
rerun1.query("Temp == 335").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x1172c9d30>

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


Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x11be690f0>

In [ ]: