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

from tqdm.notebook import tqdm as 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
# 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 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 = 'ecoC01B05_wt0.7_psi-0a'
table_name = 'ecoC01B05_tao1_wm0.7'

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    
    freq_pk = spf_tb.get_major_fre(tx[idx], tpick['Table_theta'][idx])
    idx = tx > (tx.max() - 1 / freq_pk * 10)
    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/envs/py35/lib/python3.5/site-packages/ipykernel_launcher.py:17: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0
Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`


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]:
# sort phase map of theta-phi using the name beging with pick frequience
importlib.reload(spf_tb)
do_sort = True

if do_sort:
    # clear dir
    dirpath = os.path.join(PWD, job_dir, 'th_ph_fft')
    if os.path.exists(dirpath) and os.path.isdir(dirpath):
        import shutil
        shutil.rmtree(dirpath)
        print('remove folder %s' % dirpath)
    os.makedirs(dirpath)
    print('make folder %s' % dirpath)

    for tname in tqdm_notebook(filename_list[:]):
        tpath = os.path.join(PWD, job_dir, tname)
        with open(tpath, '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']

        tmin = np.max((0, Table_t.max() - 1000))
        idx = Table_t > tmin    
        freq_pk = spf_tb.get_major_fre(Table_t[idx], Table_theta[idx])
        idx = Table_t > (Table_t.max() - 1 / freq_pk * 10)
        freq_pk = spf_tb.get_major_fre(Table_t[idx], Table_theta[idx])
        save_name = 'fre%.5f_%s.jpg' % (freq_pk, os.path.splitext(os.path.basename(tname))[0])
        fig = spf_tb.light_save_theta_phi(os.path.join(dirpath, save_name), 
                                    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])
        plt.close(fig)


remove folder /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.7_psi-0a/th_ph_fft
make folder /home/zhangji/stokes_flow_master/head_Force/do_calculate_table/ecoC01B05_wt0.7_psi-0a/th_ph_fft
/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:15: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0
Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`
  from ipykernel import kernelapp as app


In [7]:
importlib.reload(spf_tb)
theta, phi = 0, 0

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']
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 0.000000 -ini_phi 0.000000 -ini_psi 0.000000
/home/zhangji/stokes_flow_master/codeStore/support_fun_table.py:615: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  plt.tight_layout()
Out[7]:
True

In [8]:
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.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000 0.015000
0.143 0.015000 0.013999 0.014998 0.013999 0.015000 0.014999 0.014998 0.014998 0.014999 0.013999 0.014998 0.015000 0.015000 0.015000 0.013999 0.015000 0.013999 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.014998 0.016499 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014000 0.014999 0.014998 0.014998 0.014999 0.015000 0.014999 0.014998 0.014000 0.015000
0.286 0.015000 0.014999 0.014000 0.014998 0.015000 0.014999 0.014998 0.014000 0.014999 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.015000 0.015000 0.015000 0.014999 0.015000 0.013999 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.014998 0.014999 0.014998 0.014999 0.014999 0.015000 0.013999 0.014999 0.015000 0.015000 0.014999 0.014999 0.014998 0.014998 0.014999
0.428 0.014999 0.014999 0.014999 0.014998 0.013999 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014998 0.015000 0.014999 0.014999 0.014999 0.013999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.015000 0.015000 0.015000 0.014999 0.015000 0.014999 0.014999 0.015000 0.014999 0.015000 0.014999 0.014999 0.013999 0.014999 0.015000 0.014999
0.571 0.014999 0.014999 0.014999 0.015000 0.014999 0.014998 0.013998 0.014999 0.014999 0.014999 0.013999 0.014998 0.015000 0.015000 0.014999 0.014999 0.015000 0.015000 0.014999 0.015000 0.014999 0.014999 0.014998 0.014999 0.015000 0.014999 0.014999 0.014999 0.013999 0.014999 0.015000 0.015000 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.013999 0.014999
0.714 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.013999 0.015000 0.015000 0.014999 0.014999 0.014999 0.015000 0.014998 0.013999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.013999 0.013999 0.015000 0.014999 0.014998 0.015000 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.014999
0.857 0.015000 0.015000 0.014999 0.014998 0.014999 0.014999 0.014999 0.015000 0.014998 0.014999 0.014998 0.013999 0.014998 0.014998 0.014999 0.014999 0.014999 0.015000 0.016999 0.014999 0.014999 0.014999 0.015999 0.014999 0.014998 0.014999 0.014999 0.014999 0.013998 0.014999 0.013999 0.014999 0.014000 0.015000 0.015000 0.014999 0.014999 0.013999 0.014998 0.015000 0.014999 0.015000 0.014999 0.015000 0.014999
1.000 0.014999 0.013999 0.014998 0.014999 0.014999 0.014999 0.014999 0.013999 0.014998 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.014998 0.015000 0.014999 0.014999 0.014999 0.014998 0.014999 0.014998 0.014999 0.014999 0.014998 0.014000 0.014999 0.014999 0.014999 0.015000 0.013999 0.015000 0.014999 0.015000 0.014999 0.014999 0.015000 0.015000 0.014000 0.014999 0.014999 0.014999 0.014999
1.142 0.014999 0.014999 0.014000 0.014999 0.014998 0.014999 0.014999 0.015000 0.013999 0.014999 0.014999 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014998 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.014999 0.014999 0.014998 0.014999 0.013999 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.013999 0.015000 0.014999
1.285 0.014998 0.014999 0.013999 0.015000 0.013999 0.015000 0.014999 0.014999 0.013999 0.014998 0.014999 0.015000 0.015000 0.013999 0.015000 0.015000 0.014999 0.014999 0.015000 0.014999 0.014998 0.014999 0.015000 0.016999 0.014998 0.013999 0.014999 0.014999 0.014999 0.013999 0.014999 0.014998 0.015000 0.013999 0.015000 0.015000 0.014998 0.014999 0.014999 0.013999 0.014999 0.014999 0.014999 0.013999 0.015000
1.428 0.014999 0.015000 0.015000 0.014999 0.015000 0.014999 0.015000 0.013999 0.014999 0.015000 0.014999 0.015000 0.015000 0.014999 0.014999 0.014998 0.014999 0.014999 0.013999 0.014999 0.014999 0.015000 0.013998 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.015000 0.014999 0.014999 0.014999 0.014998 0.014999 0.014999 0.014999 0.015000 0.013999 0.013999 0.014999 0.015000 0.015000 0.015000 0.014999
1.571 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.013999 0.016998 0.021277 0.096032 0.021185 0.017599 0.014999 0.013999 0.015000 0.014999 0.014998 0.014999 0.015000 0.014998 0.014999 0.014998 0.014998 0.014999 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.015000 0.015999 0.014998 0.014999 0.014999 0.014999
1.714 0.013999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.014999 0.015000 0.014998 0.014999 0.015000 0.014998 0.014999 0.014999 0.014998 0.014000 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.015000 0.014999 0.014998 0.014999 0.014998 0.014999 0.014999 0.015000 0.014998 0.014999 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.015000 0.013999
1.856 0.014999 0.013999 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.014998 0.014999 0.014999 0.014999 0.014998 0.014999 0.014999 0.015000 0.013999 0.014999 0.015000 0.013998 0.014999 0.015000 0.016999 0.015000 0.014998 0.014000 0.014999 0.013999 0.014999 0.014998 0.014999 0.013999 0.015000 0.014999 0.014999 0.014999 0.013999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999
1.999 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014998 0.014999 0.014998 0.014999 0.015000 0.014999 0.014998 0.014999 0.014999 0.014998 0.014999 0.014999 0.014999 0.014999 0.014998 0.015000 0.015000 0.014999 0.014998 0.014999 0.014999 0.014999 0.014999 0.013999 0.014999 0.014999 0.014998 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.015000
2.142 0.015000 0.014999 0.015000 0.013999 0.014999 0.014999 0.014000 0.014999 0.014000 0.014998 0.015000 0.014999 0.014999 0.015000 0.014998 0.014998 0.014999 0.014999 0.014999 0.015000 0.015000 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.015000 0.015000 0.014000 0.014999 0.014999 0.014999 0.015000 0.014000 0.014999 0.014999 0.014999 0.015000 0.014998 0.015000
2.285 0.014999 0.013999 0.013999 0.014998 0.014999 0.014999 0.014998 0.014999 0.015000 0.016999 0.014998 0.014999 0.015000 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.017999 0.015000 0.014999 0.014999 0.015001 0.015999 0.014998 0.014998 0.013999 0.014999 0.015000 0.014999 0.015000
2.428 0.015000 0.014999 0.015000 0.014998 0.013999 0.014998 0.014999 0.014998 0.014999 0.014999 0.015000 0.014000 0.013999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.013998 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014998 0.013999 0.014999 0.015000 0.014999 0.014999 0.014999 0.014998 0.014999 0.015000 0.014998 0.013999 0.014999 0.014999 0.014999
2.570 0.014999 0.014999 0.014999 0.014999 0.014998 0.014999 0.014999 0.014998 0.014998 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.015000 0.013998 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014000 0.015000 0.014999 0.015000 0.013999 0.013999 0.013999
2.713 0.014999 0.014999 0.014999 0.014999 0.014998 0.014998 0.014000 0.014998 0.013999 0.013999 0.014999 0.015000 0.014999 0.014999 0.014998 0.014999 0.014998 0.013999 0.014999 0.014999 0.014999 0.014998 0.014998 0.013998 0.014999 0.014999 0.013999 0.015000 0.014999 0.014999 0.014999 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.013999 0.014999 0.014398 0.015000 0.013999 0.014999 0.014999 0.014999
2.856 0.014999 0.015000 0.014999 0.014998 0.013999 0.014999 0.013999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.015000 0.014999 0.014999 0.015000 0.015000 0.018000 0.015000 0.014999 0.014999 0.015000 0.014999 0.015000 0.014998 0.014999 0.014998 0.013998 0.015000 0.015000 0.014999 0.014000 0.014999 0.015000 0.015000 0.015000 0.014999 0.015000 0.014999 0.014999 0.014999 0.014998 0.013999 0.014999
2.999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.015000 0.014999 0.015000 0.014998 0.015000 0.014999 0.015299 0.014999 0.014999 0.014999 0.014999 0.014998 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.013999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999
3.142 0.013999 0.014998 0.014999 0.014999 0.014000 0.014999 0.013999 0.014999 0.014999 0.014000 0.014998 0.014000 0.014999 0.014999 0.014999 0.014999 0.014999 0.015000 0.014999 0.014999 0.014999 0.015000 0.015000 0.015000 0.014998 0.014999 0.014999 0.014999 0.014999 0.014998 0.014999 0.014999 0.015998 0.014999 0.014999 0.014999 0.015000 0.014998 0.014999 0.015000 0.014999 0.014999 0.014999 0.015000 0.014999

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


[0.0960319327 0.0212770132 0.0211847337 0.017999547  0.0179985229 0.0175993334
 0.0169991729 0.0169989401 0.0169988646 0.0169985514 0.0169982034 0.0164986966
 0.0159994051 0.0159991232 0.0159988776 0.0159978278 0.0152988215 0.0150005413
 0.0150004139 0.015000365  0.0150003533 0.0150003524 0.0150003229 0.0150003018
 0.0150002798 0.015000277  0.015000238  0.0150001982 0.0150001953 0.0150001927
 0.0150001911 0.0150001855 0.0150001753 0.015000173  0.0150001696 0.0150001577
 0.0150001558 0.0150000924 0.0150000873 0.0150000855 0.0150000733 0.0150000726
 0.0150000718 0.015000067  0.0150000647 0.0150000598 0.0150000548 0.0150000499
 0.015000047  0.0150000361 0.0150000341 0.0150000318 0.0150000078 0.0150000002
 0.0149999924 0.0149999894 0.0149999704 0.0149999675 0.014999958  0.0149999527
 0.0149999512 0.0149999375 0.014999935  0.014999928  0.014999915  0.0149999131
 0.014999903  0.014999901  0.0149998995 0.0149998977 0.0149998866 0.0149998864
 0.014999886  0.0149998747 0.0149998723 0.0149998556 0.0149998444 0.0149998415
 0.0149998362 0.0149998312 0.0149998256 0.0149998255 0.0149998222 0.0149998207
 0.0149998155 0.0149998119 0.0149998098 0.0149998055 0.014999801  0.014999799
 0.014999795  0.0149997908 0.0149997809 0.0149997741 0.0149997739 0.0149997736
 0.014999773  0.0149997685 0.0149997669 0.0149997668 0.014999766  0.0149997628
 0.0149997614 0.0149997534 0.0149997507 0.0149997506 0.0149997506 0.0149997506
 0.0149997506 0.0149997506 0.0149997506 0.0149997506 0.0149997506 0.0149997506
 0.0149997506 0.0149997506 0.0149997506 0.0149997506 0.0149997506 0.0149997506
 0.0149997506 0.0149997506 0.0149997506 0.0149997506 0.0149997506 0.0149997506
 0.0149997506 0.0149997506 0.0149997506 0.0149997501 0.0149997452 0.0149997416
 0.0149997384 0.0149997343 0.0149997271 0.0149997251 0.0149997242 0.0149997235
 0.0149997055 0.0149997017 0.0149996994 0.0149996874 0.014999686  0.0149996833
 0.0149996829 0.0149996826 0.014999682  0.014999681  0.0149996805 0.014999674
 0.0149996727 0.0149996667 0.0149996601 0.0149996583 0.0149996551 0.0149996506
 0.0149996497 0.0149996487 0.014999648  0.0149996459 0.0149996425 0.0149996418
 0.0149996417 0.0149996395 0.0149996377 0.014999636  0.0149996327 0.0149996313
 0.0149996309 0.0149996277 0.0149996274 0.0149996262 0.014999626  0.0149996214
 0.0149996206 0.0149996205 0.0149996178 0.014999616  0.0149996135 0.0149996124
 0.0149996119 0.0149996097 0.0149996075 0.0149996048 0.0149996042 0.0149996039
 0.0149996007 0.0149995971 0.014999597  0.0149995943 0.0149995907 0.0149995899
 0.0149995861 0.0149995854 0.0149995839 0.0149995825 0.0149995816 0.0149995802
 0.0149995797 0.0149995793 0.0149995767 0.0149995745 0.0149995722 0.0149995712
 0.0149995674 0.0149995665 0.0149995637 0.0149995637 0.0149995617 0.0149995597
 0.0149995508 0.014999549  0.0149995458 0.0149995433 0.0149995419 0.0149995387
 0.0149995384 0.0149995377 0.0149995363 0.0149995333 0.0149995332 0.0149995331
 0.0149995322 0.0149995318 0.0149995308 0.0149995292 0.0149995291 0.0149995244
 0.0149995244 0.0149995238 0.0149995197 0.0149995174 0.0149995136 0.0149995101
 0.0149995093 0.0149995091 0.0149995088 0.0149995046 0.0149995033 0.0149995013
 0.0149994969 0.0149994963 0.0149994954 0.014999493  0.0149994911 0.014999489
 0.0149994889 0.0149994885 0.0149994866 0.0149994862 0.0149994842 0.0149994838
 0.0149994818 0.0149994815 0.0149994812 0.014999479  0.0149994778 0.0149994766
 0.0149994754 0.0149994717 0.0149994715 0.0149994697 0.0149994686 0.0149994655
 0.014999463  0.0149994628 0.0149994608 0.0149994608 0.0149994598 0.0149994553
 0.0149994549 0.0149994527 0.0149994516 0.0149994511 0.0149994494 0.0149994493
 0.0149994491 0.0149994425 0.0149994419 0.0149994416 0.0149994392 0.0149994389
 0.0149994384 0.0149994338 0.0149994334 0.0149994319 0.0149994285 0.014999428
 0.0149994277 0.014999425  0.0149994236 0.0149994152 0.0149994122 0.014999412
 0.014999407  0.0149994054 0.0149994046 0.0149994039 0.0149994003 0.0149993996
 0.0149993982 0.0149993966 0.0149993901 0.0149993891 0.0149993877 0.0149993835
 0.0149993831 0.0149993817 0.0149993813 0.014999381  0.0149993809 0.0149993782
 0.0149993763 0.0149993715 0.0149993694 0.0149993693 0.014999368  0.0149993675
 0.0149993649 0.0149993609 0.0149993599 0.0149993597 0.0149993579 0.0149993568
 0.014999356  0.0149993536 0.0149993506 0.0149993505 0.0149993501 0.0149993457
 0.014999344  0.0149993397 0.0149993392 0.0149993366 0.0149993356 0.0149993351
 0.0149993333 0.0149993318 0.0149993283 0.0149993275 0.0149993274 0.0149993248
 0.0149993241 0.0149993239 0.0149993219 0.0149993213 0.0149993209 0.0149993188
 0.0149993173 0.0149993155 0.0149993142 0.0149993138 0.0149993088 0.0149993076
 0.0149993068 0.0149993057 0.0149993042 0.0149993038 0.0149993022 0.0149992986
 0.0149992951 0.0149992931 0.0149992915 0.014999291  0.0149992882 0.0149992808
 0.0149992804 0.0149992797 0.0149992774 0.0149992755 0.0149992754 0.0149992754
 0.0149992741 0.0149992705 0.014999267  0.014999266  0.0149992654 0.0149992641
 0.0149992636 0.0149992628 0.0149992625 0.0149992624 0.0149992572 0.0149992549
 0.0149992528 0.0149992514 0.0149992499 0.0149992485 0.0149992479 0.0149992457
 0.0149992428 0.0149992428 0.014999242  0.014999241  0.0149992407 0.0149992404
 0.0149992401 0.0149992394 0.0149992372 0.0149992323 0.0149992318 0.0149992298
 0.0149992296 0.014999229  0.0149992271 0.0149992254 0.0149992251 0.0149992222
 0.0149992195 0.0149992189 0.0149992143 0.0149992135 0.0149992135 0.0149992135
 0.0149992122 0.014999208  0.0149992067 0.0149992026 0.0149991953 0.0149991943
 0.0149991933 0.0149991911 0.0149991898 0.0149991896 0.014999188  0.0149991855
 0.0149991845 0.0149991819 0.0149991798 0.014999178  0.0149991777 0.0149991768
 0.0149991742 0.0149991726 0.0149991709 0.0149991693 0.0149991691 0.0149991665
 0.0149991664 0.014999165  0.0149991647 0.0149991644 0.0149991636 0.014999163
 0.0149991563 0.014999148  0.0149991438 0.0149991426 0.0149991374 0.0149991372
 0.0149991354 0.0149991337 0.0149991335 0.0149991276 0.0149991271 0.0149991242
 0.014999122  0.014999122  0.0149991212 0.0149991207 0.0149991183 0.0149991175
 0.0149991175 0.0149991172 0.0149991157 0.0149991137 0.0149991124 0.0149991115
 0.0149991106 0.0149991103 0.0149991089 0.0149991077 0.0149991057 0.0149991049
 0.0149990992 0.0149990964 0.0149990963 0.0149990956 0.0149990938 0.014999092
 0.0149990915 0.0149990911 0.0149990905 0.0149990893 0.0149990864 0.0149990848
 0.0149990837 0.0149990812 0.014999081  0.0149990806 0.01499908   0.0149990769
 0.0149990703 0.0149990696 0.0149990694 0.0149990679 0.0149990679 0.0149990649
 0.0149990644 0.0149990631 0.0149990586 0.014999058  0.0149990559 0.0149990548
 0.0149990533 0.0149990531 0.0149990519 0.0149990498 0.0149990485 0.0149990473
 0.0149990471 0.0149990426 0.0149990379 0.0149990378 0.0149990345 0.0149990333
 0.0149990298 0.0149990295 0.0149990285 0.0149990277 0.0149990276 0.0149990214
 0.0149990193 0.0149990176 0.0149990176 0.0149990176 0.0149990176 0.0149990176
 0.0149990176 0.0149990176 0.0149990176 0.0149990176 0.0149990176 0.0149990176
 0.0149990176 0.0149990176 0.0149990176 0.0149990176 0.0149990176 0.0149990176
 0.0149990176 0.0149990176 0.0149990176 0.0149990176 0.0149990148 0.014999013
 0.0149990126 0.0149990109 0.0149990085 0.0149990054 0.0149990044 0.0149989983
 0.0149989977 0.0149989958 0.0149989912 0.0149989863 0.0149989862 0.0149989846
 0.0149989844 0.0149989771 0.0149989764 0.0149989758 0.0149989758 0.0149989719
 0.0149989712 0.0149989691 0.0149989688 0.0149989649 0.0149989643 0.0149989642
 0.0149989637 0.0149989634 0.0149989613 0.0149989596 0.014998958  0.014998957
 0.0149989557 0.0149989552 0.0149989518 0.01499895   0.0149989495 0.0149989495
 0.0149989482 0.0149989441 0.0149989429 0.0149989428 0.0149989425 0.0149989424
 0.0149989421 0.0149989417 0.0149989409 0.0149989388 0.014998938  0.0149989356
 0.0149989347 0.0149989346 0.0149989345 0.0149989342 0.0149989342 0.0149989332
 0.0149989272 0.0149989254 0.0149989249 0.0149989243 0.0149989238 0.0149989232
 0.0149989225 0.0149989204 0.0149989191 0.0149989191 0.0149989186 0.0149989183
 0.0149989153 0.0149989141 0.0149989136 0.0149989134 0.014998908  0.014998908
 0.0149989067 0.0149989059 0.0149989007 0.0149989003 0.0149988939 0.0149988925
 0.0149988901 0.0149988864 0.0149988863 0.014998886  0.0149988846 0.0149988822
 0.0149988809 0.0149988802 0.0149988791 0.0149988774 0.0149988771 0.014998873
 0.0149988727 0.0149988704 0.0149988675 0.0149988667 0.0149988661 0.0149988643
 0.0149988628 0.0149988576 0.0149988551 0.0149988551 0.0149988533 0.0149988531
 0.0149988522 0.0149988495 0.0149988466 0.0149988456 0.0149988445 0.0149988437
 0.0149988434 0.0149988415 0.0149988384 0.0149988382 0.0149988373 0.0149988258
 0.0149988218 0.0149988218 0.0149988179 0.0149988173 0.0149988158 0.0149988152
 0.0149988144 0.0149988137 0.0149988122 0.0149988093 0.0149988088 0.0149988082
 0.0149988076 0.0149988061 0.0149988051 0.0149988049 0.0149988011 0.0149987992
 0.0149987992 0.0149987968 0.0149987935 0.0149987873 0.0149987866 0.0149987844
 0.0149987828 0.0149987806 0.0149987804 0.0149987801 0.01499878   0.0149987771
 0.0149987763 0.0149987747 0.0149987745 0.0149987736 0.0149987711 0.0149987679
 0.0149987672 0.0149987624 0.0149987599 0.0149987587 0.0149987579 0.0149987572
 0.0149987532 0.0149987513 0.0149987506 0.0149987484 0.0149987435 0.0149987433
 0.014998742  0.0149987415 0.0149987387 0.014998732  0.0149987317 0.0149987234
 0.0149987198 0.0149987165 0.0149987135 0.0149987096 0.0149987082 0.0149987046
 0.0149987042 0.0149987041 0.0149987037 0.0149986984 0.0149986939 0.0149986931
 0.0149986877 0.0149986839 0.0149986813 0.0149986811 0.0149986803 0.014998677
 0.0149986763 0.0149986749 0.014998673  0.0149986726 0.0149986713 0.0149986681
 0.0149986642 0.0149986638 0.0149986633 0.014998662  0.0149986604 0.0149986581
 0.0149986568 0.014998656  0.0149986559 0.0149986517 0.0149986514 0.0149986507
 0.0149986484 0.0149986458 0.0149986421 0.0149986399 0.0149986387 0.0149986385
 0.0149986355 0.0149986329 0.0149986329 0.0149986321 0.0149986287 0.0149986247
 0.0149986245 0.014998621  0.0149986206 0.0149986196 0.014998618  0.0149986177
 0.0149986157 0.0149986157 0.0149986138 0.0149986138 0.0149986107 0.0149986045
 0.0149986033 0.0149985991 0.0149985991 0.0149985969 0.0149985964 0.0149985887
 0.0149985813 0.0149985737 0.0149985708 0.0149985665 0.0149985632 0.0149985631
 0.014998563  0.0149985626 0.0149985619 0.0149985612 0.0149985563 0.0149985562
 0.0149985559 0.0149985511 0.0149985499 0.0149985488 0.0149985467 0.0149985464
 0.0149985435 0.0149985415 0.0149985342 0.0149985332 0.0149985321 0.0149985294
 0.0149985257 0.0149985243 0.0149985122 0.0149985116 0.0149985112 0.014998511
 0.0149985083 0.0149985073 0.0149985043 0.0149985007 0.0149985006 0.0149984923
 0.0149984899 0.0149984872 0.0149984869 0.0149984859 0.0149984856 0.0149984838
 0.014998477  0.0149984751 0.0149984673 0.014998461  0.0149984606 0.01499846
 0.0149984574 0.0149984569 0.0149984566 0.014998456  0.0149984462 0.0149984408
 0.0149984341 0.0149984315 0.0149984283 0.0149984268 0.0149984223 0.0149984189
 0.0149984181 0.0149984162 0.0149984132 0.014998408  0.0149984076 0.0149984015
 0.0149984006 0.0149984005 0.014998394  0.014998392  0.0149983903 0.0149983902
 0.0149983819 0.0149983811 0.0149983777 0.0149983722 0.0149983683 0.0149983657
 0.0149983592 0.0149983588 0.014998355  0.0149983531 0.0149983519 0.014998351
 0.0149983508 0.0149983506 0.0149983505 0.0149983458 0.0149983429 0.0149983378
 0.0149983368 0.0149983366 0.0149983345 0.0149983331 0.0149983327 0.0149983302
 0.0149983187 0.0149983178 0.0149983176 0.0149983147 0.0149983077 0.0149983007
 0.0149983006 0.0149982976 0.014998295  0.014998285  0.0149982847 0.0149982792
 0.0149982759 0.0149982686 0.0149982664 0.0149982659 0.0149982631 0.0149982604
 0.01499826   0.0149982538 0.0149982303 0.0149982297 0.0149982288 0.0149982226
 0.0149982189 0.0149982189 0.0149982102 0.0149982011 0.014998198  0.0149981958
 0.0149981881 0.0149981759 0.0149981719 0.0149981641 0.0149981621 0.0149981574
 0.0149981518 0.0149981392 0.0149981361 0.0149981361 0.0149981089 0.0149981076
 0.0149980877 0.0149980739 0.0149980677 0.0149980575 0.0149980455 0.0149980431
 0.0149980255 0.0149980033 0.0149979792 0.0143984529 0.0140000632 0.0139999217
 0.0139998585 0.0139998103 0.0139998021 0.0139997749 0.0139997737 0.0139997731
 0.01399976   0.0139997475 0.0139997289 0.0139997289 0.0139996991 0.0139996437
 0.0139996398 0.0139996357 0.0139996311 0.0139995878 0.0139995749 0.0139995682
 0.0139995557 0.0139994896 0.0139994713 0.0139994683 0.0139994346 0.0139994188
 0.0139994059 0.0139993572 0.0139993448 0.0139993433 0.0139993413 0.0139993298
 0.0139993006 0.0139992982 0.0139992703 0.0139992697 0.0139992508 0.0139992442
 0.0139992416 0.0139992378 0.0139992376 0.01399923   0.0139992116 0.0139991952
 0.0139991889 0.0139991745 0.0139991625 0.0139991577 0.0139991373 0.0139991266
 0.0139991096 0.0139991079 0.0139990733 0.0139990513 0.0139990493 0.0139990431
 0.0139990395 0.0139990332 0.0139990284 0.013999026  0.0139990222 0.013998989
 0.0139989854 0.013998984  0.0139989674 0.0139989668 0.0139989651 0.0139989398
 0.0139989366 0.013998932  0.0139989104 0.0139989068 0.0139989025 0.0139988985
 0.0139988777 0.0139988708 0.013998861  0.0139988019 0.0139988006 0.0139987929
 0.0139987924 0.0139987893 0.0139987487 0.0139987349 0.0139987247 0.0139987183
 0.0139987159 0.0139987041 0.0139986895 0.0139986872 0.0139986596 0.0139986578
 0.0139986533 0.0139986421 0.0139986394 0.0139986103 0.0139985731 0.0139985241
 0.0139985106 0.0139984965 0.0139984603 0.0139984501 0.0139984424 0.0139983544
 0.0139983403 0.0139982777 0.0139982197]

In [10]:
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[10]:
True

In [8]:
# 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)
    tipical_th_ph_list.append((theta, phi))
    spf_tb.show_pickle_results(job_dir, theta, phi, table_name)
    return True

def t_show_idx_list(iidx, nshow=5, Table_t_range1=np.array((0, np.inf)), Table_t_range2=np.array((0, np.inf))):
    nshow = int(np.min((nshow, iidx[0].size)))
    tidx = np.random.choice(iidx[0].size, nshow, replace=False)
    theta = type_fre.index.values[iidx[0][tidx]]
    phi = type_fre.columns.values[iidx[1][tidx]]
    theta_phi_list = np.vstack((theta, phi)).T
#     spf_tb.show_table_theta_phi_list(theta_phi_list, job_dir, Table_t_range=Table_t_range1, figsize=np.array((20, 20)), dpi=100)
    spf_tb.show_table_result_list(theta_phi_list, job_dir, Table_t_range=Table_t_range2, figsize=np.array((16, 9)), dpi=100)
    return True
tfre = theta_max_fre.copy()
check_fre_list = [0.0140, 0.0150]
atol_fre_list =  [0.0002, 0.0002]
Table_t_range1 = np.array((0, 1000))
Table_t_range2 = np.array((4500, np.inf))
nshow = np.inf

tipical_th_ph_list = []
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)
    t_show_idx_list(iidx, nshow=nshow, Table_t_range1=Table_t_range1, Table_t_range2=Table_t_range2)

# 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)
    t_show_idx_list(iidx, nshow=nshow, Table_t_range1=Table_t_range1, Table_t_range2=Table_t_range2)

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



In [6]:
# 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)
    tipical_th_ph_list.append((theta, phi))
    return True

tfre = theta_max_fre.copy()
check_fre_list = [0.0140, 0.0150]
atol_fre_list =  [0.0002, 0.0002]
Table_t_range1 = np.array((0, 1000))
Table_t_range2 = np.array((4500, np.inf))
tipical_th_ph_list = []

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)

Table_t_range = np.array((4500, np.inf))
figsize = np.array((16, 9))
dpi = 100

label_list = np.arange(len(tipical_th_ph_list))
spf_tb.show_table_theta_phi_psi_fft_list(tipical_th_ph_list, job_dir, label_list=label_list, figsize=figsize, dpi=dpi)
spf_tb.show_table_result_list(tipical_th_ph_list, job_dir, label_list=label_list, Table_t_range=Table_t_range,
                              figsize=figsize, dpi=dpi)


0.143 0.143
0.0 0.0
0.143 3.998
Out[6]:
True

In [ ]:
# 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

check_fre_list = [1.000, 0.0220, 1.0000, 0.0540]
atol_list =      [0.004, 0.0005, 0.0005, 0.0005]
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


In [ ]:

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


In [186]:
# show phase map of theta-phi, part 1
importlib.reload(spf_tb)
job_dir = 'ecoC01B05_T0.01_psi-0a'
table_name = 'ecoC01B05_T0.01'

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 [216]:
# show phase map of theta-phi, part 2
def show_phase_map(tuse):
    fig = plt.figure(figsize=(20, 12), dpi=300)
    fig.patch.set_facecolor('white')
    ax0 = fig.add_subplot(111, polar=True)
    n_xticks = 32
    xticks = np.arange(n_xticks)
    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)
    tdata = tuse.values
    im = ax0.pcolor(tuse.columns.values, tuse.index.values, tdata, 
                    cmap=plt.get_cmap('Set2', np.nanmax(tdata)+1), 
                    vmin=np.nanmin(tdata)-.5, vmax=np.nanmax(tdata)+.5)
    ticks = np.arange(np.nanmin(tdata), np.nanmax(tdata)+1)
    fig.colorbar(im, ax=ax0, orientation='vertical', ticks=ticks).ax.tick_params(labelsize=fontsize)

In [257]:
np.around(np.pi, 3)


Out[257]:
3.142

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

use_data = np.hstack((np.vstack(theta_primary_fre_list)[:, 1:], 
                      np.vstack(phi_primary_fre_list)[:, 1:]))
#KMeans
km = KMeans(n_clusters=6, 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_

# # personal process
# 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'])
show_phase_map(tdata1.use_fre)



In [250]:
np.array(ini_theta_list)[tlabels==show_tlabel]


Out[250]:
array([0.81955, 0.40977, 2.18546, 0.81955, 0.68295, 0.54636, 0.81955, 1.77568, 2.59523,
       2.59523, 1.5025 , 2.86841, 0.13659, 2.04887, 2.04887, 1.5025 , 1.77568, 2.59523,
       0.95614, 0.40977, 0.81955, 0.40977, 2.04887, 1.77568, 1.63909, 0.13659, 1.77568,
       1.36591, 1.63909, 1.36591, 1.77568, 2.32205, 3.005  , 2.32205, 0.54636, 2.32205,
       1.36591, 3.14159, 2.18546, 3.005  , 0.81955, 2.73182, 2.04887, 1.09273, 3.14159,
       2.86841, 0.27318, 1.77568, 2.18546, 0.27318, 3.14159, 2.73182, 1.5025 , 0.54636,
       1.36591, 1.5025 , 2.45864, 1.63909, 3.005  , 0.95614, 1.36591, 2.59523, 1.77568,
       0.81955, 1.63909, 2.18546, 2.04887, 0.54636, 0.40977, 0.13659, 1.63909, 2.18546,
       2.18546, 0.40977, 1.22932, 2.73182, 1.77568, 2.32205, 3.14159, 1.09273, 0.27318,
       2.59523, 1.36591, 1.36591, 3.005  , 2.18546, 2.59523, 2.45864, 0.40977, 1.09273,
       2.59523, 1.77568, 2.45864, 1.5025 , 0.27318, 1.63909, 2.04887, 0.95614, 2.45864,
       0.68295, 1.36591, 1.36591, 2.59523, 1.22932, 2.32205, 2.59523, 2.45864, 2.86841,
       0.54636, 2.45864, 2.86841, 2.32205, 1.77568, 1.22932, 1.22932, 2.73182, 2.86841,
       0.54636, 0.54636, 2.86841, 2.86841, 1.22932, 1.5025 , 2.73182, 1.36591, 1.5025 ,
       1.36591, 2.59523, 1.63909, 0.40977, 0.81955, 1.77568, 0.68295, 0.27318, 1.77568,
       0.68295, 1.36591, 0.40977, 0.95614, 1.36591, 0.54636, 2.32205, 0.27318, 2.45864,
       1.36591, 0.81955, 0.68295, 1.22932, 3.14159, 2.04887, 1.09273, 0.13659, 0.95614,
       3.005  , 2.18546, 2.32205, 0.40977, 0.95614, 2.73182, 0.13659, 1.5025 , 2.45864,
       0.13659, 2.04887, 0.68295, 2.18546, 1.77568, 0.40977, 0.54636, 0.13659, 1.5025 ,
       0.95614, 0.95614, 1.36591, 0.40977, 0.81955, 0.95614, 1.77568, 2.86841, 0.68295,
       0.27318, 0.68295, 2.32205, 0.27318, 0.13659, 0.54636, 0.27318, 1.36591, 1.91227,
       2.73182, 2.18546, 2.59523, 3.14159, 3.14159, 2.32205, 2.04887, 0.40977, 2.59523,
       3.14159, 1.5025 , 2.59523, 3.005  , 0.54636, 2.18546, 0.13659, 0.68295, 2.86841,
       3.005  , 2.73182, 2.73182, 3.005  , 0.95614, 1.5025 , 2.32205, 1.77568, 3.14159,
       2.45864, 0.81955, 0.68295, 3.005  , 1.91227, 2.86841, 0.54636, 1.36591, 1.91227,
       1.63909, 0.54636, 0.95614, 2.73182, 0.68295, 1.36591, 2.18546, 3.14159])

In [251]:
importlib.reload(spf_tb)
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)


-ini_theta 0.819546 -ini_phi 1.604218 -ini_psi 0.000000
-ini_theta 0.409773 -ini_phi 0.133685 -ini_psi 0.000000
-ini_theta 2.185456 -ini_phi 0.534739 -ini_psi 0.000000
-ini_theta 0.819546 -ini_phi 2.540011 -ini_psi 0.000000
-ini_theta 0.682955 -ini_phi 0.133685 -ini_psi 0.000000
-ini_theta 0.546364 -ini_phi 0.534739 -ini_psi 0.000000
-ini_theta 0.819546 -ini_phi 0.133685 -ini_psi 0.000000
-ini_theta 1.775683 -ini_phi 0.935794 -ini_psi 0.000000
-ini_theta 2.595229 -ini_phi 0.267370 -ini_psi 0.000000
-ini_theta 2.595229 -ini_phi 0.133685 -ini_psi 0.000000

In [241]:
importlib.reload(spf_tb)

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 0.819546 -ini_phi 1.604218 -ini_psi 0.000000
-ini_theta 3.005002 -ini_phi 0.401054 -ini_psi 0.000000
-ini_theta 1.639092 -ini_phi 0.267370 -ini_psi 0.000000
-ini_theta 3.141592 -ini_phi 0.334212 -ini_psi 0.000000
-ini_theta 2.595229 -ini_phi 2.807381 -ini_psi 0.000000
-ini_theta 2.458638 -ini_phi 3.074750 -ini_psi 0.000000

In [ ]:
tlabels=