In [10]:
from chxanalys.chx_packages import *
%matplotlib notebook
plt.rcParams.update({'figure.max_open_warning': 0})
#%reset -f  #for clean up things in the memory

Define Result Path here


In [11]:
data_dir = '/XF11ID/analysis/2017_1/manisen/Results/'

Build a uid dictionary here


In [ ]:


In [20]:
suid_dict = {'Temp=175C_c_1' :'343e85','Temp=175C_c_2' :'e3e325', 
             'Temp=175C_c_3' :'db5a54', 'Temp=175C_c_4' :'913ed9', 'Temp=175C_c_5' :'e7dda7', 
             'Temp=175C_c_6' :'f19723' }

In [21]:
uid_dict = {}
for u in list( suid_dict.keys() ):
    uid_dict[u] =  get_meta_data( suid_dict[u] )['uid']
print( uid_dict )


{'Temp=175C_c_5': 'e7dda750-0d84-4883-bca8-932d9f0390b6', 'Temp=175C_c_6': 'f19723a6-e371-490e-a878-ea9b2f7ae409', 'Temp=175C_c_3': 'db5a54c6-c388-423f-a24d-285d42185097', 'Temp=175C_c_1': '343e859d-33e0-44c0-a549-280bca6f1d17', 'Temp=175C_c_2': 'e3e325a9-f8c5-4b3b-aef7-6581a6f83064', 'Temp=175C_c_4': '913ed964-dfa3-41ad-9401-c65b0ea5d7a9'}

Extract result here


In [22]:
total_res = {}

In [23]:
for u in list( uid_dict.keys() ):
    inDir =  data_dir + suid_dict[u] + '/'
    total_res[u] = extract_xpcs_results_from_h5( filename = 'uid=%s_Res.h5'%uid_dict[u], import_dir = inDir )

In [24]:
print( total_res[list( uid_dict.keys() )[0]].keys()  )


dict_keys(['qval_dict_v', 'g2', 'taus4', 'mean_int_sets', 'g2b_fit_paras', 'imgsum', 'bad_frame_list', 'iqst', 'q_saxs', 'roi_mask', 'mask', 'times_roi', 'md', 'iq_saxs', 'g2b', 'g12b', 'taus', 'g4', 'qval_dict', 'pixel_mask', 'avg_img', 'tausb', 'qval_dict_p', 'qt', 'g2_fit_paras'])

In [ ]:

Do some analysis here

1) plot g4


In [29]:
qth_interest = 9 #3      #the intested single qth

In [30]:
fig,ax=plt.subplots()
for u in sorted(list( uid_dict.keys() )):
    print(u)
    plot1D( x =  total_res[u]['taus4'], y= total_res[u]['g4'][:,qth_interest],
                   ax=ax, legend= u, ylim=[0, 0.0001], legend_size = 8, xlabel='t (sec)', ylabel='g4',
           title='four_order_time_correlation-->q=%s'%total_res[u]['qval_dict'][qth_interest][0], logx=True )
    
plt.savefig( data_dir +'g4_101k44pc_175_new_3.png' )


Temp=175C_c_1
Temp=175C_c_2
Temp=175C_c_3
Temp=175C_c_4
Temp=175C_c_5
Temp=175C_c_6

2) plot g2


In [32]:
fig,ax=plt.subplots()
for u in sorted(list( uid_dict.keys() )):
    y= total_res[u]['g2'][1:,qth_interest]
    ym = (y-y.min())/(y.max()-y.min())    
    plot1D( x =  total_res[u]['taus'][1:], y= ym,
                   ax=ax, legend= u, ylim=[-0.1, 1.1], legend_size = 10, xlabel='tau (sec)', ylabel='g1',
           title='normalized' +'one_time_correlation-->q=%s'%total_res[u]['qval_dict'][qth_interest][0], logx=True )
plt.savefig( data_dir +'normalized'+'g__101k44pc_175_new_3.png' )



In [36]:
fig,ax=plt.subplots()
for u in sorted(list( uid_dict.keys() )):
    plot1D( x =  total_res[u]['taus'], y= total_res[u]['g2'][:,qth_interest],
                   ax=ax, legend= u, ylim=[0.99, 1.15], legend_size = 10, xlabel='tau (sec)', ylabel='g2',
           title='one_time_correlation-->q=%s'%total_res[u]['qval_dict'][qth_interest][0], logx=True )
plt.savefig( data_dir +'g2_101k44pc__175_new_3.png' )


3) Plot q~relaxation time


In [333]:
qs = np.array([total_res[u]['qval_dict'][i][0] for i in range(   len(list(total_res[u]['qval_dict'].keys()))   ) ])

In [334]:
fig,ax=plt.subplots()
for u in sorted(list( uid_dict.keys() )):
    x= qs
    y= 1/total_res[u]['g2_fit_paras']['relaxation_rate']
    #print(y)
    plot1D( x =  qs, y= y, ax=ax, ylim=[0,200], legend= u, legend_size = 8, ls = '--',
           xlabel='q, (A-1)', ylabel='relaxation_time, (s)',
           title='q~relaxation_time', logx=True, logy=True )
plt.savefig( data_dir +'q~relaxation_time.png' )



In [ ]:


In [ ]: