-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #72 from SMTG-Bham/bug-fix
update from JOSS review 1
Showing
33 changed files
with
574 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import tp | ||
|
||
scs = '222 333 444 555'.split() | ||
pfiles = ['../data/basno3/band-{}.yaml'.format(s) for s in scs] | ||
kfile = '../data/basno3/kappa-m363636.hdf5' | ||
dfile = '../data/basno3/projected_dos.dat' | ||
poscar = '../data/basno3/POSCAR' | ||
|
||
direction = 'avg' | ||
temperature = 300 | ||
waterfall = 'mean_free_path' | ||
quantities = ['waterfall', waterfall] | ||
|
||
colour = 'winter_r' | ||
colours = {'Ba': '#ffcf06', | ||
'Sn': '#59c605', | ||
'O': '#00b1f7'} | ||
cmap = 'viridis' | ||
|
||
# You can ignore down to line 23! | ||
from os import path | ||
if not path.isfile(kfile) or (path.getsize(kfile) < 1024*1024*100): | ||
raise Exception('File not found, please use get-data.sh') | ||
# Stop ignoring! | ||
|
||
# Axes | ||
fig, ax, add_legend = tp.axes.small.two_h() | ||
|
||
# Load | ||
dispersions = [tp.data.load.phonopy_dispersion(f) for f in pfiles] | ||
kappa = tp.data.load.phono3py(kfile, quantities=quantities) | ||
dos = tp.data.load.phonopy_dos(dfile, poscar=poscar) | ||
|
||
# Plot | ||
tp.plot.phonons.add_multi(ax[0], dispersions, colour=colour, label=scs) | ||
tp.plot.frequency.format_waterfall(ax[1], kappa, waterfall, direction=direction, | ||
temperature=temperature, invert=True) | ||
tp.plot.frequency.add_dos(ax[1], dos, colour=colours, scale=True, main=False, | ||
alpha=0.6, line=False, invert=True) | ||
tp.plot.frequency.add_waterfall(ax[1], kappa, waterfall, colour=cmap, | ||
direction=direction, temperature=temperature, | ||
invert=True) | ||
|
||
# Formatting | ||
|
||
tp.plot.utilities.set_locators(ax[1], x='log', y='linear') | ||
axlabels = tp.settings.labels() | ||
ax[1].set_xlabel(axlabels['mean_free_path']) | ||
ax[1].set_ylabel(axlabels['frequency']) | ||
add_legend() | ||
|
||
# Save | ||
fig.savefig('tutorial-04.png') | ||
#!/usr/bin/env python3 | ||
|
||
import tp | ||
|
||
scs = '222 333 444 555'.split() | ||
pfiles = ['../data/basno3/band-{}.yaml'.format(s) for s in scs] | ||
kfile = '../data/basno3/kappa-m363636.hdf5' | ||
dfile = '../data/basno3/projected_dos.dat' | ||
poscar = '../data/basno3/POSCAR' | ||
|
||
direction = 'avg' | ||
temperature = 300 | ||
waterfall = 'mean_free_path' | ||
quantities = ['waterfall', waterfall] | ||
|
||
colour = 'winter_r' | ||
colours = {'Ba': '#ffcf06', | ||
'Sn': '#59c605', | ||
'O': '#00b1f7'} | ||
cmap = 'viridis' | ||
|
||
# You can ignore down to line 23! | ||
from os import path | ||
if not path.isfile(kfile) or (path.getsize(kfile) < 1024*1024*100): | ||
raise Exception('File not found, please use get-data.sh in the folder above.') | ||
# Stop ignoring! | ||
|
||
# Axes | ||
fig, ax, add_legend = tp.axes.small.two_h() | ||
|
||
# Load | ||
dispersions = [tp.data.load.phonopy_dispersion(f) for f in pfiles] | ||
kappa = tp.data.load.phono3py(kfile, quantities=quantities) | ||
dos = tp.data.load.phonopy_dos(dfile, poscar=poscar) | ||
|
||
# Plot | ||
tp.plot.phonons.add_multi(ax[0], dispersions, colour=colour, label=scs) | ||
tp.plot.frequency.format_waterfall(ax[1], kappa, waterfall, direction=direction, | ||
temperature=temperature, invert=True) | ||
tp.plot.frequency.add_dos(ax[1], dos, colour=colours, scale=True, main=False, | ||
alpha=0.6, line=False, invert=True) | ||
tp.plot.frequency.add_waterfall(ax[1], kappa, waterfall, colour=cmap, | ||
direction=direction, temperature=temperature, | ||
invert=True) | ||
|
||
# Formatting | ||
|
||
tp.plot.utilities.set_locators(ax[1], x='log', y='linear') | ||
axlabels = tp.settings.labels() | ||
ax[1].set_xlabel(axlabels['mean_free_path']) | ||
ax[1].set_ylabel(axlabels['frequency']) | ||
add_legend() | ||
|
||
# Save | ||
fig.savefig('tutorial-04.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import tp | ||
from matplotlib.gridspec import GridSpec | ||
import matplotlib.pyplot as plt | ||
|
||
afile = '../data/basno3/transport_75x75x75.json' | ||
kfile = '../data/basno3/kappa-m363636.hdf5' | ||
|
||
doping = [-1e18, -1e19, -1e20, -1e21] | ||
direction = 'avg' | ||
quantities = ['conductivity', 'seebeck'] | ||
scale = ['log', 'linear', 'linear'] | ||
|
||
from os import path | ||
if not path.isfile(kfile) or (path.getsize(kfile) < 1024*1024*100): | ||
raise Exception('File not found, please use get-data.sh') | ||
|
||
# Axes | ||
plt.style.use('tp') | ||
fig = plt.figure(figsize=(27/2.54, 8.3/2.54)) | ||
grid = GridSpec(1, 14) | ||
ax = [fig.add_subplot(grid[0, :4]), | ||
fig.add_subplot(grid[0, 5:9]), | ||
fig.add_subplot(grid[0, 10:])] | ||
plt.subplots_adjust(left=0.06, right=0.98, | ||
bottom=0.12, top=0.95) | ||
|
||
# Load | ||
adata = tp.data.load.amset(afile) | ||
kdata = tp.data.load.phono3py(kfile) | ||
|
||
# Plot | ||
for i, q in enumerate(quantities): | ||
for d in doping: | ||
data = tp.data.utilities.resolve(adata, q, direction=direction, doping=d) | ||
ax[i].plot(data['temperature'], data[q], | ||
label="{:.2e}".format(data['meta']['doping'])) | ||
|
||
q = 'lattice_thermal_conductivity' | ||
data = tp.data.utilities.resolve(kdata, q, direction=direction) | ||
ax[2].plot(data['temperature'], data[q]) | ||
|
||
# Formatting | ||
axlabels = tp.settings.labels() | ||
for i, q in enumerate([*quantities, q]): | ||
ax[i].set_xlabel(axlabels['temperature']) | ||
ax[i].set_ylabel(axlabels[q]) | ||
tp.plot.utilities.set_locators(ax[i], x='linear', y=scale[i]) | ||
|
||
handles, labels = tp.axes.legend.consolidate(ax) | ||
ax[2].legend(loc='best', title=axlabels['doping'], handles=handles, | ||
labels=labels) | ||
tp.axes.legend.alphabetise(ax, preset='roman', suffix=')', x=-0.12) | ||
|
||
# Save | ||
fig.savefig('tutorial-05.png') | ||
#!/usr/bin/env python3 | ||
|
||
import tp | ||
from matplotlib.gridspec import GridSpec | ||
import matplotlib.pyplot as plt | ||
|
||
afile = '../data/basno3/transport_75x75x75.json' | ||
kfile = '../data/basno3/kappa-m363636.hdf5' | ||
|
||
doping = [-1e18, -1e19, -1e20, -1e21] | ||
direction = 'avg' | ||
quantities = ['conductivity', 'seebeck'] | ||
scale = ['log', 'linear', 'linear'] | ||
|
||
from os import path | ||
if not path.isfile(kfile) or (path.getsize(kfile) < 1024*1024*100): | ||
raise Exception('File not found, please use get-data.sh in the folder above.') | ||
|
||
# Axes | ||
plt.style.use('tp') | ||
fig = plt.figure(figsize=(27/2.54, 8.3/2.54)) | ||
grid = GridSpec(1, 14) | ||
ax = [fig.add_subplot(grid[0, :4]), | ||
fig.add_subplot(grid[0, 5:9]), | ||
fig.add_subplot(grid[0, 10:])] | ||
plt.subplots_adjust(left=0.06, right=0.98, | ||
bottom=0.12, top=0.95) | ||
|
||
# Load | ||
adata = tp.data.load.amset(afile) | ||
kdata = tp.data.load.phono3py(kfile) | ||
|
||
# Plot | ||
for i, q in enumerate(quantities): | ||
for d in doping: | ||
data = tp.data.utilities.resolve(adata, q, direction=direction, doping=d) | ||
ax[i].plot(data['temperature'], data[q], | ||
label="{:.2e}".format(data['meta']['doping'])) | ||
|
||
q = 'lattice_thermal_conductivity' | ||
data = tp.data.utilities.resolve(kdata, q, direction=direction) | ||
ax[2].plot(data['temperature'], data[q]) | ||
|
||
# Formatting | ||
axlabels = tp.settings.labels() | ||
for i, q in enumerate([*quantities, q]): | ||
ax[i].set_xlabel(axlabels['temperature']) | ||
ax[i].set_ylabel(axlabels[q]) | ||
tp.plot.utilities.set_locators(ax[i], x='linear', y=scale[i]) | ||
|
||
handles, labels = tp.axes.legend.consolidate(ax) | ||
ax[2].legend(loc='best', title=axlabels['doping'], handles=handles, | ||
labels=labels) | ||
tp.axes.legend.alphabetise(ax, preset='roman', suffix=')', x=-0.12) | ||
|
||
# Save | ||
fig.savefig('tutorial-05.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.