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)

from tqdm import tqdm_notebook
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
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 import tqdm, tqdm_notebook
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 = 'hlxC01_a_psi-0e'
table_name = 'hlxC01_tau1a'

In [4]:
# show phase map of theta-phi, load date
importlib.reload(spf_tb)
t_headle = '(.*?).pickle'
t_path = os.listdir(os.path.join(PWD, job_dir))
filename_list = [filename for filename in os.listdir(os.path.join(PWD, job_dir)) 
                 if re.match(t_headle, filename) is not None]
ini_theta_list = []
ini_phi_list = []
lst_eta_list = []
theta_max_fre_list = []
phi_max_fre_list = []
psi_max_fre_list = []
eta_max_fre_list = []
pickle_path_list = []
idx_list = []
for i0, tname in enumerate(tqdm_notebook(filename_list[:])):
    tpath = os.path.join(PWD, job_dir, tname)
    with open(tpath, 'rb') as handle:
        tpick = pickle.load(handle)
    ini_theta_list.append(tpick['ini_theta'])
    ini_phi_list.append(tpick['ini_phi'])
    lst_eta_list.append(tpick['Table_eta'][-1])
    pickle_path_list.append(tpath)
    idx_list.append(i0)
    
    # fft rule
    tx = tpick['Table_t']
    tmin = np.max((0, tx.max() - 1000))
    idx = tx > tmin
#     pick_fre = np.min((spf_tb.get_major_fre(tpick['Table_t'], tpick['Table_theta']), 
#                        spf_tb.get_major_fre(tpick['Table_t'], tpick['Table_phi']), 
#                        spf_tb.get_major_fre(tpick['Table_t'], tpick['Table_psi']), 
#                        spf_tb.get_major_fre(tpick['Table_t'], tpick['Table_eta']), ))
#     tmin = tx.max() - 1 / pick_fre * 10
#     idx = np.logical_and(np.hstack((True, np.diff(tx)>0)), tx > tmin)
    theta_max_fre_list.append(spf_tb.get_major_fre(tx[idx], tpick['Table_theta'][idx]))
    phi_max_fre_list.append(spf_tb.get_major_fre(tx[idx], tpick['Table_phi'][idx]))
    psi_max_fre_list.append(spf_tb.get_major_fre(tx[idx], tpick['Table_psi'][idx]))
    eta_max_fre_list.append(spf_tb.get_major_fre(tx[idx], tpick['Table_eta'][idx]))

data0 = pd.DataFrame({'ini_theta': np.around(ini_theta_list, 3), 
                 'ini_phi': np.around(ini_phi_list, 3), 
                 'lst_eta': np.around(lst_eta_list, 3), 
                 'theta_max_fre': theta_max_fre_list, 
                 'phi_max_fre': phi_max_fre_list, 
                 'psi_max_fre': psi_max_fre_list, 
                 'eta_max_fre': eta_max_fre_list, 
                 'data_idx': idx_list })
data = data0.pivot_table(index=['ini_theta'], columns=['ini_phi'])
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)


/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:16: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0
Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`
  app.launch_new_instance()


In [5]:
# check if the 3D parameter space is been traversed or not 
do_check = False
if do_check:
    t_headle = '(.*?).pickle'
    t_path = os.listdir(os.path.join(PWD, job_dir))
    filename_list = [filename for filename in os.listdir(os.path.join(PWD, job_dir)) 
                     if re.match(t_headle, filename) is not None]
    ttheta = []
    tphi = []
    tpsi = []
    for i0, tname in enumerate(tqdm_notebook(filename_list[:])):
        tpath = os.path.join(PWD, job_dir, tname)
        with open(tpath, 'rb') as handle:
            tpick = pickle.load(handle)
        ttheta.append(tpick['Table_theta'])
        tphi.append(tpick['Table_phi'])
        tpsi.append(tpick['Table_psi'])

    ttheta, tphi, tpsi = np.hstack(ttheta), np.hstack(tphi), np.hstack(tpsi)
    from evtk.hl import pointsToVTK
    vtu_name = '/home/zhangji/check_th_ph_ps_%s' % job_dir
    pointsToVTK(vtu_name, 
                ttheta, tphi, tpsi, 
                data={'th_ph_ps': ttheta})
    print('save theta_phi_psi infomation to %s' % vtu_name)

In [6]:
importlib.reload(spf_tb)

theta, phi = 0, 0 # green case
theta, phi = 2.595, 0.134 # cyan case

t_headle = 'th%5.3f_ph%5.3f_(.*?).pickle' % (theta, phi)
t_path = os.listdir(os.path.join(PWD, job_dir))
filename = [filename for filename in os.listdir(os.path.join(PWD, job_dir)) 
            if re.match(t_headle, filename) is not None][0]
with open(os.path.join(PWD, job_dir, filename), 'rb') as handle:
    tpick = pickle.load(handle)
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']
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
# 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])
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 2.595229 -ini_phi 0.133685 -ini_psi 0.000000
/home/zhangji/stokes_flow_master/codeStore/support_fun_table.py:609: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  plt.tight_layout()
Out[6]:
True

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


ini_phi 0.000 0.134 0.267 0.401 0.535 0.668 0.802 0.936 1.069 1.203 1.337 1.471 1.604 1.738 1.872 2.005 2.139 2.273 2.406 2.540 2.674 2.807 2.941 3.075 3.208 3.342 3.476 3.609 3.743 3.877 4.011 4.144 4.278 4.412 4.545 4.679 4.813 4.946 5.080 5.214 5.347 5.481 5.615 5.748 5.882 6.016 6.150 6.283
ini_theta
0.000 0.021996 0.021997 0.021996 0.021996 0.021996 0.021996 0.021996 0.021995 0.021995 0.021996 0.021995 0.021996 0.022006 0.022018 0.022022 0.022003 0.021996 0.022008 0.022004 0.022021 0.021999 0.022009 0.022021 0.021997 0.022005 0.022015 0.022008 0.022007 0.022019 0.022006 0.021997 0.021998 0.021999 0.022016 0.022020 0.022019 0.021996 0.021997 0.021997 0.021996 0.021995 0.021996 0.021997 0.021995 0.021996 0.021995 0.021995 0.021996
0.137 0.021998 0.022005 0.022002 0.021998 0.021997 0.022004 0.022005 0.022006 0.022004 0.022017 0.022003 0.022018 0.022011 0.022007 0.022004 0.022007 0.022001 0.021997 0.022006 0.022002 0.021996 0.051994 0.052002 0.051995 0.021997 0.022006 0.021996 0.022004 0.021999 0.021996 0.022012 0.022006 0.022008 0.022007 0.021999 0.022011 0.022013 0.021998 0.021995 0.022006 0.022003 0.021995 0.022009 0.022003 0.022004 0.053995 0.053994 0.022007
0.273 0.022003 0.021998 0.022009 0.021998 0.021996 0.022001 0.022004 0.022003 0.021999 0.022000 0.022010 0.021997 0.022013 0.022002 0.022005 0.022007 0.022000 0.021997 0.022008 0.022004 0.022000 0.052005 0.051993 0.051993 0.022012 0.021997 0.022011 0.022003 0.022000 0.021999 0.022001 0.022000 0.021996 0.022004 0.021996 0.021995 0.021997 0.021997 0.022007 0.021999 0.022011 0.021998 0.022010 0.022003 0.021999 0.054007 0.054000 0.022003
0.410 0.021997 0.022015 0.021999 0.021998 0.021996 0.022001 0.021998 0.022007 0.021999 0.022005 0.022007 0.022001 0.021996 0.022012 0.022005 0.021996 0.021999 0.021997 0.022011 0.022010 0.022002 0.051994 0.051995 0.051999 0.021998 0.021999 0.022012 0.022006 0.022017 0.022011 0.021997 0.022008 0.022011 0.022009 0.022007 0.021998 0.022000 0.022007 0.021997 0.022004 0.022000 0.022009 0.022000 0.022003 0.021997 0.053995 0.053993 0.022008
0.546 0.022016 0.022003 0.021997 0.021999 0.021996 0.021996 0.022004 0.021998 0.022007 0.022004 0.022005 0.022004 0.022001 0.021997 0.022007 0.021997 0.021996 0.021997 0.022020 0.021997 0.021998 0.052008 0.051995 0.052009 0.022000 0.022003 0.022002 0.021997 0.021998 0.021996 0.021998 0.022009 0.022006 0.021998 0.021999 0.022003 0.021996 0.021996 0.021996 0.022001 0.021997 0.021996 0.022014 0.021996 0.022015 0.021996 0.054004 0.021996
0.683 0.021997 0.022011 0.022006 0.022007 0.022001 0.021997 0.022000 0.022004 0.022011 0.021998 0.021998 0.021998 0.022007 0.021998 0.022006 0.022000 0.021996 0.022003 0.022000 0.021998 0.021997 0.022020 0.052000 0.051997 0.022000 0.022007 0.021996 0.021997 0.022007 0.022015 0.022002 0.022002 0.022014 0.021999 0.021996 0.022000 0.021996 0.021999 0.022001 0.022010 0.022000 0.021999 0.021996 0.021996 0.021997 0.049993 0.053994 0.022004
0.820 0.022003 0.022000 0.022005 0.022007 0.022005 0.022004 0.021998 0.021997 0.021997 0.022000 0.021998 0.021996 0.021999 0.021996 0.021997 0.021997 0.021996 0.022007 0.022002 0.022005 0.021997 0.022010 0.051997 0.051997 0.022002 0.022000 0.021996 0.022006 0.021996 0.021999 0.021999 0.021998 0.022009 0.022006 0.022013 0.022014 0.022004 0.021995 0.021997 0.022006 0.022007 0.022008 0.021999 0.022004 0.021996 0.049994 0.053997 0.021997
0.956 0.050001 0.022002 0.021996 0.021996 0.022014 0.022011 0.021996 0.021996 0.021996 0.021998 0.021997 0.021996 0.021997 0.022009 0.021999 0.021998 0.022021 0.022009 0.022003 0.022007 0.021996 0.022013 0.051999 0.051999 0.052013 0.022001 0.021996 0.022019 0.021997 0.022007 0.022007 0.022008 0.022018 0.022006 0.022008 0.022019 0.021999 0.021997 0.021997 0.022000 0.022010 0.022009 0.022017 0.022002 0.022006 0.021996 0.053997 0.049992
1.093 0.053994 0.021996 0.022015 0.021999 0.021996 0.021997 0.022004 0.022009 0.022012 0.021996 0.022005 0.021996 0.022007 0.022012 0.021999 0.022000 0.021998 0.021998 0.022004 0.022001 0.021999 0.022003 0.052001 0.052014 0.051994 0.022010 0.021997 0.022004 0.021998 0.022016 0.022008 0.021998 0.022000 0.022004 0.022007 0.022002 0.022010 0.021997 0.022003 0.021998 0.021995 0.021999 0.022008 0.022005 0.021999 0.048003 0.054006 0.053995
1.229 0.054008 0.021999 0.022007 0.022003 0.021999 0.022006 0.022003 0.022005 0.022008 0.022002 0.022003 0.022000 0.022004 0.022008 0.022008 0.022014 0.021999 0.021996 0.021995 0.022006 0.022003 0.022003 0.021998 0.051993 0.051994 0.021999 0.021996 0.022001 0.022010 0.022004 0.022008 0.021996 0.022002 0.021999 0.022019 0.021997 0.022006 0.022006 0.022011 0.021999 0.022009 0.022005 0.022009 0.022006 0.022007 0.021997 0.050009 0.054008
1.366 0.053993 0.049994 0.022007 0.021996 0.022002 0.021996 0.022014 0.022004 0.022007 0.022001 0.022000 0.021998 0.021998 0.022001 0.022002 0.021996 0.021996 0.021999 0.022003 0.022017 0.022006 0.022008 0.022002 0.052007 0.051998 0.051997 0.022007 0.021996 0.021997 0.022002 0.022007 0.021999 0.022001 0.021996 0.021996 0.021999 0.022002 0.022003 0.021997 0.022004 0.022016 0.022004 0.021996 0.022003 0.022005 0.021996 0.049993 0.053993
1.503 0.054002 0.053997 0.021998 0.022001 0.022000 0.022000 0.022001 0.022009 0.036994 0.035996 0.036000 0.035001 0.034998 0.034997 0.035003 0.036000 0.036004 0.037996 0.021998 0.022002 0.022019 0.021998 0.021999 0.052004 0.052001 0.051996 0.021998 0.021999 0.022008 0.022003 0.021996 0.021998 0.036995 0.035995 0.035996 0.034999 0.034996 0.034997 0.036000 0.035999 0.036994 0.051993 0.021996 0.021995 0.021998 0.021996 0.022010 0.054001
1.639 0.050001 0.054004 0.049994 0.047997 0.021998 0.022002 0.022006 0.037005 0.035995 0.036000 0.035996 0.035996 0.035996 0.035994 0.036000 0.036997 0.021999 0.022003 0.021999 0.021997 0.021999 0.021997 0.021996 0.052002 0.052001 0.051995 0.021998 0.022013 0.022004 0.021996 0.039002 0.037002 0.036004 0.035997 0.035997 0.036002 0.035999 0.036003 0.037000 0.021996 0.021995 0.022015 0.022003 0.022001 0.022000 0.022007 0.022007 0.049995
1.776 0.022008 0.053994 0.049998 0.022005 0.022002 0.021997 0.022004 0.022006 0.022018 0.022008 0.021998 0.021997 0.021998 0.022005 0.022001 0.022006 0.022003 0.022008 0.022009 0.022001 0.021997 0.022006 0.021996 0.051999 0.052000 0.051997 0.051995 0.022001 0.022000 0.022003 0.022001 0.021999 0.021999 0.022000 0.022013 0.022006 0.022007 0.022006 0.021996 0.022006 0.022001 0.022003 0.022001 0.022010 0.021995 0.022001 0.022011 0.021999
1.912 0.050006 0.053993 0.022007 0.048005 0.022003 0.022019 0.022009 0.021997 0.021997 0.022001 0.021998 0.021997 0.022001 0.022001 0.022009 0.022003 0.022006 0.021996 0.022002 0.022002 0.022022 0.022000 0.022008 0.021999 0.051997 0.051996 0.052005 0.022013 0.022003 0.022001 0.022004 0.021997 0.021996 0.022001 0.022018 0.022007 0.021999 0.021999 0.021996 0.021998 0.022000 0.022007 0.022006 0.022008 0.022002 0.022001 0.022004 0.049996
2.049 0.021997 0.053993 0.053998 0.021997 0.022002 0.021996 0.022013 0.022012 0.022005 0.022007 0.022002 0.022011 0.021996 0.022004 0.022010 0.021997 0.022005 0.022000 0.021996 0.022000 0.021999 0.021998 0.022000 0.021997 0.051994 0.051993 0.052007 0.022006 0.021997 0.021997 0.022004 0.021997 0.022001 0.021996 0.022013 0.022002 0.022005 0.022001 0.022009 0.022010 0.022009 0.022000 0.022009 0.022013 0.022004 0.022020 0.021995 0.021999
2.185 0.021996 0.053995 0.054005 0.021996 0.021997 0.022005 0.022002 0.022001 0.022008 0.022008 0.022004 0.022004 0.021996 0.022002 0.022005 0.022018 0.022001 0.022006 0.022009 0.021997 0.021996 0.021997 0.022000 0.022017 0.051993 0.052008 0.051996 0.022011 0.022014 0.021996 0.021995 0.022008 0.022013 0.022004 0.021996 0.021996 0.021997 0.021995 0.021996 0.021997 0.021999 0.022001 0.021998 0.022003 0.021998 0.021996 0.022000 0.022009
2.322 0.021997 0.053994 0.053995 0.022004 0.021997 0.022002 0.022005 0.021996 0.022004 0.021996 0.022002 0.022005 0.021997 0.022006 0.021997 0.021995 0.022005 0.022008 0.022016 0.022011 0.021997 0.022001 0.021998 0.021998 0.051997 0.051996 0.052009 0.022000 0.022002 0.021995 0.022003 0.022004 0.021995 0.022002 0.021998 0.022003 0.022000 0.021999 0.022001 0.022004 0.022001 0.022004 0.022001 0.021996 0.022000 0.021997 0.021997 0.021998
2.459 0.021997 0.053999 0.053997 0.022001 0.021997 0.022008 0.022004 0.022000 0.021996 0.021995 0.022003 0.022002 0.021995 0.022007 0.022015 0.022011 0.021998 0.021997 0.021999 0.022007 0.022003 0.021998 0.022008 0.021996 0.052007 0.051993 0.051993 0.021997 0.021995 0.021999 0.022009 0.022001 0.021995 0.022001 0.022007 0.021995 0.021998 0.021999 0.021999 0.021997 0.021996 0.022006 0.022006 0.022000 0.021998 0.021996 0.021997 0.021999
2.595 0.021996 0.053996 0.053995 0.022009 0.022000 0.022007 0.022005 0.022005 0.021998 0.022004 0.022000 0.021995 0.021998 0.021997 0.021995 0.021997 0.021996 0.022000 0.022002 0.021996 0.022001 0.022009 0.021998 0.021996 0.051997 0.052003 0.052008 0.022012 0.021997 0.022001 0.022005 0.021995 0.022003 0.022007 0.021998 0.022003 0.021999 0.021998 0.021999 0.022010 0.022004 0.022000 0.022003 0.022001 0.021996 0.022001 0.021998 0.022001
2.732 0.021996 0.049993 0.053995 0.022015 0.022005 0.022015 0.022000 0.021999 0.021996 0.022016 0.021998 0.021996 0.022009 0.021997 0.021998 0.021997 0.021996 0.021999 0.022003 0.021999 0.021998 0.022013 0.022003 0.022006 0.021996 0.051993 0.051993 0.021997 0.022000 0.022003 0.022005 0.021997 0.022007 0.021997 0.022007 0.022004 0.022015 0.022011 0.022016 0.021997 0.021997 0.021999 0.022008 0.021998 0.021997 0.022021 0.021998 0.021998
2.868 0.022005 0.021998 0.053995 0.021995 0.021997 0.022000 0.022007 0.022003 0.021996 0.022005 0.021998 0.022013 0.022002 0.022002 0.022011 0.022013 0.022004 0.022003 0.021996 0.021999 0.022005 0.022004 0.021998 0.022010 0.051993 0.051997 0.052002 0.021997 0.021998 0.022003 0.022000 0.021997 0.022003 0.022002 0.021999 0.022009 0.022001 0.022004 0.022002 0.021997 0.022008 0.022006 0.021997 0.021997 0.021996 0.022005 0.021996 0.021996
3.005 0.022018 0.049999 0.053994 0.022004 0.021998 0.021996 0.022005 0.022010 0.022006 0.022018 0.021999 0.021998 0.021997 0.021998 0.022007 0.021996 0.021997 0.021996 0.021997 0.021995 0.021995 0.022009 0.022000 0.022002 0.052003 0.051998 0.051995 0.022015 0.022002 0.022004 0.021999 0.022002 0.022009 0.022005 0.022007 0.022002 0.022002 0.022016 0.022018 0.022002 0.022016 0.022010 0.022010 0.021998 0.021996 0.022005 0.022008 0.022007
3.142 0.022006 0.052003 0.053005 0.021996 0.022001 0.021996 0.022002 0.021998 0.022008 0.021999 0.022007 0.021998 0.022014 0.022016 0.022016 0.022005 0.022000 0.022015 0.022006 0.022001 0.021996 0.021998 0.021997 0.022007 0.049995 0.054006 0.045995 0.022003 0.021996 0.022000 0.021996 0.021997 0.022002 0.022003 0.022002 0.022006 0.022001 0.022009 0.022004 0.022006 0.021995 0.021999 0.021999 0.022004 0.022000 0.021998 0.021997 0.021999

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


[0.0540083394 0.0540077843 0.0540069354 0.0540062047 0.0540056091 0.0540048181
 0.0540044783 0.0540040641 0.0540017883 0.0540013267 0.0540004861 0.0539987272
 0.0539981085 0.0539972111 0.0539970984 0.0539967351 0.0539966628 0.0539964869
 0.0539954797 0.0539952989 0.0539950193 0.0539949191 0.0539948967 0.0539946801
 0.0539945659 0.0539945538 0.0539942073 0.0539940536 0.0539940282 0.0539938778
 0.0539938614 0.0539937291 0.0539933358 0.0539931391 0.0539931095 0.0539930668
 0.0539930148 0.053005015  0.0520141457 0.0520134577 0.0520086891 0.052008537
 0.0520079142 0.0520075971 0.0520075804 0.0520074139 0.052007225  0.0520070782
 0.0520054735 0.0520048112 0.0520036429 0.0520034218 0.0520030654 0.0520025523
 0.0520020722 0.0520019039 0.052001806  0.0520012702 0.0520006721 0.0520006687
 0.0519998458 0.051999608  0.0519994082 0.051999401  0.0519993082 0.051998844
 0.0519980339 0.0519976349 0.0519974241 0.05199739   0.0519973105 0.0519973042
 0.0519972735 0.0519968712 0.0519968626 0.0519966569 0.0519965647 0.0519963553
 0.0519959066 0.0519957834 0.0519955827 0.0519952558 0.0519951964 0.0519950859
 0.0519950538 0.051995026  0.051994778  0.0519944573 0.051994344  0.0519936154
 0.0519936077 0.0519935645 0.0519934465 0.0519933938 0.0519932425 0.0519932137
 0.0519932033 0.0519931222 0.0519930766 0.0519930688 0.0519930531 0.0519929744
 0.0519926668 0.0500087564 0.0500058297 0.0500009286 0.0500008933 0.0499992862
 0.0499976311 0.0499958124 0.0499952538 0.049995208  0.0499940057 0.04999399
 0.0499936215 0.0499931036 0.0499928324 0.0499926252 0.0499923498 0.0480045295
 0.0480027767 0.0479972637 0.0459946847 0.0390022081 0.037996321  0.0370047767
 0.0370020411 0.0370002469 0.0369968774 0.0369951804 0.0369939181 0.0369938402
 0.0360041609 0.0360037491 0.0360030544 0.0360020675 0.0360002904 0.036000229
 0.0359998285 0.0359996883 0.0359995751 0.0359992848 0.0359989588 0.0359973319
 0.0359967397 0.0359964655 0.0359962477 0.0359959644 0.0359957402 0.03599552
 0.0359955    0.0359950092 0.035994406  0.0350034718 0.0350011606 0.034998525
 0.0349983236 0.0349974262 0.0349971513 0.0349955265 0.0220219058 0.0220215175
 0.0220211446 0.0220207273 0.0220206751 0.0220206512 0.0220203257 0.0220202324
 0.0220200708 0.0220198434 0.0220194438 0.0220191673 0.0220191441 0.0220190999
 0.0220188753 0.0220188415 0.0220186901 0.0220184629 0.022018385  0.0220183637
 0.0220181257 0.0220181231 0.0220181109 0.0220179472 0.0220175499 0.0220175383
 0.0220174475 0.0220171983 0.0220171034 0.0220170411 0.0220170246 0.0220164931
 0.0220164929 0.0220164333 0.0220164187 0.0220163251 0.0220162656 0.0220161997
 0.0220161976 0.0220159224 0.0220156274 0.0220155433 0.0220154674 0.0220153683
 0.0220153308 0.0220153179 0.0220150671 0.022015058  0.0220149511 0.0220149141
 0.022014866  0.0220148552 0.0220147    0.0220145004 0.0220144259 0.0220143176
 0.0220142051 0.0220139759 0.0220139412 0.0220137346 0.0220135973 0.0220135934
 0.0220134335 0.0220133854 0.0220133122 0.0220131652 0.0220131583 0.0220131313
 0.0220131294 0.0220130582 0.0220130249 0.0220128717 0.0220128218 0.0220128014
 0.0220126919 0.0220125052 0.0220123242 0.0220122074 0.0220121487 0.0220120843
 0.0220120512 0.0220120147 0.0220118316 0.0220116418 0.0220113254 0.0220113232
 0.0220112818 0.0220112215 0.0220112097 0.022011081  0.0220110116 0.0220109293
 0.022010903  0.0220108869 0.022010882  0.0220108154 0.0220107781 0.0220107094
 0.022010696  0.0220106283 0.0220105106 0.022010507  0.0220104612 0.0220104315
 0.0220103884 0.0220103807 0.0220103768 0.02201034   0.0220103122 0.0220102673
 0.0220101606 0.0220100799 0.0220099819 0.0220099513 0.0220098388 0.0220096859
 0.0220096732 0.0220095951 0.0220095604 0.0220095054 0.0220094716 0.0220093241
 0.0220093114 0.0220092645 0.0220092351 0.0220091637 0.0220091134 0.0220090928
 0.0220090685 0.0220090399 0.0220089936 0.0220089865 0.0220089201 0.0220089133
 0.0220088889 0.0220088708 0.0220088658 0.0220088402 0.0220088358 0.0220087616
 0.0220087046 0.0220086608 0.022008649  0.0220086433 0.0220086334 0.022008606
 0.0220085876 0.0220085821 0.0220085498 0.0220085484 0.022008447  0.0220084116
 0.0220084102 0.0220084058 0.0220083543 0.0220083452 0.0220083057 0.0220083002
 0.0220082786 0.0220082468 0.0220082251 0.0220082102 0.0220081068 0.0220081049
 0.0220080846 0.022008056  0.0220080404 0.022008001  0.0220079933 0.0220078256
 0.0220077857 0.0220077535 0.0220077085 0.0220077063 0.0220076903 0.0220076849
 0.0220076486 0.0220075968 0.0220075929 0.0220075652 0.0220075341 0.0220075008
 0.0220074986 0.0220074487 0.0220074421 0.0220074338 0.0220074228 0.0220074098
 0.0220073708 0.0220073665 0.0220073557 0.0220073336 0.0220073026 0.0220072936
 0.0220072858 0.0220072639 0.0220072503 0.0220072384 0.0220072238 0.0220072072
 0.0220071867 0.0220071857 0.0220071551 0.0220071431 0.0220071298 0.0220071269
 0.022007106  0.0220070963 0.0220070492 0.022007033  0.0220070294 0.0220069872
 0.0220069851 0.0220069657 0.0220069572 0.0220069444 0.0220069381 0.0220069272
 0.0220069249 0.0220068811 0.0220067981 0.0220067462 0.022006735  0.0220066848
 0.0220066623 0.0220066582 0.0220066572 0.0220066423 0.0220066367 0.0220066088
 0.0220065492 0.0220065181 0.0220065174 0.0220064649 0.022006396  0.0220063591
 0.0220063433 0.0220063432 0.0220063338 0.0220063315 0.0220062458 0.0220062369
 0.0220061775 0.0220061694 0.022006149  0.0220061341 0.022006106  0.0220060885
 0.0220060501 0.0220060441 0.0220060327 0.022006026  0.0220060259 0.0220060181
 0.0220060138 0.0220060086 0.0220059886 0.0220059247 0.0220058722 0.0220058618
 0.0220058044 0.0220058001 0.0220057975 0.0220057542 0.0220057443 0.0220057028
 0.0220056574 0.0220056571 0.0220056527 0.0220055931 0.0220055591 0.0220055545
 0.0220055294 0.0220055248 0.0220055231 0.0220055079 0.0220054846 0.0220054635
 0.0220054627 0.0220054488 0.0220054424 0.0220054185 0.0220053638 0.0220053584
 0.0220053481 0.0220053393 0.0220053386 0.0220053301 0.0220052963 0.0220052806
 0.0220051758 0.0220051531 0.0220051447 0.0220050579 0.0220050214 0.0220050127
 0.0220050111 0.0220049895 0.0220049667 0.0220049622 0.0220049505 0.0220048821
 0.0220048705 0.0220048499 0.0220048002 0.0220047629 0.0220047485 0.0220047379
 0.0220047307 0.0220047221 0.0220046584 0.022004628  0.0220045462 0.0220045213
 0.0220044962 0.0220044929 0.0220044806 0.0220044446 0.0220044437 0.0220044359
 0.0220044269 0.0220044221 0.0220044208 0.0220043227 0.0220043133 0.0220043048
 0.0220042951 0.0220041688 0.0220041681 0.0220041541 0.022004149  0.022004137
 0.0220041141 0.0220041015 0.0220040978 0.022004031  0.0220040258 0.022004023
 0.0220040124 0.0220039613 0.0220039545 0.0220039374 0.022003934  0.0220039136
 0.0220039124 0.0220039006 0.0220038982 0.0220038938 0.0220038912 0.0220038858
 0.0220038484 0.0220038471 0.0220038423 0.0220038289 0.02200376   0.022003759
 0.0220037582 0.0220036797 0.0220036654 0.0220036316 0.0220036123 0.0220036107
 0.0220036    0.0220035579 0.0220035543 0.0220035302 0.0220035023 0.0220034965
 0.022003492  0.0220034892 0.0220034775 0.0220034525 0.0220034505 0.0220034432
 0.0220034302 0.022003429  0.0220034004 0.0220033972 0.0220033017 0.0220032653
 0.0220032646 0.0220032404 0.0220032324 0.0220032208 0.0220032107 0.0220031768
 0.0220031426 0.022003138  0.022003138  0.0220031244 0.0220030883 0.0220030774
 0.0220030081 0.0220029872 0.0220029826 0.0220029775 0.0220029765 0.0220029625
 0.0220029255 0.022002921  0.0220028963 0.0220028857 0.0220028608 0.0220028596
 0.0220028347 0.0220027942 0.0220027775 0.0220027573 0.0220027333 0.0220027224
 0.0220027033 0.0220026677 0.0220026519 0.0220026375 0.0220026256 0.0220026031
 0.0220025717 0.0220025119 0.0220025106 0.0220024995 0.0220024069 0.0220023755
 0.0220023751 0.0220023579 0.0220023493 0.0220023445 0.022002335  0.0220023229
 0.0220022881 0.0220022857 0.022002281  0.0220022463 0.022002233  0.0220022235
 0.0220022068 0.0220021905 0.0220021765 0.0220021509 0.0220020675 0.0220020663
 0.0220020643 0.022002037  0.0220020314 0.0220020142 0.0220020131 0.0220019868
 0.0220019624 0.022001952  0.0220019336 0.0220019097 0.022001898  0.0220018743
 0.022001869  0.0220018095 0.0220017741 0.0220017437 0.0220017089 0.0220017059
 0.022001657  0.0220016537 0.0220016047 0.0220016031 0.0220016009 0.0220015897
 0.0220015808 0.0220015628 0.0220015286 0.0220015089 0.0220014857 0.0220014394
 0.0220013867 0.0220013713 0.0220013152 0.0220012818 0.0220012535 0.0220012454
 0.0220012432 0.0220012385 0.0220012219 0.0220012054 0.0220012007 0.0220011713
 0.0220011515 0.0220011497 0.0220011474 0.0220011306 0.02200113   0.0220011278
 0.0220011257 0.0220011188 0.022001113  0.0220011075 0.022001069  0.0220010625
 0.0220010333 0.0220010231 0.0220009892 0.0220009657 0.0220009603 0.0220009555
 0.0220009515 0.0220008795 0.0220008537 0.0220008444 0.0220008241 0.0220008124
 0.0220007384 0.0220007161 0.022000715  0.0220006941 0.0220006935 0.0220006867
 0.0220006766 0.0220006488 0.0220005794 0.0220005775 0.0220005491 0.0220005457
 0.0220005123 0.0220005028 0.0220004517 0.0220004272 0.022000419  0.0220004001
 0.0220003831 0.0220003624 0.0220003615 0.0220003574 0.022000343  0.0220003016
 0.0220002847 0.0220002533 0.0220002219 0.0220002189 0.0220001983 0.0220001917
 0.0220001817 0.0220001769 0.0220001766 0.0220001754 0.0220001622 0.0220001596
 0.0220001502 0.0220001457 0.0220001018 0.0220000346 0.0220000256 0.0220000132
 0.0219999948 0.0219999882 0.0219999569 0.0219999158 0.0219999155 0.0219999035
 0.0219999014 0.0219998818 0.0219998509 0.0219998426 0.0219998409 0.0219998212
 0.0219998116 0.0219997363 0.0219996684 0.0219996524 0.0219996409 0.0219996317
 0.0219996129 0.0219996081 0.0219995995 0.0219995994 0.0219995797 0.0219995364
 0.0219995277 0.0219994997 0.0219994989 0.0219994856 0.0219994787 0.0219994741
 0.0219994707 0.0219994699 0.0219994648 0.0219994473 0.0219994409 0.0219994262
 0.0219994061 0.0219994057 0.0219993778 0.0219993639 0.0219993481 0.0219993388
 0.0219993387 0.0219993377 0.0219993067 0.0219993038 0.0219993013 0.0219992948
 0.0219992755 0.021999271  0.0219992543 0.0219992509 0.0219992285 0.0219992208
 0.0219991531 0.0219991317 0.0219991286 0.0219991003 0.0219990855 0.0219990844
 0.0219990784 0.0219990726 0.0219990595 0.0219990381 0.0219989827 0.0219989688
 0.0219989552 0.021998955  0.0219989266 0.0219988897 0.0219988554 0.0219988507
 0.0219987863 0.021998784  0.0219987782 0.0219987686 0.021998765  0.021998759
 0.0219987586 0.0219987556 0.0219987202 0.0219987185 0.0219986999 0.0219986908
 0.0219986787 0.0219986661 0.0219986446 0.0219986224 0.0219986107 0.0219985894
 0.0219985891 0.0219985891 0.0219985853 0.0219985675 0.0219985563 0.0219985549
 0.0219984752 0.0219984638 0.0219984449 0.0219984378 0.0219984288 0.0219984146
 0.0219984145 0.0219983996 0.0219983945 0.021998373  0.0219983552 0.021998355
 0.0219983243 0.0219983213 0.0219982932 0.0219982899 0.0219982771 0.0219982535
 0.0219982268 0.0219982169 0.0219982036 0.0219982001 0.021998192  0.021998175
 0.0219981689 0.0219981528 0.0219981353 0.0219981102 0.0219981078 0.0219981022
 0.0219981015 0.0219980648 0.0219980587 0.0219980571 0.0219980508 0.0219980372
 0.0219980185 0.0219980026 0.0219979966 0.0219979895 0.021997983  0.0219979812
 0.0219979726 0.0219979634 0.0219979259 0.0219978852 0.0219978777 0.0219978686
 0.0219978632 0.0219978627 0.0219978626 0.0219978605 0.0219978539 0.0219978431
 0.0219978258 0.0219978206 0.0219977858 0.0219977831 0.0219977786 0.0219977722
 0.0219977677 0.0219977657 0.0219977408 0.0219977371 0.0219977336 0.0219977317
 0.0219977247 0.0219977015 0.0219976839 0.0219976558 0.0219976349 0.0219976218
 0.0219975991 0.0219975912 0.0219975848 0.0219975756 0.0219975564 0.0219975526
 0.021997527  0.0219975186 0.0219975164 0.0219974966 0.0219974861 0.0219974715
 0.0219974617 0.0219974613 0.0219974534 0.0219974468 0.0219974176 0.021997392
 0.021997379  0.0219973665 0.0219973609 0.0219973573 0.021997357  0.0219973457
 0.0219973432 0.0219973316 0.0219973274 0.0219973257 0.0219973213 0.0219973136
 0.0219972951 0.0219972945 0.0219972927 0.0219972873 0.0219972625 0.0219972561
 0.0219972349 0.0219972203 0.0219971985 0.0219971831 0.0219971824 0.0219971662
 0.0219971555 0.0219971495 0.0219971476 0.021997143  0.0219971403 0.0219971255
 0.0219971219 0.0219971019 0.0219970897 0.021997089  0.0219970864 0.021997077
 0.0219970697 0.0219970606 0.0219970591 0.0219970503 0.0219970264 0.0219970183
 0.0219970039 0.0219969999 0.0219969967 0.0219969912 0.0219969898 0.0219969849
 0.0219969747 0.021996972  0.0219969658 0.0219969643 0.0219969572 0.0219969445
 0.0219969163 0.0219968985 0.0219968909 0.0219968472 0.0219968391 0.0219968381
 0.0219968172 0.0219968056 0.0219967898 0.0219967815 0.0219967633 0.0219967537
 0.0219967469 0.0219967356 0.0219967247 0.0219967162 0.0219967096 0.021996701
 0.0219966833 0.0219966797 0.0219966795 0.0219966572 0.0219966542 0.021996654
 0.0219966435 0.0219966334 0.021996626  0.021996617  0.0219966145 0.0219966124
 0.0219966045 0.0219965964 0.0219965849 0.0219965814 0.0219965754 0.0219965752
 0.0219965715 0.021996569  0.0219965689 0.0219965672 0.0219965522 0.0219965478
 0.021996538  0.0219965092 0.0219964923 0.0219964831 0.0219964771 0.0219964702
 0.0219964484 0.021996442  0.0219964397 0.0219964304 0.0219964291 0.0219964179
 0.0219964119 0.0219964047 0.0219963742 0.0219963724 0.0219963385 0.0219963384
 0.0219963355 0.0219963271 0.0219963184 0.0219963154 0.0219963148 0.0219962776
 0.0219962736 0.0219962679 0.0219962497 0.0219962491 0.0219962478 0.0219962384
 0.0219962322 0.0219962265 0.0219962216 0.0219962209 0.0219962103 0.0219961962
 0.0219961943 0.0219961894 0.0219961885 0.0219961681 0.0219961459 0.0219961425
 0.0219961337 0.0219961251 0.0219961168 0.0219961035 0.0219961024 0.021996097
 0.02199608   0.0219960799 0.0219960748 0.0219960734 0.0219960668 0.0219960615
 0.0219960543 0.0219960499 0.021996031  0.0219960298 0.0219960238 0.0219960112
 0.0219960085 0.0219960058 0.0219960011 0.0219959959 0.021995984  0.0219959611
 0.0219959482 0.0219959477 0.0219959474 0.0219959403 0.0219959297 0.0219959213
 0.0219959124 0.0219959108 0.0219959107 0.021995899  0.0219958847 0.021995879
 0.0219958749 0.0219958551 0.0219958469 0.0219958425 0.0219958342 0.021995812
 0.0219958117 0.0219958049 0.02199579   0.0219957898 0.0219957893 0.0219957803
 0.0219957796 0.0219957561 0.0219957493 0.0219957479 0.0219957422 0.0219957405
 0.0219957225 0.0219957044 0.0219957016 0.0219956651 0.0219956647 0.021995664
 0.0219956608 0.0219956578 0.0219956524 0.0219956468 0.0219956465 0.0219956451
 0.0219956365 0.0219956324 0.0219956282 0.0219956113 0.0219956095 0.0219955941
 0.0219955918 0.0219955759 0.0219955746 0.0219955723 0.021995556  0.0219955489
 0.021995548  0.0219955437 0.02199554   0.0219955231 0.0219955188 0.0219955153
 0.0219955095 0.0219955025 0.0219954907 0.0219954905 0.0219954871 0.0219954791
 0.0219954734 0.0219954714 0.0219954611 0.0219954571 0.021995454  0.0219954518
 0.0219954321 0.0219954129 0.0219954128 0.0219954081 0.0219954046 0.0219953975
 0.0219953968 0.021995393  0.0219953862 0.0219953846 0.0219953634 0.0219953626
 0.0219953509 0.0219953253 0.0219953222 0.0219953188 0.0219953136 0.0219952993
 0.0219952863 0.0219952654 0.0219952447 0.021995226  0.0219952053 0.0219952013]

In [9]:
spf_tb.show_traj_phase_map_fre(theta_max_fre)
# spf_tb.show_traj_phase_map_fre(phi_max_fre)
# spf_tb.show_traj_phase_map_fre(psi_max_fre)
# spf_tb.show_traj_phase_map_fre(eta_max_fre)


Out[9]:
True

In [10]:
# put images with same frequence into a subdirect
importlib.reload(spf_tb)
def t_show_idx(iidx):
    theta = type_fre.index.values[iidx[0][0]]
    phi = type_fre.columns.values[iidx[1][0]]
    print(theta, phi)
    spf_tb.show_pickle_results(job_dir, theta, phi, table_name)
    return True

tfre = theta_max_fre.copy()
check_fre_list = [0.0220, 0.0370, 0.0540]
atol_fre_list =  [0.0005, 0.0030, 0.0005]

type_fre = tfre.copy()
type_fre.iloc[:, :] = len(check_fre_list) 
for i0, (check_fre, atol_fre) in enumerate(zip(check_fre_list, atol_fre_list)):
    use_idx = np.isclose(tfre, check_fre, rtol=0, atol=atol_fre)
    type_fre.iloc[use_idx] = i0
    iidx = np.where(use_idx)
    t_show_idx(iidx)

# plot one of the remaind cases
if np.any(type_fre.values == len(check_fre_list)):
    iidx = np.where(type_fre.values == len(check_fre_list))
    t_show_idx(iidx)

spf_tb.show_traj_phase_map_type(type_fre)
spf_tb.save_separate_angleList_fft(job_dir, tfre, check_fre_list, atol_fre_list)


0.0 0.0
-ini_theta 0.000000 -ini_phi 0.000000 -ini_psi 0.000000
/home/zhangji/stokes_flow_master/codeStore/support_fun_table.py:609: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  plt.tight_layout()
1.503 1.069
-ini_theta 1.502501 -ini_phi 1.069478 -ini_psi 0.000000
0.137 6.016
-ini_theta 0.136591 -ini_phi 6.015816 -ini_psi 0.000000
0.137 2.807
-ini_theta 0.136591 -ini_phi 2.807381 -ini_psi 0.000000
frequency in the range (0.021500, 0.022500)
remove folder hlxC01_a_psi-0e/fre_separate/fre_0.022000
make folder hlxC01_a_psi-0e/fre_separate/fre_0.022000
frequency in the range (0.034000, 0.040000)
remove folder hlxC01_a_psi-0e/fre_separate/fre_0.037000
make folder hlxC01_a_psi-0e/fre_separate/fre_0.037000
frequency in the range (0.053500, 0.054500)
remove folder hlxC01_a_psi-0e/fre_separate/fre_0.054000
make folder hlxC01_a_psi-0e/fre_separate/fre_0.054000
remove folder hlxC01_a_psi-0e/fre_separate/remainders
make folder hlxC01_a_psi-0e/fre_separate/remainders

Out[10]:
True

In [11]:
# create phase map
importlib.reload(spf_tb)
def tget_ax0():
    n_xticks = 32
    xticks = np.arange(n_xticks)
    fig = plt.figure(figsize=(20, 20))
    fig.patch.set_facecolor('white')
    axs = []
    axs.append(fig.add_subplot(221, polar=True))
    axs.append(fig.add_subplot(222, polar=True))
    axs.append(fig.add_subplot(223, polar=True))
    axs.append(fig.add_subplot(224, polar=True))
    for ax0 in axs:
        ax0.set_xticks(xticks / n_xticks * 2 * np.pi)
        ax0.set_xticklabels(['$\dfrac{%d}{%d}2\pi$' % (i0, n_xticks) for i0 in xticks])
        ax0.set_yticklabels([])
        ax0.set_ylim(0, np.pi)
    plt.tight_layout()
    return fig, axs

color_list =     ['b',   'g',    'r',    'c',   'm', 'y', 'k']
psi_lim_fct = 20
resampling_fct = 10

data0['use_max_fre'] = data0.theta_max_fre
case_path_list = spf_tb.separate_fre_path(check_fre_list, atol_list, data0, pickle_path_list)
for idx, psi_lim1 in enumerate(np.linspace(0, 2 * np.pi, psi_lim_fct * 16, endpoint=False)[::psi_lim_fct]):
    fig, (ax0, ax1, ax2, ax3) = tget_ax0()
    ax_list = [ax0, ax0, ax1, ax2, ax3]
    psi_lim = (psi_lim1, psi_lim1 + 2 * np.pi / (psi_lim_fct * 16))
    desc = '$\psi\in[%.3f\pi, %.3f\pi)$' % ((psi_lim[0] / np.pi), (psi_lim[1] / np.pi))
    fig.suptitle(desc, fontsize=fontsize*0.8)
    for check_fre, case_path, color, axi in zip(check_fre_list, case_path_list, color_list, ax_list):
        thandle = '%f' % check_fre
        spf_tb.draw_phase_map_theta(case_path, color, psi_lim, axs=(axi, ax_list[-1]), 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)


/home/zhangji/stokes_flow_master/codeStore/support_fun_table.py:12: UserWarning: matplotlib.pyplot as already been imported, this call will have no effect.
  matplotlib.use('agg')
0th frequence range: (0.996000, 1.004000)
1th frequence range: (0.021500, 0.022500)
2th frequence range: (0.999500, 1.000500)
3th frequence range: (0.053500, 0.054500)
tmax_fre=0.048002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph0.401_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.683_ph2.941_ps0.000_D20190715_T023809.pickle
tmax_fre=0.035997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.738_ps0.000_D20190715_T020546.pickle
tmax_fre=0.052011, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.366_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.051998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.229_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.036003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph2.005_ps0.000_D20190715_T020546.pickle
tmax_fre=0.052012, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.322_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.683_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.322_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.051998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.093_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.050005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph0.000_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.366_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.820_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.459_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.052005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.093_ph2.941_ps0.000_D20190715_T023808.pickle
tmax_fre=0.050003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.005_ph0.134_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052011, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.185_ph3.342_ps0.000_D20190715_T031150.pickle
tmax_fre=0.052004, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.039005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.011_ps0.000_D20190715_T032724.pickle
tmax_fre=0.049996, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.366_ph6.150_ps0.000_D20190715_T045619.pickle
tmax_fre=0.035999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.069_ps0.000_D20190715_T005116.pickle
tmax_fre=0.052003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.956_ph2.941_ps0.000_D20190715_T023809.pickle
tmax_fre=0.035999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.604_ps0.000_D20190715_T020546.pickle
tmax_fre=0.035001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph4.679_ps0.000_D20190715_T040314.pickle
tmax_fre=0.052007, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.035004, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.471_ps0.000_D20190715_T013943.pickle
tmax_fre=0.050013, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.229_ph6.150_ps0.000_D20190715_T045619.pickle
tmax_fre=0.037003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph5.080_ps0.000_D20190715_T040605.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.137_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.049997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.732_ph0.134_ps0.000_D20190714_T225427.pickle
tmax_fre=0.050005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.956_ph0.000_ps0.000_D20190714_T225427.pickle
tmax_fre=0.048009, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph0.401_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052011, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.459_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.035998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph4.412_ps0.000_D20190715_T035348.pickle
tmax_fre=0.052006, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.868_ph3.476_ps0.000_D20190715_T031732.pickle
tmax_fre=0.037005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.144_ps0.000_D20190715_T032725.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.546_ph2.941_ps0.000_D20190715_T023808.pickle
tmax_fre=0.035998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.203_ps0.000_D20190715_T011130.pickle
tmax_fre=0.036000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.412_ps0.000_D20190715_T035348.pickle
tmax_fre=0.052007, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.005_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.052017, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.956_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.732_ph3.342_ps0.000_D20190715_T031150.pickle
tmax_fre=0.036002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph5.214_ps0.000_D20190715_T040610.pickle
tmax_fre=0.052003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.956_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.035001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.604_ps0.000_D20190715_T020546.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.005_ph3.476_ps0.000_D20190715_T031732.pickle
tmax_fre=0.052012, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.546_ph2.807_ps0.000_D20190715_T023653.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.820_ph2.941_ps0.000_D20190715_T023809.pickle
tmax_fre=0.052000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.868_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.036002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.813_ps0.000_D20190715_T040330.pickle
tmax_fre=0.036003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.203_ps0.000_D20190715_T011131.pickle
tmax_fre=0.036007, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph2.139_ps0.000_D20190715_T021010.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.049_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.050010, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph0.000_ps0.000_D20190714_T225427.pickle
tmax_fre=0.036006, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.946_ps0.000_D20190715_T040521.pickle
tmax_fre=0.036000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.545_ps0.000_D20190715_T040119.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.273_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.273_ph2.941_ps0.000_D20190715_T023808.pickle
tmax_fre=0.036003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph5.080_ps0.000_D20190715_T040604.pickle
tmax_fre=0.052000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph3.342_ps0.000_D20190715_T031150.pickle
tmax_fre=0.036005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.679_ps0.000_D20190715_T040314.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.410_ph2.807_ps0.000_D20190715_T142926.pickle
tmax_fre=0.035000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.738_ps0.000_D20190715_T020547.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.410_ph2.941_ps0.000_D20190715_T023809.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.137_ph2.807_ps0.000_D20190715_T023653.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.776_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.036997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph5.347_ps0.000_D20190715_T042036.pickle
tmax_fre=0.049998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.820_ph6.016_ps0.000_D20190715_T045020.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.868_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.036998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph4.278_ps0.000_D20190715_T033910.pickle
tmax_fre=0.045999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.142_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.053009, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.142_ph0.267_ps0.000_D20190714_T225427.pickle
tmax_fre=0.051996, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph5.481_ps0.000_D20190715_T043702.pickle
tmax_fre=0.035999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.471_ps0.000_D20190715_T013943.pickle
tmax_fre=0.052000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.366_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.052004, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.052000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.185_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.052003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.776_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.776_ph3.476_ps0.000_D20190715_T031732.pickle
tmax_fre=0.049998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph0.267_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052006, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.049996, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.956_ph6.283_ps0.000_D20190715_T045619.pickle
tmax_fre=0.036003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.872_ps0.000_D20190715_T020547.pickle
tmax_fre=0.052001, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.005_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.038000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph2.273_ps0.000_D20190715_T021007.pickle
tmax_fre=0.050002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.776_ph0.267_ps0.000_D20190714_T225427.pickle
tmax_fre=0.050000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph6.283_ps0.000_D20190715_T045619.pickle
tmax_fre=0.052012, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.546_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph3.342_ps0.000_D20190715_T031150.pickle
tmax_fre=0.035999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph4.545_ps0.000_D20190715_T040118.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.459_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.052011, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.049_ph3.476_ps0.000_D20190715_T031732.pickle
tmax_fre=0.034998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph4.813_ps0.000_D20190715_T040331.pickle
tmax_fre=0.049999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.142_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.048007, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.093_ph6.016_ps0.000_D20190715_T045021.pickle
tmax_fre=0.046996, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.683_ph2.807_ps0.000_D20190715_T023653.pickle
tmax_fre=0.035999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph1.337_ps0.000_D20190715_T011429.pickle
tmax_fre=0.049997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.683_ph6.016_ps0.000_D20190715_T142926.pickle
tmax_fre=0.049999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph6.283_ps0.000_D20190715_T045619.pickle
tmax_fre=0.051998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph3.342_ps0.000_D20190715_T031150.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.229_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.035006, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.872_ps0.000_D20190715_T020547.pickle
tmax_fre=0.052006, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.595_ph3.342_ps0.000_D20190715_T031150.pickle
tmax_fre=0.052003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.776_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.052009, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.052002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.410_ph2.807_ps0.000_D20190715_T023652.pickle
tmax_fre=0.036997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.069_ps0.000_D20190715_T005116.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.185_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.045997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.683_ph6.016_ps0.000_D20190715_T045020.pickle
tmax_fre=0.052011, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.595_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.036003, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph1.337_ps0.000_D20190715_T011428.pickle
tmax_fre=0.051999, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.322_ph3.342_ps0.000_D20190715_T031151.pickle
tmax_fre=0.037008, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph0.936_ps0.000_D20190715_T005118.pickle
tmax_fre=0.047998, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.912_ph0.267_ps0.000_D20190714_T225427.pickle
tmax_fre=0.037000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph2.005_ps0.000_D20190715_T020546.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.049_ph3.208_ps0.000_D20190715_T025014.pickle
tmax_fre=0.052018, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.093_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.035000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.503_ph4.946_ps0.000_D20190715_T040522.pickle
tmax_fre=0.051997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.732_ph3.476_ps0.000_D20190715_T031731.pickle
tmax_fre=0.052007, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th3.142_ph0.134_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052005, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.137_ph2.941_ps0.000_D20190715_T023808.pickle
tmax_fre=0.036007, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.639_ph4.278_ps0.000_D20190715_T033910.pickle
tmax_fre=0.052002, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.410_ph3.075_ps0.000_D20190715_T024550.pickle
tmax_fre=0.052000, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th2.595_ph3.208_ps0.000_D20190715_T025013.pickle
tmax_fre=0.049997, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th1.366_ph0.134_ps0.000_D20190714_T225427.pickle
tmax_fre=0.052009, n_match=0 /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/th0.273_ph2.807_ps0.000_D20190715_T023653.pickle



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0000.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0001.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0002.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0003.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0004.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0005.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0007.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0008.png





save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0010.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0011.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0012.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0013.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0014.png



save to /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/hlxC01_a_psi-0e/phase_mape_fre/0015.png

In [ ]:

calculate the phase map of stable trajectory using the KMeans method.


In [16]:
# show phase map of theta-phi, part 1
importlib.reload(spf_tb)
job_dir = 'hlxC01_a_psi-0e'

t_headle = '(.*?).pickle'
t_path = os.listdir(os.path.join(PWD, job_dir))
filename_list = [filename for filename in os.listdir(os.path.join(PWD, job_dir)) 
                 if re.match(t_headle, filename) is not None]
ini_theta_list = []
ini_phi_list = []
lst_eta_list = []
pickle_path_list = []
idx_list = []
theta_primary_fre_list = []
phi_primary_fre_list = []
psi_primary_fre_list = []
for i0, tname in enumerate(tqdm_notebook(filename_list[:])):
    tpath = os.path.join(PWD, job_dir, tname)
    with open(tpath, 'rb') as handle:
        tpick = pickle.load(handle)
    ini_theta_list.append(tpick['ini_theta'])
    ini_phi_list.append(tpick['ini_phi'])
    lst_eta_list.append(tpick['Table_eta'][-1])
    pickle_path_list.append(tpath)
    idx_list.append(i0)
    
    # fft rule
    tx = tpick['Table_t']
    tmin = np.max((0, tx.max() - 1000))
    idx = tx > tmin
    # the last frequence is the major frequence. 
    use_fft_number = 3
    t1 = -use_fft_number - 1
    theta_primary_fre_list.append(spf_tb.get_primary_fft_fre(tx[idx], tpick['Table_theta'][idx])[t1:-1])
    phi_primary_fre_list.append(spf_tb.get_primary_fft_fre(tx[idx], tpick['Table_phi'][idx])[t1:-1])
    psi_primary_fre_list.append(spf_tb.get_primary_fft_fre(tx[idx], tpick['Table_psi'][idx])[t1:-1])


/home/zhangji/anaconda3/lib/python3.5/site-packages/ipykernel/__main__.py:17: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0
Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`


In [18]:
from sklearn.cluster import KMeans
from sklearn.mixture import GaussianMixture

use_data = np.vstack(theta_primary_fre_list)[:, 2:]
#KMeans
km = KMeans(n_clusters=5, n_init=10, max_iter=1000, tol=1e-9, precompute_distances=True, n_jobs=-1, random_state=0)
km.fit(use_data)
km.predict(use_data)
tlabels = km.labels_
# #Gaussian Mixture Model
# gmm = GaussianMixture(n_components=5)
# gmm.fit(use_data)
# proba_lists = gmm.predict_proba(use_data)
# colored_arrays = np.matrix(proba_lists)
# tlabels = [tuple(i.tolist()[0]) for i in colored_arrays]

# personal process
tlabels[tlabels == 3] = 2
tlabels[tlabels == 4] = 3

tdata1 = pd.DataFrame({'ini_theta': np.around(ini_theta_list, 3), 
                      'ini_phi': np.around(ini_phi_list, 3), 
                      'lst_eta': np.around(lst_eta_list, 3), 
                      'use_fre': tlabels, 
                      'data_idx': idx_list })
tdata1 = tdata1.pivot_table(index=['ini_theta'], columns=['ini_phi'])
spf_tb.show_traj_phase_map_type(tdata1.use_fre)



In [ ]:


In [ ]:
importlib.reload(spf_tb)
job_dir = 'hlxC01_a_psi-0e'
table_name = 'hlxC01_tau1a'
show_tlabel = 0

for theta, phi in zip(np.array(ini_theta_list)[tlabels==show_tlabel][:10], 
                       np.array(ini_phi_list)[tlabels==show_tlabel][:10]): 
    spf_tb.show_pickle_results(job_dir, theta, phi, table_name, fast_mode=1)

In [56]:
importlib.reload(spf_tb)
job_dir = 'hlxC01_a_psi-0e'
table_name = 'hlxC01_tau1a'

for show_tlabel in np.arange(tlabels.max()+1): 
    theta = np.array(ini_theta_list)[tlabels==show_tlabel][0]
    phi = np.array(ini_phi_list)[tlabels==show_tlabel][0]
    spf_tb.show_pickle_results(job_dir, theta, phi, table_name, fast_mode=2)


-ini_theta 2.595229 -ini_phi 2.406326 -ini_psi 0.000000
-ini_theta 1.639092 -ini_phi 0.401054 -ini_psi 0.000000
-ini_theta 1.639092 -ini_phi 1.737902 -ini_psi 0.000000
-ini_theta 0.546364 -ini_phi 6.149501 -ini_psi 0.000000

In [ ]: