Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frtrglib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Bruch
frtrglib
Commits
1ef15f03
Verified
Commit
1ef15f03
authored
Sep 3, 2022
by
Valentin Bruch
Browse files
Options
Downloads
Patches
Plain Diff
improved plotting interpolated data for order comparison
parent
560c5242
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
final_plots.py
+2
-27
2 additions, 27 deletions
final_plots.py
plot.py
+48
-20
48 additions, 20 deletions
plot.py
with
50 additions
and
47 deletions
final_plots.py
+
2
−
27
View file @
1ef15f03
...
...
@@ -195,7 +195,7 @@ def export_omega5_interp(
vdc_max
=
165.372
,
vac_min
=
0
,
vac_max
=
165.372
,
dc_res
=
2
01
,
dc_res
=
3
01
,
ac_res
=
201
,
korder
=
2
,
):
...
...
@@ -243,14 +243,9 @@ def export_omega5_interp(
reduced_data
=
data
.
loc
[
selection
(
order
,
method
,
**
kwargs
)]
settings
.
logger
.
info
(
f
"
Starting with
{
order
}
{
method
}
, found
{
reduced_data
.
shape
[
0
]
}
data points
"
)
results
=
{}
if
reduced_data
.
shape
[
0
]
<
4
00
:
if
reduced_data
.
shape
[
0
]
<
1
00
:
return
results
try
:
results
[
f
"
gdc_
{
method
}
_
{
order
}
_lin
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
dc_conductance
,
(
vdc_mesh
,
vac_mesh
),
method
=
"
linear
"
)
results
[
f
"
gdc_
{
method
}
_
{
order
}
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
dc_conductance
,
...
...
@@ -261,11 +256,6 @@ def export_omega5_interp(
except
:
settings
.
logger
.
exception
(
f
"
in griddata interpolation of Gdc for
{
order
}
{
method
}
"
)
try
:
results
[
f
"
idc_
{
method
}
_
{
order
}
_lin
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
dc_current
,
(
vdc_mesh
,
vac_mesh
),
method
=
"
linear
"
)
results
[
f
"
idc_
{
method
}
_
{
order
}
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
dc_current
,
...
...
@@ -280,11 +270,6 @@ def export_omega5_interp(
except
:
settings
.
logger
.
exception
(
f
"
in spline interpolation of Idc for
{
order
}
{
method
}
"
)
try
:
results
[
f
"
iac_
{
method
}
_
{
order
}
_lin
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
2
*
reduced_data
.
ac_current_abs
,
(
vdc_mesh
,
vac_mesh
),
method
=
"
linear
"
)
results
[
f
"
iac_
{
method
}
_
{
order
}
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
2
*
reduced_data
.
ac_current_abs
,
...
...
@@ -299,11 +284,6 @@ def export_omega5_interp(
except
:
settings
.
logger
.
exception
(
f
"
in spline interpolation of Iac for
{
order
}
{
method
}
"
)
try
:
results
[
f
"
phase_
{
method
}
_
{
order
}
_lin
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
ac_current_phase
,
(
vdc_mesh
,
vac_mesh
),
method
=
"
linear
"
)
results
[
f
"
phase_
{
method
}
_
{
order
}
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
ac_current_phase
,
...
...
@@ -312,11 +292,6 @@ def export_omega5_interp(
except
:
settings
.
logger
.
exception
(
f
"
in griddata interpolation of phase for
{
order
}
{
method
}
"
)
try
:
results
[
f
"
gamma_
{
method
}
_
{
order
}
_lin
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
gamma
,
(
vdc_mesh
,
vac_mesh
),
method
=
"
linear
"
)
results
[
f
"
gamma_
{
method
}
_
{
order
}
"
]
=
griddata
(
(
reduced_data
.
vdc
,
reduced_data
.
vac
),
reduced_data
.
gamma
,
...
...
This diff is collapsed.
Click to expand it.
plot.py
+
48
−
20
View file @
1ef15f03
...
...
@@ -1404,37 +1404,65 @@ def compare_RGeq(dm, omega=16.5372, **parameters):
ax4
.
contour
(
vdc_o3
,
vac_o3
,
gdc_o3
,
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
def
compare_RGeq_interp
(
dm
,
filename
=
"
figdata/omega5_interp.npz
"
,
**
trashparams
):
def
compare_RGeq_interp
(
dm
,
filename
=
"
figdata/omega5_interp.npz
"
,
method
=
"
mu
"
,
ref_method
=
"
mu
"
,
observable
=
"
gdc
"
,
suffix
=
""
,
**
trashparams
):
data
=
np
.
load
(
filename
)
fig
,
((
ax1
,
ax2
),
(
ax3
,
ax4
))
=
plt
.
subplots
(
ncols
=
2
,
nrows
=
2
,
sharex
=
True
,
sharey
=
True
)
prefactor
=
1
if
observable
[:
5
]
==
"
gamma
"
:
levels
=
np
.
linspace
(
5
,
30
,
51
)
elif
observable
[
0
]
==
"
g
"
:
prefactor
=
np
.
pi
levels
=
np
.
linspace
(
0
,
0.4
/
np
.
pi
,
41
)
abs_diff_o2
=
np
.
pi
*
(
data
[
"
gdc_mu_o2
"
]
-
data
[
"
gdc_mu_o3p
"
])
abs_diff_o3
=
np
.
pi
*
(
data
[
"
gdc_mu_o3
"
]
-
data
[
"
gdc_mu_o3p
"
])
max_diff
=
min
(
max
(
np
.
abs
(
abs_diff_o2
).
max
(),
np
.
abs
(
abs_diff_o3
).
max
()),
0.1
)
elif
observable
[
0
]
==
"
i
"
:
levels
=
np
.
linspace
(
0
,
20
,
51
)
elif
observable
[:
5
]
==
"
phase
"
:
levels
=
np
.
linspace
(
-
np
.
pi
,
np
.
pi
,
41
)
else
:
raise
ValueError
(
f
"
unknown observable:
{
observable
}
"
)
vdc
=
data
[
"
vdc
"
]
vac
=
data
[
"
vac
"
]
abs_norm
=
plt
.
Normalize
(
-
max_diff
,
max_diff
)
extent
=
(
1.5
*
vdc
[
0
]
-
0.5
*
vdc
[
1
],
1.5
*
vdc
[
-
1
]
-
0.5
*
vdc
[
-
2
],
1.5
*
vac
[
0
]
-
0.5
*
vac
[
1
],
1.5
*
vac
[
-
1
]
-
0.5
*
vac
[
-
2
])
imshow_kwargs
=
dict
(
cmap
=
plt
.
cm
.
seismic
,
extent
=
extent
,
origin
=
"
lower
"
,
aspect
=
"
auto
"
)
fig
,
axes
=
plt
.
subplots
(
nrows
=
2
,
ncols
=
2
+
(
ref_method
!=
method
),
sharex
=
True
,
sharey
=
True
)
((
ax1
,
ax2
),
(
ax3
,
ax4
))
=
axes
[:,:
2
]
abs_diff_o2
=
prefactor
*
(
data
[
f
"
{
observable
}
_
{
method
}
_o2
{
suffix
}
"
]
-
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
])
abs_diff_o3
=
prefactor
*
(
data
[
f
"
{
observable
}
_
{
method
}
_o3
{
suffix
}
"
]
-
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
])
max_diff
=
min
(
max
(
np
.
abs
(
abs_diff_o2
).
max
(),
np
.
abs
(
abs_diff_o3
).
max
()),
0.1
)
abs_norm
=
plt
.
Normalize
(
-
max_diff
,
max_diff
)
ax1
.
imshow
(
abs_diff_o2
,
norm
=
abs_norm
,
**
imshow_kwargs
)
img
=
ax2
.
imshow
(
abs_diff_o3
,
norm
=
abs_norm
,
**
imshow_kwargs
)
fig
.
colorbar
(
img
,
ax
=
[
ax1
,
ax2
])
ax1
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o3p
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax1
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o2
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax2
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o3p
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax2
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o3
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
rel_diff_o2
=
(
data
[
"
gdc_mu_o2
"
]
-
data
[
"
gdc_mu_o3p
"
])
/
data
[
"
gdc_mu_o3p
"
]
rel_diff_o3
=
(
data
[
"
gdc_mu_o3
"
]
-
data
[
"
gdc_mu_o3p
"
])
/
data
[
"
gdc_mu_o3p
"
]
fig
.
colorbar
(
img
,
ax
=
axes
[
0
])
ax1
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax1
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
method
}
_o2
{
suffix
}
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax2
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax2
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
method
}
_o3
{
suffix
}
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
rel_diff_o2
=
(
data
[
f
"
{
observable
}
_
{
method
}
_o2
{
suffix
}
"
]
-
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
])
/
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
]
rel_diff_o3
=
(
data
[
f
"
{
observable
}
_
{
method
}
_o3
{
suffix
}
"
]
-
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
])
/
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
]
max_rel_diff
=
min
(
max
(
np
.
abs
(
rel_diff_o2
).
max
(),
np
.
abs
(
rel_diff_o3
).
max
()),
0.1
)
rel_norm
=
plt
.
Normalize
(
-
max_rel_diff
,
max_rel_diff
)
ax3
.
imshow
(
rel_diff_o2
,
norm
=
rel_norm
,
**
imshow_kwargs
)
img
=
ax4
.
imshow
(
rel_diff_o3
,
norm
=
rel_norm
,
**
imshow_kwargs
)
fig
.
colorbar
(
img
,
ax
=
[
ax3
,
ax4
])
ax3
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o3p
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax3
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o2
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax4
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o3p
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax4
.
contour
(
vdc
,
vac
,
data
[
"
gdc_mu_o3
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
fig
.
colorbar
(
img
,
ax
=
axes
[
1
])
ax3
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax3
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
method
}
_o2
{
suffix
}
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax4
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax4
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
method
}
_o3
{
suffix
}
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
if
ref_method
!=
method
:
abs_diff_o3p
=
prefactor
*
(
data
[
f
"
{
observable
}
_
{
method
}
_o3p
{
suffix
}
"
]
-
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
])
rel_diff_o3p
=
(
data
[
f
"
{
observable
}
_
{
method
}
_o3p
{
suffix
}
"
]
-
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
])
/
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
]
ax5
,
ax6
=
axes
[:,
2
]
ax5
.
imshow
(
abs_diff_o3p
,
norm
=
abs_norm
,
**
imshow_kwargs
)
ax6
.
imshow
(
rel_diff_o3p
,
norm
=
abs_norm
,
**
imshow_kwargs
)
ax5
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax5
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax6
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
ref_method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#00ff00
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
ax6
.
contour
(
vdc
,
vac
,
data
[
f
"
{
observable
}
_
{
method
}
_o3p
{
suffix
}
"
],
levels
,
colors
=
"
#202020
"
,
alpha
=
0.8
,
linewidths
=
0.5
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment