Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tools/plot-tools/abacus_plot/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,15 @@ def plot_abs(self, fig: Figure, ax: axes.Axes, directions: list = [0, 1, 2], x_r
labels = {0: 'X', 1: 'Y', 2: 'Z'}
x_data = self.energies if unit == 'eV' else sc.nu2lambda(
sc.eV/sc.h*self.energies)*1e9


#plot the adsorption spectra and output the data
adsorption_spectra_data = x_data[:, np.newaxis]
for direc in directions:
ax.plot(x_data, self.get_abs(direc), label=labels[direc])
adsorption_spectra_data = np.concatenate((adsorption_spectra_data, self.get_abs(direc)[:, np.newaxis]),axis=1)
if direc != directions[-1]:
adsorption_spectra_data = np.concatenate((adsorption_spectra_data, x_data[:, np.newaxis]),axis=1)
np.savetxt('absorpation_spectra.dat', adsorption_spectra_data)

xlabel = 'Energy (eV)' if unit == 'eV' else 'Wave Length (nm)'
ax.set_xlabel(xlabel)
Expand Down