In [1]:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
import matplotlib.pyplot as plt
import os

%matplotlib notebook
#%matplotlib inline

from ipywidgets import interact #, interactive, fixed, interact_manual
import ipywidgets as widgets

def rename_string_to_label(string):
    return(string.replace('b-pulseAlongX_0.22','UV').replace('z-from_S1_without_pulse','FC_1').replace('m-only_IR_longer_with_nac_2_1','IR_long').replace('_0000',''))


READING DATA


In [2]:
fol = '/home/alessio/k-nokick/'

subfolders = sorted([dir for dir in os.listdir(fol) if os.path.isdir(os.path.join(fol,dir)) and dir not in ['HTML','csv']])
print(''.join(['{} -> {}\n'.format(a,b) for a,b in enumerate(subfolders)]))


0 -> b-UV-0.22_0000
1 -> m-IR-Polarized-NOR_0000
2 -> m-only_IR_middle140_0000
3 -> m-only_IR_middle140_div10_0000
4 -> z-from1_0000


In [5]:
def create_df_from_files_given_name(name,fol,fs_end_pulse):
    '''
    This creates the excel file from the 4 files
    '''
    project_folder = os.path.join(fol,name)
    
    output_norm = os.path.join(project_folder, 'output')
    output_popu = os.path.join(project_folder, 'outputPopul')
    output_abso = os.path.join(project_folder, 'Output_Abs')
    output_regi = os.path.join(project_folder, 'Output_Regions')
    
    df_norm2 = pd.read_csv(output_norm, delim_whitespace=True, index_col=0, names=['counter', 'steps', 'fs','Norm deviation','Kinetic','Potential','Total','Total Deviation','Xpulse','Ypulse','Zpulse'])
    df_popu2 = pd.read_csv(output_popu, delim_whitespace=True, names=['fs', 'S0', 'S1','S2','S3','S4','S5','S6','S7'])
    df_abso2 = pd.read_csv(output_abso, delim_whitespace=True, names=['Time AU', 'Abs Tot', 'Abs S0', 'Abs S1','Abs S2','Abs S3','Abs S4','Abs S5','Abs S6','Abs S7'])
    df_regi2 = pd.read_csv(output_regi, delim_whitespace=True, names=['FC','Reactants','Products'])
    

    # I need to cut down to different file size <- this will become obsolete
    dfs = [df_norm2,df_popu2,df_abso2,df_regi2]
    lengths = min([x.shape[0] for x in dfs])
    
    df_norm, df_popu, df_abso, df_regi = [ x.drop(x.index[lengths:]) for x in dfs ]
    
    AU_dt = df_abso['Time AU'].iloc[1]
    
    #fs_end_pulse = 15 # this is where I start to count Fc population retourning in S0 after the pulse.
    fs_array = df_norm2['fs']
    filtering_on_indexes = np.arange(lengths)
#     number_line_after_pulse = np.where(fs_array > fs_end_pulse)[0][0]
    number_line_after_pulse = 200
    
    fs_after_pulse = df_popu['fs'].iloc[number_line_after_pulse]
    s0_after_pulse = df_popu['S0'].iloc[number_line_after_pulse]
    s1_after_pulse = df_popu['S1'].iloc[number_line_after_pulse]
    s2_after_pulse = df_popu['S2'].iloc[number_line_after_pulse]
    s3_after_pulse = df_popu['S3'].iloc[number_line_after_pulse]
    s4_after_pulse = df_popu['S4'].iloc[number_line_after_pulse]
    s5_after_pulse = df_popu['S5'].iloc[number_line_after_pulse]
    s6_after_pulse = df_popu['S6'].iloc[number_line_after_pulse]
    s7_after_pulse = df_popu['S7'].iloc[number_line_after_pulse]
    
    all_after_pulse = np.array([s0_after_pulse,s1_after_pulse,s2_after_pulse,s3_after_pulse,s4_after_pulse,s5_after_pulse,s6_after_pulse,s7_after_pulse])
    
    if number_line_after_pulse != 0:
        value_to_subtract = df_regi['FC'].iloc[number_line_after_pulse-1]
        df_regi['FC after pulse'] = np.where( filtering_on_indexes < number_line_after_pulse, 0, (df_regi['FC']-value_to_subtract))
    else:
        df_regi['FC after pulse'] = df_regi['FC']
        
    df_all = pd.concat([df_norm,df_popu,df_abso,df_regi],axis=1)
    
    csv_name = '{}.csv'.format(project_folder)
    
    print('{} #steps {} - End pulse {} - S1: {:8.5E} - S2: {:8.5E} - S3: {:8.5E} - S4: {:8.5E} {}'.format(AU_dt,lengths, fs_after_pulse,s1_after_pulse,s2_after_pulse,s3_after_pulse,s4_after_pulse,name))
    
    # ok this part needs comment. We want to normalize the S1 population to 1, to make the absorbed product count "fair"
    # But the population in S1 is "moving" due to the other states continuosly absorbing/feeding it
    # We make the assumption that all the other states are a single superstate that "feeds" only S1.
    # So we sum up states from S2 to S7. Then we take the population of those states (2 to 7) after the pulse. We want to 
    # know after the pulse what is the CHANGE in population due to NAC of this "super state".
    # our normalization factor for S1 at time T is ten the 
    
    df_all['sum_others'] = (df_all['S2'] + df_all['S3'] + df_all['S4'] + df_all['S5'] + df_all['S6'] + df_all['S7'])
    df_all['sum_others_minus_after_pulse'] = sum(all_after_pulse[2:]) - df_all['sum_others']
    df_all['Norm_factor (t)'] = all_after_pulse[1] + df_all['sum_others_minus_after_pulse']
    
    df_all['P(t) Tot'] = -(np.cumsum(df_all['Abs Tot'])*AU_dt)
    df_all['P(t) S0'] =  -(np.cumsum(df_all['Abs S0'])*AU_dt)
    df_all['P(t) S1'] =  -(np.cumsum(df_all['Abs S1'])*AU_dt)
    df_all['P(t) S2'] =  -(np.cumsum(df_all['Abs S2'])*AU_dt)
    df_all['P(t) S3'] =  -(np.cumsum(df_all['Abs S3'])*AU_dt)
    df_all['P(t) S4'] =  -(np.cumsum(df_all['Abs S4'])*AU_dt)
    df_all['P(t) S5'] =  -(np.cumsum(df_all['Abs S5'])*AU_dt)
    df_all['P(t) S6'] =  -(np.cumsum(df_all['Abs S6'])*AU_dt)
    df_all['P(t) S7'] =  -(np.cumsum(df_all['Abs S7'])*AU_dt)
    
    df_all['AU_dt'] = AU_dt
    
    df_all['Products_F']  = df_all['Products']  + df_all['P(t) S0']
    #df_all['Reactants_F'] = df_all['Reactants'] + df_all['FC after pulse']
    df_all['Reactants_F'] = df_all['Reactants']
    
#     df_all['Real Reactants'] = df_regi['Reactants'] + df_regi['FC after pulse']
#     df_all['Real Products'] = df_regi['Products'] + df_abso['Norm S0']
#     df_all['Real ratio'] = df_all['Real Products']/df_all['Real Reactants']
    
    df_all.to_csv(csv_name)
    
    #df_all.plot('fs',['Reactants','Products'])
    #df_all.plot('fs','ratio')
    #df_all.plot('fs',['Real Reactants','Real Products'])
    #return(df_all[['fs','Norm_factor (t)','sum_others_minus_after_pulse','sum_others']])
    #return(df_all[['Norm Tot','fs','ratio','Real Products','Real Reactants','Abs S0','Norm S0', 'Products', 'Reactants','Real ratio','S1','S2','S3','S0','S4','S5','S6','S7','Xpulse','Ypulse','Norm_factor (t)','sum_others_minus_after_pulse','sum_others','Norm deviation','Absorbed Normalized','FC after pulse']])
    return(df_all)
    
number = 3

a = create_df_from_files_given_name('m-only_IR_middle140_0000',fol,26)

# a = create_df_from_files_given_name('z-from_S1_without_pulse_0000',fol,0)
# b = create_df_from_files_given_name('b-pulseAlongX_0.22_goodG_0000',fol,15)
# c = create_df_from_files_given_name('m-only_IR_longer_with_nac_2_1_0000',fol,15)
# d = create_df_from_files_given_name('m-only_IR_longer_with_nac_2_1_counterClock_0000',fol,15)
# e = create_df_from_files_given_name('m-only_IR_longer_with_nac_2_1_inverted_phase_0000',fol,15)
# f = create_df_from_files_given_name('m-only_IR_longer_with_nac_2_1_phase_pi_0000',fol,15)
# g = create_df_from_files_given_name('m-only_IR_short_with_nac_2_1_0000',fol,15)
# h = create_df_from_files_given_name('m-only_IR_short_with_nac_2_1_inverted_phase_0000',fol,15)
# i = create_df_from_files_given_name('m-only_IR_short_with_nac_2_1_phase_pi_0000',fol,15)
# l = create_df_from_files_given_name('b-pulseAlongX_0.22_short_0_goodG_0000',fol,15)
# m = create_df_from_files_given_name('b-pulseAlongX_0.22_short_pi_goodG_0000',fol,15)
# z2 = create_df_from_files_given_name('z-from_S2_without_pulse_0000',fol,0)   # <- need to do regions and abs file

qp.warning('Watch out you are putting the time (fs) of END_pulse MANUALLY')


2.0671 #steps 1091 - End pulse 10.01 - S1: 9.35392E-04 - S2: 1.15244E-04 - S3: 1.97293E-04 - S4: 3.12872E-05 m-only_IR_middle140_0000


*******************************************************************
*                                                                 *
*  Watch out you are putting the time (fs) of END_pulse MANUALLY  *
*                                                                 *
*******************************************************************




In [6]:
colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k', 'mediumpurple']

In [7]:
a


Out[7]:
counter steps fs Norm deviation Kinetic Potential Total Total Deviation Xpulse Ypulse ... P(t) S1 P(t) S2 P(t) S3 P(t) S4 P(t) S5 P(t) S6 P(t) S7 AU_dt Products_F Reactants_F
0 0 0.000000 3.330669e-16 0.091654 0.091279 0.182933 0.000000e+00 6.018470e-07 -3.471030e-06 0.0 ... -0.000000e+00 -0.000000e+00 -0.000000e+00 -0.000000e+00 -0.000000e+00 -0.000000e+00 -0.000000e+00 2.0671 2.203941e-65 1.284465e-34
1 100 0.050050 1.741657e-08 0.091655 0.091278 0.182933 7.449894e-09 1.788736e-07 -3.750248e-06 0.0 ... 4.225028e-85 4.284416e-80 1.076033e-78 8.708796e-79 3.407201e-79 9.412995e-79 6.964804e-79 2.0671 3.190958e-64 1.852640e-28
2 200 0.100100 6.966591e-08 0.091659 0.091274 0.182933 2.999711e-08 -3.052015e-07 -3.988908e-06 0.0 ... 6.500204e-80 4.733425e-78 1.475168e-76 1.580910e-74 2.352694e-73 2.509676e-73 4.209015e-73 2.0671 4.202142e-63 2.832082e-27
3 300 0.150150 1.567469e-07 0.091665 0.091268 0.182933 6.764404e-08 -8.483128e-07 -4.176538e-06 0.0 ... 6.526580e-73 3.448031e-72 2.889283e-71 3.222769e-69 5.404994e-68 3.994096e-68 1.411592e-67 2.0671 1.944103e-62 1.364481e-26
4 400 0.200200 2.786577e-07 0.091673 0.091260 0.182933 1.203961e-07 -1.446858e-06 -4.302373e-06 0.0 ... 6.770394e-66 3.470020e-65 1.694861e-64 7.385524e-63 2.429633e-62 4.420270e-62 9.934727e-63 2.0671 5.466042e-62 4.031901e-26
5 500 0.250250 4.353958e-07 0.091683 0.091249 0.182933 1.882638e-07 -2.095578e-06 -4.355556e-06 0.0 ... 2.285298e-62 1.702558e-61 1.091462e-60 2.317462e-59 7.600655e-59 1.903757e-58 2.119890e-58 2.0671 1.143680e-61 9.012964e-26
6 600 0.300301 6.269577e-07 0.091696 0.091236 0.182933 2.712636e-07 -2.787452e-06 -4.325354e-06 0.0 ... 3.070089e-59 1.782592e-58 2.172291e-57 3.350792e-56 1.077374e-55 2.669682e-55 2.855917e-55 2.0671 1.752891e-60 1.672060e-25
7 700 0.350351 8.533396e-07 0.091712 0.091221 0.182933 3.694163e-07 -3.513625e-06 -4.201413e-06 0.0 ... 6.152314e-57 5.940274e-56 9.427049e-55 6.537059e-54 1.728447e-53 6.441136e-53 1.066751e-52 2.0671 3.068182e-58 2.702351e-25
8 800 0.400401 1.114537e-06 0.091729 0.091203 0.182932 4.827432e-07 -4.263360e-06 -3.974025e-06 0.0 ... 1.283119e-55 3.103042e-54 3.084806e-53 9.888620e-53 2.383401e-52 2.071706e-51 5.527748e-51 2.0671 1.601605e-56 3.916653e-25
9 900 0.450451 1.410543e-06 0.091749 0.091183 0.182932 6.112599e-07 -5.024028e-06 -3.634422e-06 0.0 ... 1.308913e-54 5.538744e-53 6.763889e-52 1.160090e-51 2.483976e-51 3.276091e-50 1.025376e-49 2.0671 2.704230e-55 5.198851e-25
10 1000 0.500501 1.741354e-06 0.091771 0.091161 0.182932 7.549706e-07 -5.781139e-06 -3.175084e-06 0.0 ... 1.203693e-53 7.745460e-52 9.928150e-51 2.758424e-50 4.043841e-50 4.696322e-49 1.349848e-48 2.0671 2.822435e-54 6.463272e-25
11 1100 0.550551 2.106961e-06 0.091795 0.091137 0.182932 9.138629e-07 -6.518413e-06 -2.590061e-06 0.0 ... 9.086807e-53 1.390131e-50 1.527710e-49 3.596411e-49 4.047028e-49 3.413162e-48 7.542363e-48 2.0671 4.251556e-53 7.799821e-25
12 1200 0.600601 2.507358e-06 0.091822 0.091110 0.182932 1.087907e-06 -7.217906e-06 -1.875296e-06 0.0 ... 5.795388e-52 1.015160e-49 7.796893e-49 1.361757e-48 1.674921e-48 1.022384e-47 2.228761e-47 2.0671 2.979377e-52 9.723879e-25
13 1300 0.650651 2.942535e-06 0.091851 0.091081 0.182932 1.277058e-06 -7.860181e-06 -1.028958e-06 0.0 ... 3.736931e-51 3.470626e-49 2.141050e-48 3.450954e-48 5.608096e-48 2.107560e-47 6.435495e-47 2.0671 1.364757e-51 1.356755e-24
14 1400 0.700701 3.412485e-06 0.091881 0.091050 0.182931 1.481265e-06 -8.424537e-06 -5.175600e-08 0.0 ... 1.228474e-50 1.011898e-48 5.551807e-48 1.264852e-47 2.373311e-47 7.470775e-47 1.893471e-46 2.0671 5.574475e-51 2.205459e-24
15 1500 0.750751 3.917198e-06 0.091914 0.091017 0.182931 1.700480e-06 -8.889290e-06 1.052757e-06 0.0 ... 3.149234e-50 2.133812e-48 1.227763e-47 3.292937e-47 8.716331e-47 2.577517e-46 7.325500e-46 2.0671 1.642432e-50 4.010658e-24
16 1600 0.800801 4.456665e-06 0.091950 0.090981 0.182931 1.934665e-06 -9.232117e-06 2.277901e-06 0.0 ... 6.227270e-50 3.962141e-48 3.268307e-47 6.417586e-47 2.611916e-46 8.584675e-46 2.289738e-45 2.0671 3.613977e-50 7.593187e-24
17 1700 0.850852 5.030873e-06 0.091987 0.090944 0.182931 2.183795e-06 -9.430445e-06 3.613625e-06 0.0 ... 1.245792e-49 1.114720e-47 1.256021e-46 1.994717e-46 9.350414e-46 2.731091e-45 5.611464e-45 2.0671 1.103872e-49 1.424515e-23
18 1800 0.900902 5.639813e-06 0.092026 0.090904 0.182930 2.447859e-06 -9.461909e-06 5.046301e-06 0.0 ... 4.523386e-49 4.919444e-47 3.510648e-46 6.739125e-46 2.845658e-45 6.027950e-45 1.484402e-44 2.0671 1.078396e-48 2.591168e-23
19 1900 0.950952 6.283472e-06 0.092067 0.090863 0.182930 2.726853e-06 -9.304844e-06 6.558571e-06 0.0 ... 1.643313e-48 1.286054e-46 6.770775e-46 1.640654e-45 7.272104e-45 1.333769e-44 3.244106e-44 2.0671 1.484988e-47 4.541707e-23
20 2000 1.001002 6.961839e-06 0.092111 0.090819 0.182930 3.020775e-06 -8.938836e-06 8.129259e-06 0.0 ... 4.466868e-48 3.067526e-46 1.549973e-45 3.900697e-45 1.590638e-44 2.772500e-44 6.207562e-44 2.0671 2.054616e-46 7.674006e-23
21 2100 1.051052 7.674900e-06 0.092156 0.090774 0.182930 3.329613e-06 -8.345306e-06 9.733345e-06 0.0 ... 7.895567e-48 6.377305e-46 2.989807e-45 8.373757e-45 3.164478e-44 5.229889e-44 1.166431e-43 2.0671 2.508672e-45 1.253424e-22
22 2200 1.101102 8.422643e-06 0.092203 0.090726 0.182929 3.653355e-06 -7.508126e-06 1.134203e-05 0.0 ... 1.177773e-47 1.089987e-45 4.507842e-45 1.652780e-44 5.818594e-44 9.758926e-44 2.028441e-43 2.0671 2.652802e-44 1.985536e-22
23 2300 1.151152 9.205054e-06 0.092252 0.090677 0.182929 3.991987e-06 -6.414262e-06 1.292289e-05 0.0 ... 1.638157e-47 1.573108e-45 6.671703e-45 3.109792e-44 1.009203e-43 1.677545e-43 3.384746e-43 2.0671 2.465160e-43 3.060143e-22
24 2400 1.201202 1.002212e-05 0.092302 0.090626 0.182929 4.345512e-06 -5.054416e-06 1.444011e-05 0.0 ... 2.153506e-47 2.053291e-45 9.479114e-45 5.304370e-44 1.680635e-43 2.785062e-43 5.332417e-43 2.0671 2.043470e-42 4.601763e-22
25 2500 1.251252 1.087382e-05 0.092355 0.090573 0.182928 4.713964e-06 -3.423682e-06 1.585481e-05 0.0 ... 3.152264e-47 2.833665e-45 1.368326e-44 8.515776e-44 2.661730e-43 4.374430e-43 8.340048e-43 2.0671 1.529029e-41 6.768564e-22
26 2600 1.301302 1.176015e-05 0.092409 0.090519 0.182928 5.097417e-06 -1.522169e-06 1.712556e-05 0.0 ... 4.504793e-47 4.313663e-45 2.418730e-44 1.298619e-43 4.026175e-43 6.747316e-43 1.289691e-42 2.0671 1.042802e-40 9.758331e-22
27 2700 1.351352 1.268109e-05 0.092465 0.090463 0.182927 5.495992e-06 6.443932e-07 1.820887e-05 0.0 ... 6.063264e-47 6.498236e-45 3.697667e-44 1.899531e-43 5.920186e-43 1.054869e-42 1.916239e-42 2.0671 6.534573e-40 1.381479e-21
28 2800 1.401403 1.363662e-05 0.092522 0.090405 0.182927 5.909848e-06 3.064111e-06 1.905990e-05 0.0 ... 8.241740e-47 8.964844e-45 5.014571e-44 2.738290e-43 8.542799e-43 1.602047e-42 2.835803e-42 2.0671 3.785948e-39 1.923422e-21
29 2900 1.451453 1.462673e-05 0.092581 0.090346 0.182927 6.339165e-06 5.718439e-06 1.963322e-05 0.0 ... 1.148760e-46 1.157187e-44 7.513467e-44 3.855613e-43 1.229636e-42 2.407555e-42 4.143996e-42 2.0671 2.036949e-38 2.637241e-21
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
1061 106100 53.103146 1.595175e-02 -0.079526 3.856619 3.777093 -3.594160e+00 2.297065e-30 -3.929639e-30 0.0 ... 9.753430e-03 3.300565e-03 2.562915e-03 2.199210e-03 2.129523e-03 1.602612e-03 2.218210e-03 2.0671 1.625786e-03 1.038141e-04
1062 106200 53.153196 1.598347e-02 -0.079414 3.855957 3.776543 -3.593611e+00 1.516578e-30 -3.538049e-30 0.0 ... 9.773670e-03 3.308212e-03 2.569047e-03 2.205386e-03 2.135087e-03 1.605849e-03 2.222558e-03 2.0671 1.628585e-03 1.043723e-04
1063 106300 53.203246 1.601515e-02 -0.079340 3.855335 3.775995 -3.593062e+00 9.023673e-31 -3.127094e-30 0.0 ... 9.793833e-03 3.315861e-03 2.575180e-03 2.211559e-03 2.140651e-03 1.609079e-03 2.226901e-03 2.0671 1.631370e-03 1.049503e-04
1064 106400 53.253296 1.604679e-02 -0.079296 3.854743 3.775447 -3.592514e+00 4.299265e-31 -2.717462e-30 0.0 ... 9.813919e-03 3.323512e-03 2.581315e-03 2.217729e-03 2.146213e-03 1.612301e-03 2.231239e-03 2.0671 1.634148e-03 1.055322e-04
1065 106500 53.303346 1.607837e-02 -0.079270 3.854169 3.774900 -3.591967e+00 7.644839e-32 -2.323940e-30 0.0 ... 9.833933e-03 3.331165e-03 2.587450e-03 2.223896e-03 2.151774e-03 1.615517e-03 2.235571e-03 2.0671 1.636919e-03 1.061030e-04
1066 106600 53.353396 1.610989e-02 -0.079250 3.853603 3.774353 -3.591420e+00 -1.788136e-31 -1.956532e-30 0.0 ... 9.853874e-03 3.338821e-03 2.593587e-03 2.230059e-03 2.157335e-03 1.618726e-03 2.239899e-03 2.0671 1.639678e-03 1.066516e-04
1067 106700 53.403446 1.614134e-02 -0.079217 3.853024 3.773807 -3.590874e+00 -3.543605e-31 -1.621437e-30 0.0 ... 9.873746e-03 3.346479e-03 2.599725e-03 2.236218e-03 2.162895e-03 1.621928e-03 2.244223e-03 2.0671 1.642415e-03 1.071735e-04
1068 106800 53.453496 1.617273e-02 -0.079148 3.852409 3.773262 -3.590329e+00 -4.663980e-31 -1.321901e-30 0.0 ... 9.893551e-03 3.354141e-03 2.605864e-03 2.242373e-03 2.168453e-03 1.625123e-03 2.248542e-03 2.0671 1.645117e-03 1.076710e-04
1069 106900 53.503547 1.620407e-02 -0.079025 3.851742 3.772717 -3.589784e+00 -5.288854e-31 -1.058923e-30 0.0 ... 9.913290e-03 3.361807e-03 2.612003e-03 2.248524e-03 2.174011e-03 1.628310e-03 2.252857e-03 2.0671 1.647774e-03 1.081520e-04
1070 107000 53.553597 1.623535e-02 -0.078857 3.851030 3.772173 -3.589240e+00 -5.536537e-31 -8.318609e-31 0.0 ... 9.932966e-03 3.369477e-03 2.618143e-03 2.254671e-03 2.179567e-03 1.631490e-03 2.257168e-03 2.0671 1.650377e-03 1.086274e-04
1071 107100 53.603647 1.626658e-02 -0.078674 3.850303 3.771630 -3.588697e+00 -5.505697e-31 -6.389175e-31 0.0 ... 9.952581e-03 3.377152e-03 2.624284e-03 2.260813e-03 2.185121e-03 1.634662e-03 2.261476e-03 2.0671 1.652927e-03 1.091070e-04
1072 107200 53.653697 1.629778e-02 -0.078520 3.849607 3.771087 -3.588154e+00 -5.277259e-31 -4.775354e-31 0.0 ... 9.972137e-03 3.384832e-03 2.630426e-03 2.266950e-03 2.190674e-03 1.637826e-03 2.265781e-03 2.0671 1.655433e-03 1.095967e-04
1073 107300 53.703747 1.632894e-02 -0.078434 3.848979 3.770545 -3.587612e+00 -4.916434e-31 -3.447087e-31 0.0 ... 9.991636e-03 3.392516e-03 2.636568e-03 2.273081e-03 2.196224e-03 1.640983e-03 2.270082e-03 2.0671 1.657907e-03 1.100963e-04
1074 107400 53.753797 1.636005e-02 -0.078432 3.848435 3.770003 -3.587070e+00 -4.474755e-31 -2.372222e-31 0.0 ... 1.001108e-02 3.400206e-03 2.642712e-03 2.279208e-03 2.201773e-03 1.644131e-03 2.274381e-03 2.0671 1.660368e-03 1.105996e-04
1075 107500 53.803847 1.639111e-02 -0.078505 3.847967 3.769462 -3.586529e+00 -3.992041e-31 -1.518312e-31 0.0 ... 1.003047e-02 3.407902e-03 2.648857e-03 2.285329e-03 2.207319e-03 1.647272e-03 2.278677e-03 2.0671 1.662829e-03 1.110962e-04
1076 107600 53.853897 1.642210e-02 -0.078638 3.847560 3.768922 -3.585989e+00 -3.498252e-31 -8.539136e-32 0.0 ... 1.004981e-02 3.415603e-03 2.655004e-03 2.291444e-03 2.212863e-03 1.650406e-03 2.282970e-03 2.0671 1.665301e-03 1.115749e-04
1077 107700 53.903947 1.645303e-02 -0.078810 3.847193 3.768382 -3.585449e+00 -3.015176e-31 -3.494777e-32 0.0 ... 1.006910e-02 3.423310e-03 2.661152e-03 2.297554e-03 2.218404e-03 1.653531e-03 2.287259e-03 2.0671 1.667786e-03 1.120270e-04
1078 107800 53.953997 1.648388e-02 -0.079000 3.846843 3.767844 -3.584911e+00 -2.557947e-31 2.208277e-33 0.0 ... 1.008834e-02 3.431024e-03 2.667303e-03 2.303659e-03 2.223943e-03 1.656649e-03 2.291545e-03 2.0671 1.670279e-03 1.124492e-04
1079 107900 54.004047 1.651466e-02 -0.079189 3.846495 3.767305 -3.584372e+00 -2.136375e-31 2.850792e-32 0.0 ... 1.010754e-02 3.438744e-03 2.673457e-03 2.309757e-03 2.229479e-03 1.659759e-03 2.295828e-03 2.0671 1.672771e-03 1.128445e-04
1080 108000 54.054098 1.654538e-02 -0.079378 3.846145 3.766768 -3.583835e+00 -1.756108e-31 4.609272e-32 0.0 ... 1.012669e-02 3.446470e-03 2.679612e-03 2.315851e-03 2.235014e-03 1.662862e-03 2.300107e-03 2.0671 1.675252e-03 1.132213e-04
1081 108100 54.104148 1.657604e-02 -0.079573 3.845804 3.766231 -3.583298e+00 -1.419605e-31 5.681695e-32 0.0 ... 1.014580e-02 3.454203e-03 2.685770e-03 2.321938e-03 2.240546e-03 1.665957e-03 2.304382e-03 2.0671 1.677718e-03 1.135910e-04
1082 108200 54.154198 1.660665e-02 -0.079775 3.845469 3.765694 -3.582761e+00 -1.126962e-31 6.226004e-32 0.0 ... 1.016487e-02 3.461943e-03 2.691931e-03 2.328020e-03 2.246075e-03 1.669046e-03 2.308653e-03 2.0671 1.680171e-03 1.139648e-04
1083 108300 54.204248 1.663722e-02 -0.079972 3.845130 3.765158 -3.582225e+00 -8.765842e-32 6.374585e-32 0.0 ... 1.018390e-02 3.469690e-03 2.698094e-03 2.334095e-03 2.251603e-03 1.672128e-03 2.312919e-03 2.0671 1.682620e-03 1.143506e-04
1084 108400 54.254298 1.666776e-02 -0.080146 3.844768 3.764622 -3.581689e+00 -6.657358e-32 6.236602e-32 0.0 ... 1.020289e-02 3.477443e-03 2.704260e-03 2.340165e-03 2.257129e-03 1.675204e-03 2.317181e-03 2.0671 1.685080e-03 1.147509e-04
1085 108500 54.304348 1.669827e-02 -0.080281 3.844367 3.764086 -3.581153e+00 -4.909689e-32 5.900546e-32 0.0 ... 1.022184e-02 3.485202e-03 2.710428e-03 2.346228e-03 2.262654e-03 1.678275e-03 2.321439e-03 2.0671 1.687570e-03 1.151624e-04
1086 108600 54.354398 1.672877e-02 -0.080364 3.843914 3.763550 -3.580617e+00 -3.484611e-32 5.436832e-32 0.0 ... 1.024075e-02 3.492968e-03 2.716598e-03 2.352285e-03 2.268177e-03 1.681341e-03 2.325692e-03 2.0671 1.690104e-03 1.155776e-04
1087 108700 54.404448 1.675926e-02 -0.080394 3.843408 3.763014 -3.580081e+00 -2.342680e-32 4.900337e-32 0.0 ... 1.025963e-02 3.500741e-03 2.722771e-03 2.358335e-03 2.273699e-03 1.684401e-03 2.329939e-03 2.0671 1.692694e-03 1.159867e-04
1088 108800 54.454498 1.678973e-02 -0.080386 3.842865 3.762479 -3.579546e+00 -1.445092e-32 4.332799e-32 0.0 ... 1.027847e-02 3.508520e-03 2.728947e-03 2.364378e-03 2.279221e-03 1.687456e-03 2.334182e-03 2.0671 1.695343e-03 1.163810e-04
1089 108900 54.504548 1.682019e-02 -0.080365 3.842308 3.761943 -3.579010e+00 -7.549715e-33 3.765022e-32 0.0 ... 1.029728e-02 3.516306e-03 2.735124e-03 2.370413e-03 2.284742e-03 1.690507e-03 2.338419e-03 2.0671 1.698049e-03 1.167547e-04
1090 109000 54.554598 1.685063e-02 -0.080354 3.841761 3.761408 -3.578475e+00 -2.382231e-33 3.218866e-32 0.0 ... 1.031605e-02 3.524098e-03 2.741303e-03 2.376441e-03 2.290263e-03 1.693552e-03 2.342651e-03 2.0671 1.700805e-03 1.171068e-04

1091 rows × 49 columns

UV vs FC


In [5]:
fig, [[ax0, ax1],[ax2,ax3],[ax4,ax5],[ax6,ax7]] = plt.subplots(4,2,figsize=(15,16))

ax0.plot(a['fs'].iloc[:,1]+10,  a['Products'] , label='FC Products',  ls='--', color=colors[0])
ax0.plot(a['fs'].iloc[:,1]+10,  a['Reactants'], label='FC Reactants', color=colors[0])
ax0.plot(a['fs'].iloc[:,1]+10,  a['FC after pulse'],   label='FC FC', ls=':', lw=0.5, color=colors[0])

ax0.plot(b['fs'].iloc[:,1],     b['Products'] , label='UV Products',  ls='--', color=colors[1])
ax0.plot(b['fs'].iloc[:,1],     b['Reactants'], label='UV Reactants', color=colors[1])
ax0.plot(b['fs'].iloc[:,1],     b['FC after pulse'], label='UV FC', ls=':', lw=0.5, color=colors[1])
ax0.set_xlabel('fs')
ax0.set_title('Regions only - Products Reactants')
ax0.legend()

ax2.plot(a['fs'].iloc[:,1]+10,  a['Abs S0'], label=r'FC dP(dt) $S_0$', color=colors[0])
ax2.plot(b['fs'].iloc[:,1],     b['Abs S0'], label=r'UV dP(dt) $S_0$', color=colors[1])
ax2.set_title('Absorbing potential - dP(dt)')
ax2.legend()

ax4.plot(a['fs'].iloc[:,1]+10,  a['P(t) S0'],   label=r'FC P(t) $S_0$', color=colors[0])
ax4.plot(b['fs'].iloc[:,1],     b['P(t) S0'],   label=r'UV P(t) $S_0$', color=colors[1])
ax4.set_title(r'P(t) - $S_0$ absorbed')
ax4.legend()

ax6.plot(a['fs'].iloc[:,1]+10,  a['Products_F'] , label='FC Products',  ls='--', color=colors[0])
ax6.plot(a['fs'].iloc[:,1]+10,  a['Reactants_F'],   label='FC Reactants', color=colors[0])
ax6.plot(b['fs'].iloc[:,1],     b['Products_F'] , label='UV Products',  ls='--', color=colors[1])
ax6.plot(b['fs'].iloc[:,1],     b['Reactants_F'],   label='UV Reactants', color=colors[1])
ax6.set_xlabel('fs')
ax6.set_title('Products Reactants - Final graph')
ax6.legend()

# right part, normalized ones

ax1.plot(a['fs'].iloc[:,1]+10,  a['Products']/a['Norm_factor (t)'], label='FC Products',  ls='--', color=colors[0])
ax1.plot(a['fs'].iloc[:,1]+10,  a['Reactants']/a['Norm_factor (t)'], label='FC Reactants', color=colors[0])
ax1.plot(a['fs'].iloc[:,1]+10,  a['FC after pulse']/a['Norm_factor (t)'],   label='FC FC', ls=':', lw=0.5, color=colors[0])

ax1.plot(b['fs'].iloc[:,1],     b['Products']/b['Norm_factor (t)'], label='UV Products',  ls='--', color=colors[1])
ax1.plot(b['fs'].iloc[:,1],     b['Reactants']/b['Norm_factor (t)'], label='UV Reactants', color=colors[1])
ax1.plot(b['fs'].iloc[:,1],     b['FC after pulse']/b['Norm_factor (t)'], label='UV FC', ls=':', lw=0.5, color=colors[1])

ax1.set_xlabel('fs')
ax1.set_title('Regions only - Products Reactants - Normalized')
ax1.legend()

ax3.plot(a['fs'].iloc[:,1]+10,  a['Abs S0']/a['Norm_factor (t)'], label=r'FC dP(dt) $S_0$', color=colors[0])
ax3.plot(b['fs'].iloc[:,1],     b['Abs S0']/b['Norm_factor (t)'], label=r'UV dP(dt) $S_0$', color=colors[1])
ax3.set_title('Absorbing potential - dP(dt) - Normalized')
ax3.legend()

ax5.plot(a['fs'].iloc[:,1]+10,  a['P(t) S0']/a['Norm_factor (t)'],   label=r'FC P(t) $S_0$', color=colors[0])
ax5.plot(b['fs'].iloc[:,1],     b['P(t) S0']/b['Norm_factor (t)'],   label=r'UV P(t) $S_0$', color=colors[1])
ax5.set_title(r'P(t) - $S_0$ absorbed - Normalized')
ax5.legend()

ax7.plot(a['fs'].iloc[:,1]+10,  a['Products_F']/a['Norm_factor (t)'], label='FC Products',  ls='--', color=colors[0])
ax7.plot(a['fs'].iloc[:,1]+10,  a['Reactants_F']/a['Norm_factor (t)'],   label='FC Reactants', color=colors[0])
ax7.plot(b['fs'].iloc[:,1],     b['Products_F']/b['Norm_factor (t)'], label='UV Products',  ls='--', color=colors[1])
ax7.plot(b['fs'].iloc[:,1],     b['Reactants_F']/b['Norm_factor (t)'],   label='UV Reactants', color=colors[1])
ax7.set_xlabel('fs')
ax7.set_title('Products Reactants - Final graph - Normalized')
ax7.legend()

fig.tight_layout();



In [122]:
fig, [ax0, ax1] = plt.subplots(1,2,figsize=(15,4))

ax0.plot(b['fs'].iloc[:,1], b['S0'], label=r'$S_0$', color=colors[0])
ax0.plot(b['fs'].iloc[:,1], b['S1'], label=r'$S_1$', color=colors[1])
ax0.plot(b['fs'].iloc[:,1], b['S2'], label=r'$S_2$', color=colors[2])
ax0.plot(b['fs'].iloc[:,1], b['S3'], label=r'$S_3$', color=colors[3])
ax0.plot(b['fs'].iloc[:,1], b['S4'], label=r'$S_4$', color=colors[4])
ax0.plot(b['fs'].iloc[:,1], b['S5'], label=r'$S_5$', color=colors[5])
ax0.plot(b['fs'].iloc[:,1], b['S6'], label=r'$S_6$', color=colors[6])
ax0.plot(b['fs'].iloc[:,1], b['S7'], label=r'$S_7$', color=colors[7])
ax00 = ax0.twinx()
ax00.plot(b['fs'].iloc[:,1], b['Xpulse'], label='X_pulse', ls='--', lw=.5)
#ax00.plot(b['fs'].iloc[:,1], b['Ypulse'], label='Y_pulse', ls='--', lw=.5)
ax0.set_title('UV populations')
ax0.set_ylabel('Populations')
ax0.set_xlabel('fs')
ax0.legend()

ax1.plot(a['fs'].iloc[:,1], a['S0'], label=r'$S_0$', color=colors[0])
ax1.plot(a['fs'].iloc[:,1], a['S1'], label=r'$S_1$', color=colors[1])
ax1.plot(a['fs'].iloc[:,1], a['S2'], label=r'$S_2$', color=colors[2])
ax1.plot(a['fs'].iloc[:,1], a['S3'], label=r'$S_3$', color=colors[3])
ax1.plot(a['fs'].iloc[:,1], a['S4'], label=r'$S_4$', color=colors[4])
ax1.plot(a['fs'].iloc[:,1], a['S5'], label=r'$S_5$', color=colors[5])
ax1.plot(a['fs'].iloc[:,1], a['S6'], label=r'$S_6$', color=colors[6])
ax1.plot(a['fs'].iloc[:,1], a['S7'], label=r'$S_7$', color=colors[7])
ax1.set_title('FC populations')
ax1.set_ylabel('Populations')
ax1.set_xlabel('fs')
ax1.legend()

fig.tight_layout();


IR ones


In [8]:
fig, [[ax0, ax1],[ax2,ax3],[ax4,ax5],[ax6,ax7]] = plt.subplots(4,2,figsize=(15,16))

# labelz = ['norm','count','inv','pi']
# runs = [c,d,e,f]

labelz = ['norm']
runs = [a]
for ind,i in enumerate(runs):
    ax0.plot(i['fs'].iloc[:,1],  i['Products']    , label='{} Products'.format(labelz[ind]) , ls='--', color=colors[ind])
    ax0.plot(i['fs'].iloc[:,1],  i['Reactants']   , label='{} Reactants'.format(labelz[ind]),          color=colors[ind])
    #ax0.plot(i['fs'].iloc[:,1],  i['FC after pulse'], label='{} FC'.format(labelz[ind])       , ls=':', lw=0.5,  color=colors[ind])
    ax1.plot(i['fs'].iloc[:,1],  i['Products'] /i['Norm_factor (t)']    , label='{} Products'.format(labelz[ind]) , ls='--', color=colors[ind])
    ax1.plot(i['fs'].iloc[:,1],  i['Reactants']/i['Norm_factor (t)']    , label='{} Reactants'.format(labelz[ind]),          color=colors[ind])
    #ax1.plot(i['fs'].iloc[:,1],  i['FC after pulse']/i['Norm_factor (t)'], label='{} FC'.format(labelz[ind])       , ls=':', lw=0.5,  color=colors[ind])

ax0.set_xlabel('fs')
ax0.set_title('Regions only - Products Reactants')
ax0.legend()
ax1.set_xlabel('fs')
ax1.set_title('Regions only - Products Reactants - Normalized')
ax1.legend()

for ind,i in enumerate(runs):
    ax2.plot(i['fs'].iloc[:,1],     i['Abs S0'], label=r'{} dP(dt) $S_0$'.format(labelz[ind]), color=colors[ind])
    ax3.plot(i['fs'].iloc[:,1],     i['Abs S0']/i['Norm_factor (t)'], label=r'{} dP(dt) $S_0$'.format(labelz[ind]), color=colors[ind])

ax2.set_title('Absorbing potential - dP(dt)')
ax2.legend()
ax3.set_title('Absorbing potential - dP(dt) - Normalized')
ax3.legend()


for ind,i in enumerate(runs):
    ax4.plot(i['fs'].iloc[:,1],     i['P(t) S0'], label=r'{} P(t) $S_0$'.format(labelz[ind]), color=colors[ind])
    ax5.plot(i['fs'].iloc[:,1],     i['P(t) S0']/i['Norm_factor (t)'], label=r'{} P(t) $S_0$'.format(labelz[ind]), color=colors[ind])
    
ax4.set_title(r'P(t) - $S_0$ absorbed')
ax4.legend()
ax5.set_title(r'P(t) - $S_0$ absorbed - Normalized')
ax5.legend()

for ind,i in enumerate(runs):
    ax6.plot(i['fs'].iloc[:,1],     i['Products_F'] ,   label='{} Products'.format(labelz[ind]),  ls='--', color=colors[ind])
    ax6.plot(i['fs'].iloc[:,1],     i['Reactants_F'],   label='{} Reactants'.format(labelz[ind]), color=colors[ind])
    ax7.plot(i['fs'].iloc[:,1],     i['Products_F'] /i['Norm_factor (t)'],   label='{} Products'.format(labelz[ind]),  ls='--', color=colors[ind])
    ax7.plot(i['fs'].iloc[:,1],     i['Reactants_F']/i['Norm_factor (t)'],   label='{} Reactants'.format(labelz[ind]), color=colors[ind])

ax6.set_xlabel('fs')
ax6.set_title('Products Reactants - Final graph')
ax6.legend()
ax7.set_xlabel('fs')
ax7.set_title('Products Reactants - Final graph - Normalized')
ax7.legend()


fig.tight_layout();



In [26]:
fig, [[ax5,ax6],[ax4,ax7]] = plt.subplots(2,2,figsize=(15,8))

ax5.plot(c['fs'].iloc[:,1], c['S0'], label=r'$S_0$', color=colors[0])
ax5.plot(c['fs'].iloc[:,1], c['S1'], label=r'$S_1$', color=colors[1])
ax5.plot(c['fs'].iloc[:,1], c['S2'], label=r'$S_2$', color=colors[2])
ax5.plot(c['fs'].iloc[:,1], c['S3'], label=r'$S_3$', color=colors[3])
ax5.plot(c['fs'].iloc[:,1], c['S4'], label=r'$S_4$', color=colors[4])
ax5.plot(c['fs'].iloc[:,1], c['S5'], label=r'$S_5$', color=colors[5])
ax5.plot(c['fs'].iloc[:,1], c['S6'], label=r'$S_6$', color=colors[6])
ax5.plot(c['fs'].iloc[:,1], c['S7'], label=r'$S_7$', color=colors[7])

ax55 = ax5.twinx()
ax55.plot(c['fs'].iloc[:,1], c['Xpulse'], label='X_pulse', ls='--', lw=.5)
ax55.plot(c['fs'].iloc[:,1], c['Ypulse'], label='Y_pulse', ls='--', lw=.5)
ax5.set_title('Populations CounterClock')
ax5.set_xlim(0,50)
ax5.legend()

ax6.plot(d['fs'].iloc[:,1], d['S0'], label=r'$S_0$', color=colors[0])
ax6.plot(d['fs'].iloc[:,1], d['S1'], label=r'$S_1$', color=colors[1])
ax6.plot(d['fs'].iloc[:,1], d['S2'], label=r'$S_2$', color=colors[2])
ax6.plot(d['fs'].iloc[:,1], d['S3'], label=r'$S_3$', color=colors[3])
ax6.plot(d['fs'].iloc[:,1], d['S4'], label=r'$S_4$', color=colors[4])
ax6.plot(d['fs'].iloc[:,1], d['S5'], label=r'$S_5$', color=colors[5])
ax6.plot(d['fs'].iloc[:,1], d['S6'], label=r'$S_6$', color=colors[6])
ax6.plot(d['fs'].iloc[:,1], d['S7'], label=r'$S_7$', color=colors[7])

ax66 = ax6.twinx()
ax66.plot(d['fs'].iloc[:,1], d['Xpulse'], label='X_pulse', ls='--', lw=.5)
ax66.plot(d['fs'].iloc[:,1], d['Ypulse'], label='Y_pulse', ls='--', lw=.5)
ax6.set_title('Populations Norm')
#ax5.set_ylim(0,0.3)
ax6.set_xlim(0,50)
ax6.legend()

ax4.plot(e['fs'].iloc[:,1], e['S0'], label=r'$S_0$', color=colors[0])
ax4.plot(e['fs'].iloc[:,1], e['S1'], label=r'$S_1$', color=colors[1])
ax4.plot(e['fs'].iloc[:,1], e['S2'], label=r'$S_2$', color=colors[2])
ax4.plot(e['fs'].iloc[:,1], e['S3'], label=r'$S_3$', color=colors[3])
ax4.plot(e['fs'].iloc[:,1], e['S4'], label=r'$S_4$', color=colors[4])
ax4.plot(e['fs'].iloc[:,1], e['S5'], label=r'$S_5$', color=colors[5])
ax4.plot(e['fs'].iloc[:,1], e['S6'], label=r'$S_6$', color=colors[6])
ax4.plot(e['fs'].iloc[:,1], e['S7'], label=r'$S_7$', color=colors[7])

ax44 = ax4.twinx()
ax44.plot(e['fs'].iloc[:,1], e['Xpulse'], label='X_pulse', ls='--', lw=.5)
ax44.plot(e['fs'].iloc[:,1], e['Ypulse'], label='Y_pulse', ls='--', lw=.5)
ax4.set_title('Populations INV')
#ax4.set_ylim(0,0.3)
ax4.set_xlim(0,50)
ax4.legend()

ax7.plot(f['fs'].iloc[:,1], f['S0'], label=r'$S_0$', color=colors[0])
ax7.plot(f['fs'].iloc[:,1], f['S1'], label=r'$S_1$', color=colors[1])
ax7.plot(f['fs'].iloc[:,1], f['S2'], label=r'$S_2$', color=colors[2])
ax7.plot(f['fs'].iloc[:,1], f['S3'], label=r'$S_3$', color=colors[3])
ax7.plot(f['fs'].iloc[:,1], f['S4'], label=r'$S_4$', color=colors[4])
ax7.plot(f['fs'].iloc[:,1], f['S5'], label=r'$S_5$', color=colors[5])
ax7.plot(f['fs'].iloc[:,1], f['S6'], label=r'$S_6$', color=colors[6])
ax7.plot(f['fs'].iloc[:,1], f['S7'], label=r'$S_7$', color=colors[7])

ax77 = ax7.twinx()
ax77.plot(f['fs'].iloc[:,1], f['Xpulse'], label='X_pulse', ls='--', lw=.5)
ax77.plot(f['fs'].iloc[:,1], f['Ypulse'], label='Y_pulse', ls='--', lw=.5)
ax7.set_title('Populations Pi')
#ax5.set_ylim(0,0.3)
ax7.set_xlim(0,50)
ax7.legend()

fig.tight_layout();


IR vs UV


In [15]:
fig, [[ax0, ax1],[ax2,ax3],[ax4,ax5],[ax6,ax7]] = plt.subplots(4,2,figsize=(15,16))

labelz = ['IR inv','UV']
runs = [e,b]

for ind,i in enumerate(runs):
    ax0.plot(i['fs'].iloc[:,1],  i['Products']      , label='{} Products'.format(labelz[ind]) , ls='--', color=colors[ind])
    ax0.plot(i['fs'].iloc[:,1],  i['Reactants']     , label='{} Reactants'.format(labelz[ind]),          color=colors[ind])
    #ax0.plot(i['fs'].iloc[:,1],  i['FC after pulse'], label='{} FC'.format(labelz[ind])       , ls=':', lw=0.5,  color=colors[ind])
    ax1.plot(i['fs'].iloc[:,1],  i['Products'] /i['Norm_factor (t)']     , label='{} Products'.format(labelz[ind]) , ls='--', color=colors[ind])
    ax1.plot(i['fs'].iloc[:,1],  i['Reactants']/i['Norm_factor (t)']     , label='{} Reactants'.format(labelz[ind]),          color=colors[ind])
    #ax1.plot(i['fs'].iloc[:,1],  i['FC after pulse']/i['Norm_factor (t)'], label='{} FC'.format(labelz[ind])       , lw=0.5, ls=':',  color=colors[ind])

ax0.set_xlabel('fs')
ax0.set_title('Regions only - Products Reactants')
ax0.legend()
ax1.set_xlabel('fs')
ax1.set_title('Regions only - Products Reactants - Normalized')
ax1.legend()

for ind,i in enumerate(runs):
    ax2.plot(i['fs'].iloc[:,1],     i['Abs S0'], label=r'{} dP(dt) $S_0$'.format(labelz[ind]), color=colors[ind])
    ax3.plot(i['fs'].iloc[:,1],     i['Abs S0']/i['Norm_factor (t)'], label=r'{} dP(dt) $S_0$'.format(labelz[ind]), color=colors[ind])

ax2.set_title('Absorbing potential - dP(dt)')
ax2.legend()
ax3.set_title('Absorbing potential - dP(dt) - Normalized')
ax3.legend()


for ind,i in enumerate(runs):
    ax4.plot(i['fs'].iloc[:,1],     i['P(t) S0'], label=r'{} P(t) $S_0$'.format(labelz[ind]), color=colors[ind])
    ax5.plot(i['fs'].iloc[:,1],     i['P(t) S0']/i['Norm_factor (t)'], label=r'{} P(t) $S_0$'.format(labelz[ind]), color=colors[ind])
    
ax4.set_title(r'P(t) - $S_0$ absorbed')
ax4.legend()
ax5.set_title(r'P(t) - $S_0$ absorbed - Normalized')
ax5.legend()

for ind,i in enumerate(runs):
    ax6.plot(i['fs'].iloc[:,1],     i['Products_F'] ,   label='{} Products'.format(labelz[ind]),  ls='--', color=colors[ind])
    ax6.plot(i['fs'].iloc[:,1],     i['Reactants_F'],   label='{} Reactants'.format(labelz[ind]), color=colors[ind])
    ax7.plot(i['fs'].iloc[:,1],     i['Products_F'] /i['Norm_factor (t)'],   label='{} Products'.format(labelz[ind]),  ls='--', color=colors[ind])
    ax7.plot(i['fs'].iloc[:,1],     i['Reactants_F']/i['Norm_factor (t)'],   label='{} Reactants'.format(labelz[ind]), color=colors[ind])

ax6.set_xlabel('fs')
ax6.set_title('Products Reactants - Final graph')
ax6.legend()
ax7.set_xlabel('fs')
ax7.set_title('Products Reactants - Final graph - Normalized')
ax7.legend()

fig.tight_layout();



In [ ]: