Enhancing spectral features
Sometimes our spectra are not well resolved. In such cases, we may perform some post processing to enhance the spectral features. You will need astropy module to be installed:
pip install astropy
caution
Following modules are currently experimental and under development. Please review the codes and use with caution. You may instead use the Igor Macro implemented by Prof. P. Zhang.
Here is our original data:
url = 'https://pranabdas.github.io/drive/datasets/arpes/sample_spectrum.txt'
data, energy, angle = arp.load_ses_spectra(url)
plt.imshow(data, origin = 'lower', aspect = 'auto', \
extent = (angle[0], angle[-1], energy[0], energy[-1]))
plt.xlabel("$\\theta$ (deg)")
plt.ylabel("$E_{kin}$ (eV)")
plt.set_cmap('magma_r')
plt.show()
Laplacian
We can take the double derivative of the spectra in order to enhance the edges:
Since the and scales represent different quantities (units), we also have a weight factor .
# diff2 = arp.laplacian(data, x, y, bw=5, w=1)
diff2 = arp.laplacian(data, energy, angle)
plt.imshow(diff2, vmax=0, cmap='terrain_r')
plt.axis('off')
plt.show()
2D curvature
The curvature method could be more appropriate to enhance spectral features. Two dimensional curvature is given by: