***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jackknife
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E138 Institute of Solid State Physics
E138-01 Computational Materials Science
Software
jackknife
Commits
6325f78d
Commit
6325f78d
authored
5 years ago
by
Patrick Kappl
Browse files
Options
Downloads
Patches
Plain Diff
Add plotting function for covariances
parent
886381de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plot_results.py
+30
-9
30 additions, 9 deletions
plot_results.py
with
30 additions
and
9 deletions
plot_results.py
+
30
−
9
View file @
6325f78d
...
...
@@ -2,6 +2,8 @@
import
h5py
import
matplotlib.pyplot
as
plt
import
matplotlib.ticker
as
mtick
import
matplotlib.colors
as
colors
import
colorcet
as
cc
import
numpy
as
np
import
os
...
...
@@ -31,13 +33,13 @@ file_names = []
# file_names.append("jackknife_U4_b2_w16_n1e4_n4iwf20_2019-07-05_12-58-01.hdf5")
# file_names.append("jackknife_U4_b2_w16_n1e4_n4iwf20_2019-07-05_14-20-41.hdf5")
file_names
.
append
(
"
U4_b2_w4_n64e3_n4iwf20_2019-07-11_14-49-57.hdf5
"
)
file_names
.
append
(
"
U4_b2_w8_n32e3_n4iwf20_2019-07-11_14-50-20.hdf5
"
)
file_names
.
append
(
"
U4_b2_w16_n16e3_n4iwf20_2019-07-11_10-50-56.hdf5
"
)
file_names
.
append
(
"
U4_b2_w32_n8e3_n4iwf20_2019-07-11_10-51-25.hdf5
"
)
file_names
.
append
(
"
U4_b2_w50_n5120_n4iwf20_2019-07-18_17-13-41.hdf5
"
)
file_names
.
append
(
"
U4_b2_w64_n4e3_n4iwf20_2019-07-11_10-51-47.hdf5
"
)
file_names
.
append
(
"
U4_b2_w80_n3200_n4iwf20_2019-07-18_17-13-12.hdf5
"
)
#
file_names.append("U4_b2_w4_n64e3_n4iwf20_2019-07-11_14-49-57.hdf5")
#
file_names.append("U4_b2_w8_n32e3_n4iwf20_2019-07-11_14-50-20.hdf5")
#
file_names.append("U4_b2_w16_n16e3_n4iwf20_2019-07-11_10-50-56.hdf5")
#
file_names.append("U4_b2_w32_n8e3_n4iwf20_2019-07-11_10-51-25.hdf5")
#
file_names.append("U4_b2_w50_n5120_n4iwf20_2019-07-18_17-13-41.hdf5")
#
file_names.append("U4_b2_w64_n4e3_n4iwf20_2019-07-11_10-51-47.hdf5")
#
file_names.append("U4_b2_w80_n3200_n4iwf20_2019-07-18_17-13-12.hdf5")
# file_names.append("susc_U4_b2_w16_n1e3_n4iwf20_2019-07-16_08-23-11.hdf5")
...
...
@@ -46,7 +48,9 @@ file_names.append("U4_b2_w80_n3200_n4iwf20_2019-07-18_17-13-12.hdf5")
# file_names.append("U4_b2_w16_n1e5_n4iwf20_self_2019-07-18_16-13-47.hdf5")
# file_names.append("U4_b2_w64_n4e3_n4iwf20_self_2019-07-18_16-08-24.hdf5")
# file_names.append(".hdf5")
file_names
.
append
(
"
U4_b2_w16_n1e5_n4iwf20_self_2019-07-23_08-51-44.hdf5
"
)
file_names
.
append
(
"
U4_b2_w64_n4e3_n4iwf20_self_2019-07-23_12-27-26.hdf5
"
)
# %%
# Read data from multiple files
...
...
@@ -83,6 +87,11 @@ try:
except
Exception
as
e
:
print
(
"
Could not read samples
"
)
print
(
e
)
try
:
covariances
=
np
.
array
([
np
.
array
(
f
[
"
covariance
"
][...])
for
f
in
files
])
except
Exception
as
e
:
print
(
"
Could not read covariances
"
)
print
(
e
)
n_nus
=
means
[
0
].
shape
[
-
1
]
n_ks
=
means
[
0
].
shape
[
-
2
]
print
(
"
n_ks=
"
+
str
(
n_ks
))
...
...
@@ -310,7 +319,7 @@ def plot_bias_correction(k=[[0, 0]], file_indexes=[0], i_channel=None,
ax
=
plt
.
gca
()
ax
.
yaxis
.
set_major_formatter
(
mtick
.
FormatStrFormatter
(
"
%.2e
"
))
plt
.
xlabel
(
"
\"
$
\\
nu$
\"
"
,
fontsize
=
12
)
plt
.
ylabel
(
r
"
$|f(\hat{x})-\hat{y}_{\
math
rm{jackknife}}|$
"
,
fontsize
=
12
)
plt
.
ylabel
(
r
"
$|f(\hat{x})-\hat{y}_{\
text
rm{jackknife}}|$
"
,
fontsize
=
12
)
plt
.
legend
(
bbox_to_anchor
=
(
-
0.15
,
-
0.15
),
loc
=
2
,
ncol
=
5
)
plt
.
title
(
"
Bias correction of the jackknife
"
)
plt
.
axhline
(
linewidth
=
0.5
,
color
=
"
black
"
)
...
...
@@ -381,6 +390,18 @@ def plot_errors_in_k_plane(i_nu=n_nus//2, i_file=0):
return
def
plot_covariances
(
k_x
=
0
,
k_y
=
0
,
i_file
=
0
,
vmin
=
None
,
vmax
=
None
):
plt
.
pcolormesh
(
range
(
-
n_nus
//
2
,
n_nus
//
2
+
1
),
range
(
-
n_nus
//
2
,
n_nus
//
2
+
1
),
np
.
abs
(
covariances
[
i_file
,
k_x
,
k_y
]),
vmin
=
vmin
,
vmax
=
vmax
,
cmap
=
cc
.
m_kbc_r
)
plt
.
xlabel
(
"
\"
$
\\
nu$
\"
"
)
plt
.
ylabel
(
"
\"
$
\\
nu$
\"
"
)
plt
.
title
(
"
abs(covariance), kx={}, ky={}
"
.
format
(
k_x
,
k_y
))
plt
.
colorbar
()
plt
.
show
()
return
def
plot_siw
():
x_values
=
np
.
arange
(
-
siw
.
shape
[
2
]
//
2
,
siw
.
shape
[
2
]
//
2
)
+
0.5
plt
.
plot
(
x_values
,
np
.
imag
(
siw
[
0
,
0
]),
label
=
"
imag(siw[0])
"
,
linewidth
=
0.5
)
...
...
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