In [1]:
# import numpy as np

# # !/usr/bin/env python3
# # -*- coding: utf-8 -*-
# """
# Created on 20181219

# @author: zhangji

# Trajection of a ellipse, Jeffery equation. 
# """

# %pylab inline
# pylab.rcParams['figure.figsize'] = (25, 11)
# fontsize = 40

# import numpy as np
# import scipy as sp
# from scipy.optimize import leastsq, curve_fit
# from scipy import interpolate
# from scipy.interpolate import interp1d
# from scipy.io import loadmat, savemat
# # import scipy.misc

# import matplotlib
# from matplotlib import pyplot as plt
# from matplotlib import animation, rc
# import matplotlib.ticker as mtick
# from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes
# from mpl_toolkits.mplot3d import Axes3D, axes3d

# from sympy import symbols, simplify, series, exp
# from sympy.matrices import Matrix
# from sympy.solvers import solve

# from IPython.display import display, HTML
# from tqdm import tqdm_notebook as tqdm
# import pandas as pd
# import re
# from scanf import scanf
# import os
# import glob

# from codeStore import support_fun as spf
# from src.support_class import *
# from src import stokes_flow as sf

# rc('animation', html='html5')
# PWD = os.getcwd()
# font = {'size': 20}
# matplotlib.rc('font', **font)
# np.set_printoptions(linewidth=90, precision=5)

%load_ext autoreload
%autoreload 2

import os
import glob
import natsort 
import numpy as np
import scipy as sp
from scipy.optimize import leastsq, curve_fit
from scipy import interpolate, integrate
from scipy import spatial, signal
# from scipy.interpolate import interp1d
from scipy.io import loadmat, savemat
# import scipy.misc
# import importlib
from IPython.display import display, HTML
import pandas as pd
import pickle
import re
from scanf import scanf

import matplotlib
# matplotlib.use('agg')
from matplotlib import pyplot as plt
import matplotlib.colors as colors
from matplotlib import animation, rc
import matplotlib.ticker as mtick
from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes
from mpl_toolkits.mplot3d import Axes3D, axes3d
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from matplotlib import cm

from tqdm.notebook import tqdm as tqdm_notebook
from tqdm import tqdm
from time import time
from src.support_class import *
from src import jeffery_model as jm
from codeStore import support_fun as spf
from codeStore import support_fun_table as spf_tb

# %matplotlib notebook
%matplotlib inline
rc('animation', html='html5')
fontsize = 40
PWD = os.getcwd()

In [2]:
fig = plt.figure(figsize=(2, 2))
fig.patch.set_facecolor('white')
ax0 = fig.add_subplot(1, 1, 1)



In [3]:
job_dir = 'ecoC01B05_wt10_psi-0a'
table_name = 'ecoC01B05_tao1_wm10'
t_headle = '(.*?).pickle'

In [4]:
t_dir = os.path.join(PWD, job_dir)

data = spf_tb.load_table_data_pickle_dir(t_dir, t_headle)
lst_eta = data.lst_eta
theta_max_fre = data.theta_max_fre
phi_max_fre = data.phi_max_fre
psi_max_fre = data.psi_max_fre
eta_max_fre = data.eta_max_fre
data_idx = data.data_idx.fillna(-1).astype(int)




In [18]:
# theta, phi = 1.571, 1.428
# theta, phi = 0.000, 0.000
theta, phi = 2.856, 0.000
theta, phi = 1.571, 4.712
Table_tmin = 4500 

tpick, _ = spf_tb.load_table_date_pickle(job_dir, theta, phi)
Table_t = tpick['Table_t']
Table_dt = tpick['Table_dt']
Table_X = tpick['Table_X']
Table_P = tpick['Table_P']
Table_P2 = tpick['Table_P2']
Table_theta = tpick['Table_theta']
Table_phi = tpick['Table_phi']
Table_psi = tpick['Table_psi']
Table_eta = tpick['Table_eta']
save_every = 1
print('-ini_theta %f -ini_phi %f -ini_psi %f' % 
      (tpick['Table_theta'][0], tpick['Table_phi'][0], tpick['Table_psi'][0]))

# freq_pk = spf_tb.get_major_fre(Table_t, Table_theta)
# idx = Table_t > Table_t.max() - 1 / freq_pk * 10
idx = Table_t > Table_tmin
spf_tb.show_table_result(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                         Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], save_every)
spf_tb.show_theta_phi(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                      Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], show_back_direction=0)
spf_tb.show_theta_phi_psi_eta(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                              Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx])
spf_tb.show_center_X(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                     Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], 
                     table_name=table_name)


-ini_theta 1.570796 -ini_phi 4.712389 -ini_psi 0.000000
/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/figure.py:2369: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  warnings.warn("This figure includes Axes that are not compatible "
Out[18]:
True

In [14]:
# theta, phi = 1.571, 1.428
# theta, phi = 0.000, 0.000
theta, phi = 2.856, 0.000
theta, phi = 1.571, 1.714
Table_tmin = 4500 

tpick, _ = spf_tb.load_table_date_pickle(job_dir, theta, phi)
Table_t = tpick['Table_t']
Table_dt = tpick['Table_dt']
Table_X = tpick['Table_X']
Table_P = tpick['Table_P']
Table_P2 = tpick['Table_P2']
Table_theta = tpick['Table_theta']
Table_phi = tpick['Table_phi']
Table_psi = tpick['Table_psi']
Table_eta = tpick['Table_eta']
save_every = 1
print('-ini_theta %f -ini_phi %f -ini_psi %f' % 
      (tpick['Table_theta'][0], tpick['Table_phi'][0], tpick['Table_psi'][0]))

# freq_pk = spf_tb.get_major_fre(Table_t, Table_theta)
# idx = Table_t > Table_t.max() - 1 / freq_pk * 10
idx = Table_t > Table_tmin
spf_tb.show_table_result(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                         Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], save_every)
spf_tb.show_theta_phi(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                      Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], show_back_direction=0)
spf_tb.show_theta_phi_psi_eta(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                              Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx])
spf_tb.show_center_X(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                     Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], 
                     table_name=table_name)


-ini_theta 1.570796 -ini_phi 1.713596 -ini_psi 0.000000
/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/figure.py:2369: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  warnings.warn("This figure includes Axes that are not compatible "
Out[14]:
True

In [17]:
# theta, phi = 1.571, 1.428
# theta, phi = 0.000, 0.000
theta, phi = 2.856, 0.000
theta, phi = 1.571, 1.428
Table_tmin = 4500 

tpick, _ = spf_tb.load_table_date_pickle(job_dir, theta, phi)
Table_t = tpick['Table_t']
Table_dt = tpick['Table_dt']
Table_X = tpick['Table_X']
Table_P = tpick['Table_P']
Table_P2 = tpick['Table_P2']
Table_theta = tpick['Table_theta']
Table_phi = tpick['Table_phi']
Table_psi = tpick['Table_psi']
Table_eta = tpick['Table_eta']
save_every = 1
print('-ini_theta %f -ini_phi %f -ini_psi %f' % 
      (tpick['Table_theta'][0], tpick['Table_phi'][0], tpick['Table_psi'][0]))

# freq_pk = spf_tb.get_major_fre(Table_t, Table_theta)
# idx = Table_t > Table_t.max() - 1 / freq_pk * 10
idx = Table_t > Table_tmin
spf_tb.show_table_result(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                         Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], save_every)
spf_tb.show_theta_phi(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                      Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], show_back_direction=0)
spf_tb.show_theta_phi_psi_eta(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                              Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx])
spf_tb.show_center_X(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                     Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], 
                     table_name=table_name)


-ini_theta 1.570796 -ini_phi 1.427997 -ini_psi 0.000000
/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/figure.py:2369: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  warnings.warn("This figure includes Axes that are not compatible "
Out[17]:
True

In [16]:
# theta, phi = 1.571, 1.428
# theta, phi = 0.000, 0.000
theta, phi = 2.856, 0.000
theta, phi = 1.571, 1.571
Table_tmin = 4500 

tpick, _ = spf_tb.load_table_date_pickle(job_dir, theta, phi)
Table_t = tpick['Table_t']
Table_dt = tpick['Table_dt']
Table_X = tpick['Table_X']
Table_P = tpick['Table_P']
Table_P2 = tpick['Table_P2']
Table_theta = tpick['Table_theta']
Table_phi = tpick['Table_phi']
Table_psi = tpick['Table_psi']
Table_eta = tpick['Table_eta']
save_every = 1
print('-ini_theta %f -ini_phi %f -ini_psi %f' % 
      (tpick['Table_theta'][0], tpick['Table_phi'][0], tpick['Table_psi'][0]))

# freq_pk = spf_tb.get_major_fre(Table_t, Table_theta)
# idx = Table_t > Table_t.max() - 1 / freq_pk * 10
idx = Table_t > Table_tmin
spf_tb.show_table_result(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                         Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], save_every)
spf_tb.show_theta_phi(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                      Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], show_back_direction=0)
spf_tb.show_theta_phi_psi_eta(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                              Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx])
spf_tb.show_center_X(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                     Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], 
                     table_name=table_name)


-ini_theta 1.570796 -ini_phi 1.570796 -ini_psi 0.000000
/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/figure.py:2369: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  warnings.warn("This figure includes Axes that are not compatible "
Out[16]:
True

In [12]:
# theta, phi = 1.571, 1.428
# theta, phi = 0.000, 0.000
theta, phi = 0.143, 0.000
Table_tmin = 4500 

tpick, _ = spf_tb.load_table_date_pickle(job_dir, theta, phi)
Table_t = tpick['Table_t']
Table_dt = tpick['Table_dt']
Table_X = tpick['Table_X']
Table_P = tpick['Table_P']
Table_P2 = tpick['Table_P2']
Table_theta = tpick['Table_theta']
Table_phi = tpick['Table_phi']
Table_psi = tpick['Table_psi']
Table_eta = tpick['Table_eta']
save_every = 1
print('-ini_theta %f -ini_phi %f -ini_psi %f' % 
      (tpick['Table_theta'][0], tpick['Table_phi'][0], tpick['Table_psi'][0]))

# freq_pk = spf_tb.get_major_fre(Table_t, Table_theta)
# idx = Table_t > Table_t.max() - 1 / freq_pk * 10
idx = Table_t > Table_tmin
spf_tb.show_table_result(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                         Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], save_every)
spf_tb.show_theta_phi(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                      Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], show_back_direction=0)
spf_tb.show_theta_phi_psi_eta(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                              Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx])
spf_tb.show_center_X(Table_t[idx], Table_dt[idx], Table_X[idx], Table_P[idx], Table_P2[idx], 
                     Table_theta[idx], Table_phi[idx], Table_psi[idx], Table_eta[idx], 
                     table_name=table_name)


-ini_theta 0.142800 -ini_phi 6.283185 -ini_psi 0.000000
/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/figure.py:2369: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  warnings.warn("This figure includes Axes that are not compatible "
Out[12]:
True

In [6]:
with pd.option_context('display.max_rows', 100, 'display.max_columns', 100):
    display(data.theta_max_fre)


ini_phi 0.000 0.143 0.286 0.428 0.571 0.714 0.857 1.000 1.142 1.285 1.428 1.571 1.714 1.856 1.999 2.142 2.285 2.428 2.570 2.713 2.856 2.999 3.142 3.284 3.427 3.570 3.713 3.856 3.998 4.141 4.284 4.427 4.570 4.712 4.855 4.998 5.141 5.284 5.426 5.569 5.712 5.855 5.998 6.140 6.283
ini_theta
0.000 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019031 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015 0.019015
0.143 0.018978 0.019012 0.019026 0.019031 0.019029 0.019014 0.019020 0.019000 0.019056 0.018992 0.019033 0.019029 0.019054 0.019018 0.019006 0.019063 0.019058 0.019042 0.019034 0.019036 0.019071 0.019066 0.019071 0.019003 0.019019 0.019062 0.019025 0.019048 0.019026 0.019047 0.019039 0.019053 0.019015 0.019025 0.019051 0.019042 0.019007 0.019038 0.019047 0.019035 0.018993 0.019033 0.018997 0.019029 0.019008
0.286 0.019008 0.019055 0.019014 0.019039 0.019018 0.019008 0.018987 0.019034 0.019005 0.019026 0.019025 0.019018 0.019050 0.019043 0.019012 0.019046 0.019061 0.019040 0.019073 0.019057 0.019048 0.019051 0.019050 0.019030 0.019079 0.019060 0.019017 0.019044 0.019041 0.019039 0.019020 0.019038 0.019008 0.019011 0.019051 0.019010 0.018994 0.018972 0.019052 0.019006 0.019061 0.019005 0.019032 0.019038 0.018994
0.428 0.019028 0.019027 0.019007 0.019010 0.019015 0.019039 0.019017 0.018981 0.019015 0.019008 0.019023 0.018998 0.019045 0.019070 0.019041 0.019080 0.019087 0.019073 0.019115 0.019113 0.019140 0.019152 0.019101 0.019090 0.019067 0.019061 0.019056 0.019051 0.019000 0.019029 0.018994 0.019012 0.019030 0.019016 0.019026 0.019023 0.019020 0.019063 0.019049 0.019080 0.019039 0.019034 0.019032 0.019057 0.019034
0.571 0.019009 0.019036 0.019035 0.019052 0.019003 0.019008 0.019030 0.019061 0.018990 0.019003 0.019033 0.018995 0.019033 0.019014 0.019085 0.019076 0.019119 0.019078 0.019144 0.019145 0.019125 0.019176 0.019129 0.019161 0.019100 0.019071 0.019063 0.019062 0.019027 0.019034 0.019094 0.019037 0.019014 0.018984 0.019027 0.019034 0.018996 0.019055 0.019030 0.019022 0.019039 0.019018 0.019034 0.019022 0.019020
0.714 0.019025 0.019030 0.019032 0.019044 0.019021 0.019021 0.018994 0.019037 0.019038 0.019019 0.019026 0.019009 0.019079 0.019093 0.019123 0.019141 0.019170 0.019093 0.019159 0.019148 0.019151 0.019164 0.019163 0.019160 0.019162 0.019146 0.019100 0.019076 0.019048 0.019020 0.019069 0.019044 0.018989 0.019015 0.019035 0.019013 0.019013 0.018998 0.019034 0.019054 0.019010 0.019032 0.019046 0.018991 0.019023
0.857 0.019003 0.019051 0.018980 0.019013 0.019025 0.019066 0.019058 0.019069 0.019011 0.019056 0.019048 0.019044 0.019032 0.019012 0.019047 0.019054 0.019058 0.019065 0.019119 0.019088 0.019158 0.019167 0.019224 0.019145 0.019240 0.019213 0.019176 0.019153 0.019107 0.019081 0.019096 0.019024 0.019026 0.018999 0.019067 0.019039 0.019031 0.019046 0.019016 0.019036 0.019028 0.018986 0.019038 0.019034 0.019028
1.000 0.019007 0.019014 0.019034 0.019029 0.019015 0.019026 0.019036 0.019045 0.019032 0.019040 0.019036 0.019015 0.019055 0.019041 0.019039 0.019042 0.019081 0.019125 0.019196 0.019207 0.019214 0.019132 0.019113 0.019122 0.019116 0.019135 0.019199 0.019208 0.019193 0.019122 0.019176 0.019079 0.019044 0.019043 0.019036 0.019049 0.019042 0.019024 0.019054 0.019032 0.019020 0.019023 0.019022 0.019010 0.019001
1.142 0.019038 0.019038 0.019035 0.018995 0.019015 0.019015 0.019049 0.019024 0.019022 0.019029 0.019013 0.019106 0.019226 0.019231 0.019168 0.019114 0.019059 0.019015 0.019016 0.019000 0.019025 0.019001 0.018983 0.019021 0.019011 0.019023 0.019036 0.019084 0.019145 0.019193 0.019181 0.019188 0.019084 0.019020 0.019056 0.019035 0.019021 0.019015 0.019007 0.019021 0.019016 0.019006 0.019022 0.019000 0.019058
1.285 0.019025 0.019029 0.019032 0.019021 0.019030 0.019025 0.019038 0.019013 0.019028 0.019013 0.019008 0.019042 0.019125 0.019177 0.019181 0.019187 0.019094 0.019024 0.019078 0.019052 0.019033 0.019012 0.019047 0.019041 0.019017 0.018995 0.019024 0.019072 0.019101 0.019164 0.019178 0.019184 0.019100 0.019102 0.019080 0.019047 0.019017 0.019006 0.019042 0.019030 0.019047 0.019042 0.019005 0.019032 0.019028
1.428 0.019054 0.019021 0.019024 0.019031 0.019090 0.019039 0.019044 0.019040 0.019059 0.019140 0.019182 0.019211 0.019224 0.019111 0.019066 0.019193 0.019077 0.019031 0.019062 0.019036 0.019021 0.019043 0.019023 0.019006 0.019018 0.019037 0.019020 0.019058 0.019106 0.019186 0.019207 0.019205 0.019127 0.019104 0.019079 0.019013 0.019046 0.019021 0.019055 0.019027 0.019001 0.019016 0.018994 0.019039 0.019037
1.571 0.019028 0.019018 0.019029 0.019026 0.019054 0.019073 0.019034 0.019117 0.019098 0.019373 0.017820 0.462095 0.026324 0.019476 0.019181 0.019220 0.019214 0.019105 0.019074 0.019026 0.019038 0.019013 0.019024 0.018975 0.019017 0.019031 0.019116 0.019149 0.019143 0.019124 0.019054 0.019004 0.018808 0.306112 0.018803 0.018924 0.018991 0.019005 0.018993 0.018982 0.019030 0.019026 0.019038 0.019027 0.018997
1.714 0.018970 0.019008 0.019027 0.019016 0.019025 0.018993 0.019038 0.019054 0.019079 0.019102 0.019058 0.019074 0.019209 0.019117 0.019251 0.019043 0.019118 0.019047 0.019112 0.019036 0.019000 0.019050 0.019002 0.019046 0.019036 0.019121 0.019217 0.019173 0.019139 0.019035 0.019055 0.019043 0.019013 0.019010 0.018985 0.019007 0.019016 0.018987 0.019007 0.019016 0.019012 0.018979 0.019025 0.019014 0.018985
1.856 0.019050 0.019031 0.019029 0.019030 0.019037 0.019041 0.019036 0.019017 0.019028 0.019041 0.019081 0.019105 0.019034 0.019198 0.019026 0.019152 0.019169 0.019227 0.019003 0.019045 0.019085 0.019031 0.019010 0.019049 0.019068 0.019208 0.019206 0.019168 0.019118 0.019042 0.019047 0.019025 0.019049 0.019022 0.019038 0.019038 0.019043 0.019009 0.018991 0.019007 0.019010 0.018990 0.018998 0.019001 0.018997
1.999 0.019026 0.019034 0.019017 0.019061 0.019033 0.019057 0.019037 0.019011 0.019032 0.019050 0.019127 0.019213 0.019077 0.019025 0.019147 0.019063 0.019232 0.019196 0.019056 0.019016 0.019021 0.019077 0.019112 0.019160 0.019175 0.019185 0.019205 0.019163 0.019080 0.019090 0.019083 0.019067 0.019033 0.019036 0.019010 0.019016 0.018989 0.019029 0.019028 0.019040 0.019027 0.019039 0.019019 0.019015 0.019027
2.142 0.019030 0.019067 0.019018 0.019000 0.019008 0.019069 0.019036 0.019038 0.019035 0.019031 0.019051 0.019070 0.019169 0.019118 0.019050 0.019221 0.019150 0.019219 0.019066 0.019031 0.019046 0.019010 0.019061 0.019132 0.019234 0.019178 0.019247 0.019144 0.019154 0.019093 0.019045 0.019025 0.019027 0.019022 0.019048 0.019043 0.019029 0.019033 0.019034 0.019036 0.019009 0.019010 0.019040 0.019030 0.019004
2.285 0.019064 0.019006 0.019008 0.019036 0.019000 0.019001 0.019012 0.018999 0.019045 0.019080 0.019179 0.019153 0.019085 0.019123 0.019235 0.019186 0.019181 0.019189 0.019067 0.019059 0.019028 0.019029 0.019034 0.019066 0.019083 0.019142 0.019191 0.019216 0.019211 0.019166 0.019140 0.019117 0.019057 0.019028 0.019049 0.019056 0.019007 0.018989 0.019018 0.018983 0.019055 0.018995 0.019012 0.019068 0.019053
2.428 0.019052 0.019013 0.019030 0.019023 0.019000 0.019061 0.019095 0.019153 0.019219 0.019180 0.019124 0.019121 0.019144 0.019201 0.019219 0.019200 0.019214 0.019218 0.019133 0.019090 0.019066 0.019067 0.019061 0.019052 0.019029 0.019089 0.019142 0.019228 0.019234 0.019186 0.019209 0.019155 0.019118 0.019098 0.019060 0.019071 0.019022 0.019025 0.019023 0.019011 0.019045 0.019018 0.019008 0.019008 0.019047
2.570 0.019054 0.019012 0.019030 0.019073 0.019134 0.019179 0.019234 0.019184 0.019177 0.019153 0.019084 0.019121 0.019146 0.019209 0.019225 0.019184 0.019226 0.019246 0.019171 0.019159 0.019108 0.019078 0.019059 0.019059 0.019087 0.019118 0.019136 0.019152 0.019173 0.019224 0.019230 0.019222 0.019187 0.019169 0.019122 0.019107 0.019048 0.019068 0.019073 0.019068 0.019016 0.019032 0.019010 0.019052 0.019012
2.713 0.019099 0.019136 0.019172 0.019201 0.019245 0.019169 0.019143 0.019124 0.019136 0.019122 0.019126 0.019162 0.019209 0.019216 0.019232 0.019210 0.019200 0.019233 0.019200 0.019192 0.019189 0.019119 0.019160 0.019132 0.019093 0.019112 0.019180 0.019173 0.019209 0.019206 0.019200 0.019194 0.019224 0.019190 0.019195 0.019184 0.019182 0.019159 0.019145 0.019135 0.019092 0.019115 0.019106 0.019108 0.019119
2.856 0.019217 0.019212 0.019192 0.019185 0.019122 0.019157 0.019136 0.019129 0.019098 0.019076 0.019113 0.019162 0.019188 0.019204 0.019160 0.019234 0.019208 0.019214 0.019208 0.019183 0.019200 0.019224 0.019192 0.019198 0.019153 0.019199 0.019140 0.019135 0.019210 0.019166 0.019204 0.019229 0.019251 0.019229 0.019203 0.019204 0.019189 0.019253 0.019201 0.019190 0.019230 0.019189 0.019196 0.019183 0.019216
2.999 0.019123 0.019150 0.019130 0.019143 0.019128 0.019070 0.019125 0.019141 0.019110 0.019135 0.019141 0.019152 0.019163 0.019230 0.019219 0.019205 0.019236 0.019226 0.019197 0.019219 0.019222 0.019208 0.019217 0.019216 0.019234 0.019186 0.019220 0.019225 0.019191 0.019200 0.019156 0.019193 0.019210 0.019181 0.019197 0.019215 0.019171 0.019161 0.019164 0.019127 0.019168 0.019151 0.019093 0.019111 0.019131
3.142 0.019194 0.019164 0.019188 0.019203 0.019215 0.019203 0.019203 0.019208 0.019176 0.019190 0.019153 0.019130 0.019137 0.019128 0.019105 0.019094 0.019043 0.019059 0.019053 0.019086 0.019051 0.019061 0.019056 0.019051 0.019100 0.019078 0.019075 0.019108 0.019096 0.019125 0.019153 0.019113 0.019164 0.019191 0.019183 0.019199 0.019237 0.019203 0.019212 0.019214 0.019216 0.019184 0.019190 0.019199 0.019205

In [5]:
# sort all frequrents
with np.printoptions(precision=10, suppress=True, threshold=1e10):
    print(np.flipud(np.sort(data.theta_max_fre.values.flatten())))


[0.4620945585 0.3061115456 0.0263241537 0.019476242  0.0193731883
 0.0192526199 0.0192510167 0.0192506311 0.0192472907 0.0192462218
 0.0192449475 0.0192400558 0.0192374748 0.0192357258 0.0192346835
 0.0192344666 0.0192342617 0.0192342378 0.0192341275 0.0192336654
 0.0192331052 0.0192321902 0.0192318061 0.0192313452 0.0192299039
 0.0192297066 0.019229635  0.0192294035 0.0192290105 0.019227535
 0.0192274252 0.0192258698 0.0192256608 0.0192255579 0.0192252461
 0.0192248825 0.0192243819 0.0192242928 0.0192238112 0.0192238043
 0.0192237707 0.0192218185 0.0192217068 0.0192205037 0.0192201302
 0.0192196564 0.0192193854 0.0192193724 0.0192190841 0.0192187014
 0.0192186976 0.0192175528 0.0192169818 0.0192165468 0.0192165263
 0.0192163772 0.0192162189 0.0192161471 0.019216039  0.0192157049
 0.019215045  0.0192150165 0.019214411  0.0192140887 0.0192139941
 0.0192139294 0.0192138601 0.0192133658 0.0192129088 0.0192121362
 0.0192115928 0.0192110011 0.0192108851 0.019210305  0.0192100886
 0.0192096811 0.019209455  0.0192092837 0.0192091852 0.0192089386
 0.0192085268 0.0192083772 0.0192080964 0.0192079099 0.0192078331
 0.0192077575 0.0192075665 0.0192070923 0.0192066674 0.019206087
 0.0192058356 0.0192054452 0.0192050767 0.0192050619 0.0192047315
 0.0192043555 0.0192037363 0.0192036781 0.0192034137 0.0192027988
 0.0192027289 0.0192026122 0.019202578  0.0192011374 0.0192010249
 0.0192006577 0.0192004049 0.019200291  0.0192002036 0.0191999871
 0.0191997538 0.0191995125 0.0191991857 0.019199086  0.019199048
 0.0191988478 0.0191984098 0.0191981299 0.0191969338 0.019196587
 0.019196073  0.0191960487 0.0191957265 0.0191951499 0.0191943859
 0.0191942305 0.0191933362 0.0191932127 0.0191927767 0.0191926284
 0.0191923474 0.0191923442 0.0191915242 0.0191910084 0.0191910052
 0.0191906102 0.019190094  0.0191899012 0.0191895251 0.019189513
 0.0191888541 0.0191888458 0.019188845  0.0191887639 0.0191880435
 0.0191879855 0.0191875267 0.0191872244 0.0191868273 0.0191862522
 0.0191859784 0.0191855473 0.0191855082 0.0191850092 0.0191848093
 0.0191844929 0.0191843209 0.0191838229 0.019183702  0.0191836094
 0.0191831219 0.0191829463 0.0191826868 0.0191820339 0.0191816265
 0.0191813902 0.0191811487 0.0191809936 0.0191809905 0.0191807236
 0.0191800827 0.0191795957 0.0191793459 0.0191791497 0.0191784719
 0.0191779714 0.0191771584 0.0191770009 0.0191764034 0.019176246
 0.0191755694 0.0191755455 0.0191752671 0.0191731719 0.0191730631
 0.0191725711 0.0191721013 0.0191712538 0.019170554  0.0191698052
 0.0191693623 0.0191693027 0.0191686207 0.0191685624 0.019167906
 0.0191678889 0.0191677989 0.019166507  0.0191657855 0.0191657744
 0.0191644494 0.019164182  0.0191639639 0.0191638947 0.0191637797
 0.0191634973 0.0191630472 0.019162601  0.0191620011 0.0191618913
 0.0191617699 0.0191611059 0.0191607862 0.0191602583 0.0191600922
 0.0191600285 0.0191597775 0.019159265  0.0191590444 0.0191589193
 0.019157859  0.019156692  0.0191556312 0.0191547928 0.0191542495
 0.0191533408 0.0191532386 0.0191531398 0.0191530904 0.0191529565
 0.0191528169 0.0191525368 0.0191522299 0.0191520287 0.01915199
 0.019151977  0.019151201  0.019151126  0.0191501098 0.0191495238
 0.0191490701 0.0191483624 0.0191473071 0.0191464318 0.0191458374
 0.0191454283 0.0191447592 0.0191447365 0.0191446011 0.0191441795
 0.0191440339 0.0191439788 0.0191434811 0.0191433881 0.0191428316
 0.0191424579 0.0191424363 0.0191413079 0.0191412625 0.0191405152
 0.0191399635 0.0191398634 0.0191397577 0.0191396974 0.0191388138
 0.0191368005 0.019136462  0.0191360716 0.0191360287 0.0191355411
 0.019135358  0.0191349882 0.0191348472 0.0191348143 0.0191340684
 0.0191332565 0.0191321491 0.0191321    0.0191319055 0.019131104
 0.0191301716 0.0191301597 0.0191294912 0.0191292151 0.0191278687
 0.0191277713 0.0191273227 0.0191272867 0.0191272679 0.0191259537
 0.0191251385 0.0191250288 0.0191248396 0.019124781  0.0191247647
 0.0191242633 0.0191237377 0.0191236806 0.0191230224 0.0191227023
 0.0191226271 0.019122238  0.0191220878 0.0191220734 0.0191220732
 0.0191216238 0.0191213218 0.019121292  0.0191209456 0.0191194142
 0.0191188626 0.019118764  0.0191187455 0.019118422  0.019118328
 0.0191177383 0.0191176691 0.0191175673 0.0191173875 0.0191171502
 0.0191168884 0.0191155224 0.0191155217 0.0191153848 0.019114649
 0.0191143172 0.0191134153 0.0191131971 0.019113186  0.0191128112
 0.0191119031 0.0191118932 0.0191117402 0.0191114261 0.0191105821
 0.0191104626 0.0191080811 0.0191078075 0.0191077452 0.0191073029
 0.0191070519 0.0191064102 0.0191063998 0.0191057719 0.0191054299
 0.019105058  0.0191046414 0.0191035104 0.0191020995 0.019101835
 0.0191010415 0.0191006561 0.0191002282 0.0191001275 0.0191000894
 0.0190995851 0.0190992159 0.0190983355 0.01909808   0.0190978169
 0.0190964128 0.0190957332 0.0190945639 0.0190942708 0.0190942531
 0.019093602  0.0190934234 0.0190931383 0.0190928137 0.0190926165
 0.0190925975 0.0190920061 0.0190904512 0.0190897899 0.019089618
 0.0190895215 0.0190893792 0.0190880475 0.0190873857 0.0190868902
 0.0190859905 0.0190853022 0.0190852938 0.0190845085 0.0190841891
 0.0190840104 0.0190835697 0.0190831688 0.0190826649 0.0190807657
 0.0190807294 0.0190806783 0.0190803385 0.0190801549 0.0190801543
 0.0190800328 0.0190796977 0.0190793855 0.0190789788 0.0190789359
 0.0190786493 0.019078608  0.0190784844 0.0190779575 0.019077811
 0.0190775449 0.019077108  0.0190767298 0.0190765363 0.0190757111
 0.0190755703 0.0190755608 0.0190753307 0.0190739502 0.0190738535
 0.0190732338 0.0190728507 0.0190728184 0.0190727036 0.0190725775
 0.0190716    0.0190712569 0.0190709191 0.019070792  0.0190705084
 0.019070403  0.0190695949 0.0190695751 0.0190690198 0.0190690029
 0.0190685098 0.0190683171 0.0190681235 0.0190679689 0.019067895
 0.0190670578 0.0190669874 0.0190669292 0.0190669113 0.0190665707
 0.0190665683 0.019066183  0.0190661313 0.0190659251 0.0190658077
 0.0190656575 0.0190655067 0.0190646106 0.019063869  0.0190633505
 0.0190632531 0.0190629758 0.0190628523 0.0190624699 0.0190623038
 0.0190616806 0.0190613685 0.0190613432 0.019061089  0.0190609788
 0.0190609665 0.0190608075 0.0190607045 0.0190606438 0.019060537
 0.0190600846 0.0190598501 0.0190594968 0.0190594207 0.0190587746
 0.0190587576 0.0190587426 0.019058597  0.0190583587 0.0190580032
 0.0190578543 0.0190577894 0.0190577409 0.0190576504 0.0190574605
 0.0190573356 0.0190570688 0.0190569594 0.0190564767 0.0190564584
 0.0190563822 0.0190562196 0.0190561962 0.0190560839 0.0190556192
 0.0190554868 0.0190554226 0.0190553913 0.0190553598 0.0190552197
 0.0190548982 0.0190544873 0.0190544772 0.019054271  0.019054267
 0.0190542623 0.0190540962 0.019053981  0.0190539387 0.019053648
 0.0190532894 0.0190527093 0.0190525804 0.019052446  0.0190522954
 0.019052258  0.0190520745 0.0190520605 0.0190518582 0.0190510342
 0.0190510079 0.0190509405 0.0190508537 0.0190508151 0.0190506162
 0.0190505676 0.019050533  0.0190504265 0.0190503906 0.01905038
 0.0190502454 0.0190502233 0.0190501402 0.0190493251 0.0190492146
 0.0190491723 0.0190490758 0.0190490633 0.0190487916 0.0190484425
 0.0190484201 0.0190482843 0.0190482502 0.0190479625 0.0190475111
 0.0190474682 0.0190473971 0.0190473438 0.0190471258 0.0190469997
 0.0190466816 0.0190466741 0.0190466724 0.0190466635 0.0190463191
 0.0190460655 0.019045803  0.0190457118 0.0190455935 0.0190455283
 0.0190453828 0.0190453241 0.0190450419 0.0190448735 0.019044678
 0.0190446579 0.0190444118 0.0190439368 0.0190438442 0.0190437761
 0.0190435826 0.0190435603 0.0190434826 0.0190432726 0.0190431318
 0.0190431207 0.0190431148 0.0190431141 0.019043101  0.0190428368
 0.0190424318 0.0190424258 0.0190420894 0.0190420594 0.0190419613
 0.0190419392 0.0190419105 0.0190418898 0.0190414245 0.0190413992
 0.0190409316 0.0190407449 0.019040715  0.0190405362 0.019040398
 0.0190403339 0.0190403229 0.0190399937 0.0190395631 0.0190394622
 0.0190393906 0.0190393816 0.019039314  0.0190392498 0.0190391303
 0.0190390132 0.0190390009 0.0190389139 0.0190387565 0.0190385512
 0.0190384286 0.0190383548 0.0190383253 0.0190382679 0.0190382621
 0.0190381347 0.0190380219 0.0190380191 0.0190379738 0.0190377742
 0.0190376945 0.0190376262 0.0190376201 0.019037579  0.0190374497
 0.0190373273 0.0190372731 0.0190369637 0.0190365618 0.0190365238
 0.0190363962 0.019036353  0.0190363158 0.0190362834 0.0190362779
 0.0190362718 0.0190362677 0.0190362405 0.0190362091 0.0190361024
 0.0190359852 0.0190359354 0.019035917  0.0190359107 0.0190355619
 0.0190354858 0.0190354539 0.0190351758 0.0190351408 0.0190350353
 0.0190350324 0.0190349839 0.0190341839 0.0190341804 0.0190340818
 0.0190339761 0.0190339412 0.0190339247 0.0190338976 0.019033879
 0.0190338335 0.0190338247 0.0190337871 0.0190337015 0.0190336217
 0.0190336191 0.0190335581 0.0190334783 0.0190334592 0.0190334435
 0.0190333388 0.0190331931 0.0190328598 0.0190327867 0.0190325885
 0.0190324198 0.0190322435 0.0190322209 0.0190321546 0.0190321273
 0.0190321075 0.019032022  0.0190319579 0.0190316727 0.019031672
 0.0190315092 0.0190314946 0.0190314846 0.0190314043 0.0190313428
 0.0190312185 0.0190311598 0.0190310685 0.0190310551 0.0190310377
 0.019030642  0.019030642  0.019030642  0.019030642  0.019030642
 0.019030642  0.019030642  0.019030642  0.019030642  0.019030642
 0.019030642  0.019030642  0.019030642  0.019030642  0.019030642
 0.019030642  0.019030642  0.019030642  0.019030642  0.019030642
 0.019030642  0.0190304342 0.0190303736 0.0190303377 0.0190303012
 0.0190302723 0.0190302076 0.0190301825 0.0190299609 0.0190299457
 0.0190299267 0.0190298151 0.0190297699 0.0190295108 0.019029468
 0.0190294598 0.0190293756 0.0190292778 0.0190290808 0.019029044
 0.0190290062 0.0190289895 0.0190289851 0.0190288977 0.0190288887
 0.0190287743 0.019028631  0.0190281878 0.0190281274 0.0190281218
 0.0190280815 0.0190279902 0.0190276768 0.0190275873 0.0190275457
 0.0190275404 0.0190275299 0.0190274718 0.0190274132 0.0190272711
 0.0190272148 0.0190270531 0.0190270076 0.0190269708 0.0190268577
 0.0190265212 0.019026456  0.019026374  0.0190262808 0.019026135
 0.0190261119 0.0190260896 0.019026008  0.0190259989 0.0190258505
 0.0190257884 0.0190256526 0.0190255282 0.0190254119 0.0190253926
 0.019025382  0.0190252413 0.0190251645 0.0190251497 0.0190250687
 0.0190249974 0.0190249888 0.0190249117 0.0190249107 0.0190248519
 0.0190248455 0.0190245771 0.0190244091 0.0190243668 0.0190243323
 0.0190242946 0.0190242301 0.0190239689 0.0190237642 0.0190234037
 0.019023235  0.0190232258 0.0190230733 0.0190227593 0.0190227451
 0.0190226823 0.019022564  0.0190224135 0.0190223228 0.0190220502
 0.0190219992 0.0190219817 0.0190217455 0.0190216483 0.01902154
 0.019021387  0.0190213457 0.0190213025 0.0190212326 0.0190211803
 0.0190211582 0.0190210298 0.0190207148 0.0190206547 0.0190206459
 0.0190203243 0.0190201795 0.0190200907 0.0190200774 0.0190200355
 0.0190199439 0.0190198483 0.0190195188 0.0190194949 0.0190190212
 0.0190186673 0.0190184699 0.0190181891 0.0190180835 0.0190179449
 0.0190179375 0.01901765   0.0190175935 0.0190175637 0.0190175549
 0.0190172625 0.0190171561 0.0190171419 0.0190168418 0.0190165541
 0.0190165451 0.0190165131 0.0190164234 0.0190163118 0.0190162988
 0.0190160819 0.0190160031 0.0190159695 0.019015886  0.0190158322
 0.0190156395 0.019015631  0.0190155236 0.0190154976 0.0190154749
 0.0190150774 0.0190150338 0.0190149846 0.0190149785 0.0190149751
 0.0190149751 0.0190149751 0.0190149751 0.0190149751 0.0190149751
 0.0190149751 0.0190149751 0.0190149751 0.0190149751 0.0190149751
 0.0190149751 0.0190149751 0.0190149751 0.0190149751 0.0190149751
 0.0190149751 0.0190149751 0.0190149751 0.0190149751 0.0190149751
 0.0190149751 0.0190149751 0.0190149751 0.0190149219 0.019014774
 0.0190146962 0.0190146861 0.0190145229 0.0190144597 0.0190143889
 0.0190143527 0.0190140211 0.0190138535 0.0190138249 0.0190132379
 0.0190131768 0.0190131122 0.0190130981 0.019012952  0.0190128509
 0.0190127868 0.0190126331 0.0190125578 0.0190125219 0.0190124983
 0.0190124956 0.0190123081 0.0190121164 0.0190119541 0.0190119131
 0.0190119038 0.0190117057 0.0190115847 0.0190115699 0.0190110112
 0.0190109248 0.0190108426 0.0190107794 0.019010533  0.0190104408
 0.0190103751 0.019010293  0.0190102788 0.0190102341 0.0190101848
 0.0190101746 0.0190101746 0.0190101172 0.0190099825 0.0190095814
 0.0190094678 0.0190090242 0.0190087806 0.0190087679 0.0190084791
 0.0190084177 0.0190083559 0.0190083488 0.0190083247 0.0190082891
 0.0190081273 0.0190081231 0.0190080818 0.0190078751 0.0190076681
 0.0190076255 0.0190073281 0.0190071226 0.0190071134 0.0190070625
 0.0190070364 0.0190070201 0.0190069821 0.0190067286 0.0190064942
 0.0190062269 0.0190060445 0.0190060054 0.0190057202 0.0190055203
 0.0190054592 0.019005348  0.0190050317 0.0190050089 0.0190041025
 0.0190035753 0.0190033481 0.019003307  0.0190030089 0.0190028092
 0.019002724  0.0190021502 0.0190014215 0.0190012994 0.0190008909
 0.0190007804 0.0190006475 0.0190004413 0.0190002618 0.0190001568
 0.0190000881 0.018999985  0.0189999669 0.0189998829 0.0189995954
 0.0189991557 0.0189989103 0.0189978814 0.0189978282 0.0189977205
 0.0189973828 0.0189968113 0.0189965674 0.0189964679 0.0189954902
 0.018995371  0.0189952668 0.0189948238 0.0189941492 0.018994125
 0.018993938  0.018993877  0.0189938064 0.0189930755 0.0189930341
 0.0189925412 0.0189924708 0.0189908378 0.0189907828 0.0189905293
 0.0189896932 0.0189895108 0.0189890363 0.0189888507 0.0189885072
 0.0189871909 0.0189867045 0.018986289  0.0189851738 0.0189847881
 0.0189837466 0.0189827808 0.0189826654 0.0189824024 0.0189807649
 0.0189801261 0.0189793667 0.0189784639 0.0189747177 0.0189721409
 0.018970187  0.0189239026 0.0188076511 0.0188030857 0.0178201615]

In [32]:
tfre = theta_max_fre.copy()
type_fre2 = tfre.copy()
type_fre2.iloc[:, :] = 0
# type_fre2.loc[1.571].loc[4.570] = 1
type_fre2.loc[1.571].loc[4.712] = 2
# type_fre2.loc[1.571].loc[4.855] = 1
type_fre2.loc[1.571].loc[1.428] = 1
type_fre2.loc[1.571].loc[1.571] = 3
type_fre2.loc[1.571].loc[1.714] = 1

spf_tb.show_traj_phase_map_type(type_fre2)
# spf_tb.save_separate_angleList_fft(job_dir, tfre, check_fre_list, atol_fre_list)


Out[32]:
True

In [43]:
t1 = []
for i0 in np.arange(type_fre2.values.max() + 1):
    t1.append(np.isclose(type_fre2.values, i0).sum())

print(np.sum(t1))
print(t1)
print(t1 / np.sum(t1))


1035
[1031, 2, 1, 1]
[9.96135266e-01 1.93236715e-03 9.66183575e-04 9.66183575e-04]

In [42]:
fast_mode1 = 0
figsize = np.array((16, 9)) * 0.5
dpi = 200

tipical_th_ph_list = []
for i0 in np.arange(type_fre2.values.max() + 1)[:]:
    iidx = np.where(np.isclose(type_fre2.values, i0))
    spf_tb.phase_map_show_idx(type_fre2, tipical_th_ph_list, iidx, job_dir, table_name, fast_mode=fast_mode1, )


-ini_theta 0.000000 -ini_phi 0.000000
-ini_theta 0.000000 -ini_phi 0.000000 -ini_psi 0.000000
/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/figure.py:2369: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  warnings.warn("This figure includes Axes that are not compatible "
-ini_theta 1.571000 -ini_phi 1.428000
-ini_theta 1.570796 -ini_phi 1.427997 -ini_psi 0.000000
-ini_theta 1.571000 -ini_phi 4.712000
-ini_theta 1.570796 -ini_phi 4.712389 -ini_psi 0.000000
-ini_theta 1.571000 -ini_phi 1.571000
-ini_theta 1.570796 -ini_phi 1.570796 -ini_psi 0.000000

In [33]:
Table_t_range1 = np.array((4900, np.inf))
Table_t_range2 = np.array((4900, np.inf))
nshow = np.inf
# nshow = 2
fast_mode2 = True
figsize = np.array((16, 9)) * 0.5
dpi = 200

for i0 in np.arange(type_fre2.values.max() + 1)[:]:
    iidx = np.where(np.isclose(type_fre2.values, i0))
    spf_tb.phase_map_show_idx_list(type_fre2, iidx, job_dir, nshow=nshow, figsize=figsize, dpi=dpi, 
                                   Table_t_range1=Table_t_range1, Table_t_range2=Table_t_range2, fast_mode=fast_mode2, )



In [38]:
# for i0 in np.arange(type_fre2.values.max() + 1)[:]:
i0 = 0
Table_t_range = (4500, np.inf)

iidx = np.where(np.isclose(type_fre2.values, i0))
theta = type_fre2.index.values[iidx[0]]
phi = type_fre2.columns.values[iidx[1]]
theta_phi_list = np.vstack((theta, phi)).T
# print(theta_phi_list)

t1 = []
for theta, phi in tqdm_notebook(theta_phi_list):
    tpick, _ = spf_tb.load_table_date_pickle(job_dir, theta, phi)
    Table_t = tpick['Table_t']
    idx = np.logical_and(Table_t >= Table_t_range[0], Table_t <= Table_t_range[1])
    Table_theta = tpick['Table_theta'][idx]
    Table_phi = tpick['Table_phi'][idx]
    Table_psi = tpick['Table_psi'][idx]
    t2 = (np.max(Table_theta), np.min(Table_theta), np.mean(Table_theta), 
          np.max(Table_phi), np.min(Table_phi), Table_psi[np.argmax(Table_phi)], 
          np.max(Table_psi), np.min(Table_psi), np.mean(Table_psi), )
    t1.append(t2)




In [40]:
figsize = np.array((16, 9))
dpi = 100

t1 = np.vstack(t1)
# t1[t1[:, 3] > 5.1950, :] = np.nan 
fig, axs = plt.subplots(3, 3, figsize=figsize, dpi=dpi)
for i0, axi in enumerate(axs.ravel()):
#     print(t1[:, i0])
    axi.plot(t1[:, i0].ravel(), '.')



In [41]:
# tipical_th_ph_list = [[0.   , 1.714],
#        [0.000, 0.   ],
#        [0.143, 0.   ],
#        [0.143, 0.428],
#        [0.143, 0.571]]

tipical_th_ph_use_idx = [0, 1, 2, 3]
Table_t_range = np.array((4500, np.inf))
figsize = np.array((16, 9)) * 0.7
dpi = 200

tipical_th_ph_list_use = np.array(tipical_th_ph_list)[tipical_th_ph_use_idx]
label_list = np.arange(len(tipical_th_ph_list))[tipical_th_ph_use_idx]
spf_tb.show_table_theta_phi_psi_fft_list(tipical_th_ph_list_use, job_dir, label_list=label_list, figsize=figsize, dpi=dpi)
spf_tb.show_table_result_list(tipical_th_ph_list_use, job_dir, label_list=label_list, Table_t_range=Table_t_range,
                              figsize=figsize, dpi=dpi)


Out[41]:
True

In [8]:
psi_lim_fct = 20
resampling_fct = 10
figsize = np.array((16, 9)) * 0.7
dpi = 200

# case_path_list = separate_fre_path_v2(type_fre2)
# color_list =     [np.array(plt.get_cmap('tab20', len(check_fre_list))(i0)[:3]).reshape((1, 3)) 
#                   for i0 in np.arange(type_fre2.values.max() + 1)]
for idx, psi_lim1 in enumerate(np.linspace(0, 2 * np.pi, psi_lim_fct * 16, endpoint=False)[::psi_lim_fct]):
    psi_lim = (psi_lim1, psi_lim1 + 2 * np.pi / (psi_lim_fct * 16))
    # create fig
    desc = '$\\psi \\in [%.3f \\pi, %.3f \\pi)$' % ((psi_lim[0] / np.pi), (psi_lim[1] / np.pi))
    fig, ax1 = plt.subplots(1, 1, figsize=figsize, dpi=dpi, subplot_kw=dict(polar=True))
    n_xticks = 32
    xticks = np.arange(n_xticks)
    ax1.set_xticks(xticks / n_xticks * 2 * np.pi)
    ax1.set_xticklabels(['$\dfrac{%d}{%d}2\pi$' % (i0, n_xticks) for i0 in xticks])
    ax1.set_yticklabels([])
    ax1.set_ylim(0, np.pi)
    fig.suptitle(desc)
    fig.tight_layout(rect=[0, 0, 1, 0.95])
    
    for i0 in np.arange(type_fre2.values.max() + 1):
        # get case_path
        iidx = np.where(np.isclose(type_fre2.values, i0))
        theta = type_fre2.index.values[iidx[0]]
        phi = type_fre2.columns.values[iidx[1]]
        theta_phi_list = np.vstack((theta, phi)).T
        case_path = []
        for theta, phi in theta_phi_list[:]:
            t_headle = 'th%5.3f_ph%5.3f_(.*?).pickle' % (theta, phi)
            filename = [filename for filename in os.listdir(job_dir)
                        if re.match(t_headle, filename) is not None][0]
            case_path.append(os.path.join(PWD, job_dir, filename))
            
        thandle = ''
        color = np.array(plt.get_cmap('tab20', int(type_fre2.values.max() + 1))(int(i0))[:3]).reshape((1, 3)) 
#         print(int(type_fre2.values.max()), i0, color)
        spf_tb.draw_phase_map_theta(case_path, color, psi_lim, axs=[ax1, ], thandle=thandle, 
                                    resampling=True, resampling_fct=resampling_fct)
    tdir = os.path.join(PWD, job_dir, 'phase_mape_fre')
    if not os.path.exists(tdir):
        os.makedirs(tdir)
    figname = os.path.join(tdir, '%04d.png' % (idx))
    fig.savefig(os.path.join(tdir, figname))
    print('save to %s' % figname)
    plt.close(fig)




save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0000.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0001.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0002.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0003.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0004.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0005.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0006.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0007.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0008.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0009.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0010.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0011.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0012.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0013.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0014.png


save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.9_psi-0a/phase_mape_fre/0015.png

In [ ]: