asd
This commit is contained in:
@ -52,30 +52,37 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
|
||||
inputfile = yaml.full_load(file)
|
||||
|
||||
#true_val = [10,250,250,250,30]
|
||||
true_val = [10,60,220,160,100]
|
||||
true_values = {
|
||||
3: 10,
|
||||
4: 60,
|
||||
5: 220,
|
||||
6: 160,
|
||||
2: 100
|
||||
}
|
||||
|
||||
|
||||
current_val = []
|
||||
labels = []
|
||||
|
||||
ids = []
|
||||
|
||||
for bnd_c in inputfile['estimation']['boundary_conditions']:
|
||||
|
||||
if 'windkessel' in bnd_c['type']:
|
||||
for bnd_set in inputfile['boundary_conditions']:
|
||||
if bnd_c['id'] == bnd_set['id']:
|
||||
ids.append(bnd_c['id'])
|
||||
current_val.append(bnd_set['value'][0])
|
||||
labels.append('R_' + str(bnd_c['id']))
|
||||
|
||||
elif 'dirichlet' in bnd_c['type']:
|
||||
current_val.append(inputfile['boundary_conditions'][1]['parameters']['U'])
|
||||
ids.append(bnd_c['id'])
|
||||
labels.append('U')
|
||||
|
||||
|
||||
dim = dat['theta'].shape[-1]
|
||||
fig1, axes = plt.subplots(1,1,figsize=(8,6))
|
||||
|
||||
|
||||
|
||||
axes.set_ylabel(r'$\theta$',fontsize=18)
|
||||
|
||||
t = dat['times']
|
||||
@ -104,7 +111,7 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
|
||||
color=col_)
|
||||
|
||||
|
||||
true_level = np.log(true_val[i]/current_val[i])/np.log(2)
|
||||
true_level = np.log(true_values[ids[i]]/current_val[i])/np.log(2)
|
||||
axes.plot(t,1.5*i + t*0 + true_level , color=col_,ls='--')
|
||||
col_ = next(col)
|
||||
legends_=next(legends)
|
||||
@ -115,8 +122,8 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
|
||||
# print('theta_peak: \t {}'.format(theta[round(len(theta)/2), :]))
|
||||
print('Final value theta: \t {}'.format(theta[-1, :]))
|
||||
print('Deparameterized: 2^theta_end: \t {}'.format(2**theta[-1, :]))
|
||||
print('Real values: \t {}'.format(true_val))
|
||||
print('Recon values: \t {}'.format(np.round(2**theta[-1, :]*current_val,2)))
|
||||
print('Real values: \t {}'.format(true_values))
|
||||
print('Recon values: \t {a}:{b} '.format(a=ids[:],b=np.round(2**theta[-1, :]*current_val,2)))
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user