Skip to main content

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()

plot-sample-spectra

Laplacian

We can take the double derivative of the spectra in order to enhance the edges:

I=2Ix2+w22Iy2I' = \frac{\partial^2 I}{\partial x^2} + w^2 \frac{\partial^2 I}{\partial y^2}

Since the xx and yy scales represent different quantities (units), we also have a weight factor ww.

# 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()

laplacian

2D curvature

The curvature method could be more appropriate to enhance spectral features. Two dimensional curvature is given by:

I=[1+Cx(Ix)2]Cy2Iy22CxCyIxIy2Ixy+[1+Cy(Iy)2]Cx2Ix2[1+Cx(Ix)2+Cy(Iy)2]3/2I' = \frac{\left[1 + C_x \left(\frac{\partial I}{\partial x}\right)^2\right] C_y \frac{\partial^2 I}{\partial y^2} - 2 C_x C_y \frac{\partial I}{\partial x} \frac{\partial I}{\partial y} \frac{\partial^2 I}{\partial x \partial y} + \left[1+ C_y\left(\frac{\partial I}{\partial y}\right)^2\right] C_x \frac{\partial^2 I}{\partial x^2}}{\left[1 + C_x \left(\frac{\partial I} {\partial x}\right)^2 + C_y \left(\frac{\partial I}{\partial y}\right)^2 \right]^{3/2}}

The details about the curvature method can be found here: P. Zhang et. al., A precise method for visualizing dispersive features in image plots, Review of Scientific Instruments 82, 043712 (2011).

# cv2d = arp.cv2d(data, x, y, bw=5, c1=0.001, c2=0.001, w=1)
cv2d = arp.cv2d(data, energy, angle)

plt.imshow(cv2d, vmax=0, cmap='terrain_r')
plt.axis('off')
plt.show()

cv2d

You may vary various free parameters (CxC_x, CyC_y, ww) in order to get the best result specific to your dataset.