final press 8ecm

This commit is contained in:
2021-06-25 11:07:12 +02:00
parent 1b00a76a17
commit 4311b6f65e
29 changed files with 2868 additions and 162 deletions

View File

@ -146,27 +146,12 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
for i in range(len(ids)):
cur_key = ids[i]
true_level = np.log(true_values[ids[i]]/current_val[i])/np.log(2)
rec_value = np.round(2**theta[-1, idx]*current_val[i],2)
#curve = theta[:,idx] + line_split*idx - true_level
#dash_curve = line_split*idx + t*0
curve = 2**theta[:, idx]*current_val[i]
std_down = 2**(-np.sqrt(P[:, idx, idx]))*curve
std_up = 2**np.sqrt(P[:, idx, idx])*curve
dash_curve = true_values[ids[i]] + t*0
if ids_type[i] == 'dirichlet':
fig3, axes3 = plt.subplots(1,1,figsize=(12,5))
axes3.plot(t, curve , '-', color=col_,label= legends_ + '= ' + str(rec_value) + '/' + str(true_values[cur_key]) + '$', linewidth = 4)
axes3.fill_between(t, std_down, std_up, alpha=0.3, color=col_)
legends_=next(legends)
axes3.plot(t, dash_curve , color=col_,ls='--')
axes3.plot(t, dash_curve , color=col_,ls='--' , linewidth = 3)
axes3.set_ylabel(r'$U$',fontsize=36)
axes3.legend(fontsize=36,loc='upper right')
axes3.set_xlim([-0.01,0.81])
@ -177,28 +162,34 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
plt.savefig('U.png')
plt.close(fig3)
else:
cur_key = ids[i]
rec_value = np.round(2**theta[-1, idx]*current_val[i],2)
curve = 2**theta[:, idx]*current_val[i]
std_down = 2**(-np.sqrt(P[:, idx, idx]))*curve
std_up = 2**np.sqrt(P[:, idx, idx])*curve
dash_curve = true_values[ids[i]] + t*0
axes1.plot(t, curve , '-', color=col_,label= legends_ + '= ' + str(rec_value) + '/' + str(true_values[cur_key]) + '$', linewidth = 3)
axes1.fill_between(t, std_down, std_up, alpha=0.3, color=col_)
axes1.plot(t, dash_curve , color=col_,ls='--')
axes1.plot(t, dash_curve , color=col_,ls='--',linewidth = 3)
legends_=next(legends)
if RC_flag:
if i<len(current_val_C):
rec_value_C = np.round(2**theta[-1, idx+1]*current_val_C[idc],6)
if RC_flag:
if i<len(current_val_C):
true_level_C = np.log(true_values_C[ids[i]]/current_val_C[i])/np.log(2)
rec_value_C = np.round(2**theta[-1, idc]*current_val_C[idc],6)
curve_C = 2**theta[:, idx+1]*current_val_C[idc]
dash_curve_C = true_values_C[ids[i]] + t*0
std_C_down = 2**(-np.sqrt(P[:, idx+1, idx+1]))*curve_C
std_C_up = 2**np.sqrt(P[:, idx+1, idx+1])*curve_C
axes2.plot(t, curve_C , '-', color=col_,label= legends_ + '= ' + str(rec_value_C) + '/' + str(true_values_C[cur_key]) + '$', linewidth = 2)
axes2.fill_between(t, std_C_down, std_C_up, alpha=0.3, color=col_)
axes2.plot(t, dash_curve_C , color=col_,ls='--')
legends_=next(legends)
idx +=1
idc +=1
curve_C = 2**theta[:, idx+1]*current_val_C[idc]
dash_curve_C = true_values_C[ids[i]] + t*0
std_C_down = 2**(-np.sqrt(P[:, idx+1, idx+1]))*curve_C
std_C_up = 2**np.sqrt(P[:, idx+1, idx+1])*curve_C
axes2.plot(t, curve_C , '-', color=col_,label= legends_ + '= ' + str(rec_value_C) + '/' + str(true_values_C[cur_key]) + '$', linewidth = 3)
axes2.fill_between(t, std_C_down, std_C_up, alpha=0.3, color=col_)
axes2.plot(t, dash_curve_C , color=col_,ls='--',linewidth = 3)
legends_=next(legends)
idx +=1
idc +=1
if meas_flag:
@ -221,10 +212,12 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
if RC_flag:
axes2.set_ylabel(r'$C$',fontsize=24)
axes2.legend(fontsize=18,loc='upper right')
axes2.set_ylabel(r'$C$',fontsize=36)
axes2.legend(fontsize=36,loc='upper right')
axes2.set_xlim([-0.01,0.81])
axes2.set_xlabel(r'$t (s)$',fontsize=24)
plt.xticks(fontsize=28)
plt.yticks(fontsize=28)
axes2.set_xlabel(r'$t (s)$',fontsize=36)
fig2.savefig('C.png')
fig1.savefig('Rd.png')