SpectroLab: An Open Source Matlab Based Toolbox for High Throughput Spectroscopy Analysis
Abstract
We present an open source software package SpectroLab a Matlab based tool developed in 2018 for the analysis of spectroscopic data. In this package there are tools for derivative analysis, stacked energy contours , stacked plots for theory, 3D volumetric plots, and core level analysis, and derivative analysis. The package can currently be used for angle-resolved photoemission spectroscopy (ARPES) data, with the ability to also be used for other spectroscopic data in the future. We apply this program to the HfP2, ZrSiS, and Hf2Te2P systems to demonstrate its robustness.
I Introduction
In recent years, spectroscopic techniques such as angle resolved photoemission spectroscopy (ARPES)[1, 2], scanning tunneling microscopy (STM) [3, 4, 5], neutron scattering [6, 7, 8], etc. have improved to the point where the scientific communities use these tools extensively. These techniques reveal features in momentum and energy space that can give deeper understanding of the interactions of exotic quasi-particles that have taken interest in recent years such as topological insulators[9, 10], Weyl semimetals[11, 12, 13], nodal-line semimetals[14, 15, 16], and High order Topological insulators (HOTI)[17, 18]. Furthermore, these techniques have been expanded to measure other dimensions such as spin, time, magnetism, etc. These techniques are always prone to noise which will decrease the ability to interpret the data correctly. Previously, researchers have employed proprietary programs in order to conduct the data analysis. These programs limit the ability for users to tune the way results are presented and create figures and graphs with a high degree of control. Here, we report a Matlab based program that is written in an easy to read way that allows for the analysis of ARPES data. Using Matlab’s built in tools, we have design a program that gives users a high control in the way they present their data.
The data analysis of these materials is critical in order to understand complex interactions that are difficult to resolve by eye. By importing the data into Matlab, we provide a way for researchers to use the vast packages included in this program that are nontrivial to code in proprietary data analysis programs such as edge detection or neural networks. We present a suite of functions that allow for easy analysis and presentation of spectroscopic data in the Matlab suite called spectrolab. The suite needs minimal programming experience since all of the tools included can be done in one click. As oppose to other data analysis techniques, our package is all inclusive and can be used with minimal need to modify the code in anyway. The only need for the program to work is an .ibw file that is formatted correctly. We present ARPES data in from the HfP2 [19], ZrSiS [20, 21], and Hf2Te2P [22] systems in order to show that this program is applicable to different types of ARPES data. This paper includes a detailed description of the theory behind how the main functions work in section 2. In section 3, we outline the functionalities of each of the functions in the initial release. In section 4, we go over how to install and use SpectroLab. Finally in section 5, we go over a few examples of using the software package in real systems.
II Methods
As the data is imported into SpectroLab it is automatically interpreted into -space from the raw data using the following equations[23]:
(1) |
(2) |
In the program these are interpreted by the following approximation
(3) |
(4) |
In addition to this all supporting variables are automatically calculated within the setvariables() function.
II.1 Sobel filter (2nd Derivative)
The common edge detection algorithms are the Sobel, Canny, Prewitt, Roberts, and fuzzy logic methods[24, 25, 26, 27, 28, 29, 30, 31, 32, 33]. In this paper, we use a modified version of the Sobel filter in order to conduct second derivative calculations. While it is possible to use a convolution neural network (CNN) for feature extraction[34, 35], these networks require a large amount of computational resources and are only applicable to the data set they are trained on. Generative adversarial neural networks (GANs)[36] are a much better alternative to create a neural network feature extraction since it can work on an infinite amount of data sets once it is properly trained. The downside is that a large amount of data sets (1000) are required in order to properly train the neural network. Therefore, we forgo the inclusion of a neural network in our program. The Sobel filter is a 33 matrix that calculates the second derivative locally in an image file (where A is the image). There are two versions, the horizontal and the vertical which can be used, in the distributed program. The horizontal is convoluted with the image to form the second derivative of the image.
(5) |
In order to detect edges after the Sobel filter is applied, one would find the square of the absolute value of the resultant . By not conducting this last step we can resolve weak signals of ARPES. In the case of sharp data, the edge detection feature can be turned on with an additional line of code which we have included. All edge detection algorithms can be accesses via Matlab’s image toolbox.
II.2 Constant Energy Contours
An energy contour is a slice of a 3D band mapping in ARPES (,energy,) where at a constant energy, the 2D , surface is revealed. For constant energy contours we create a function that automatically interprets the energy levels and recreates them in an energy contour. For labeling we included a rounding function that rounds to the nearest significant figure. However, the program can interpret the exact value for publication.
II.3 Volumetric plot
The volumetric plot function takes advantage of how data is formatted for ARPES. Typically data is encoded in an (X,Y,Z,C) format. Where X,Y,and Z are , , and energy, while C is the interpretation of the intensity at that location. By using an alpha map, we can make weak signals transparent and reveal the 3D band structure for visualization. This has the ability to be a very powerful tool for investigating anisotropy in bands.
II.4 Momentum cuts
We have included several methods to aid the taking and momentum cuts from a 3D band mapping. We take these cuts by selecting a value of and and resolving the cut in a 2D image.
II.5 Energy & momentum distribution curves
Energy & momentum distribution curves (EDC & MDC) are used for the data analysis of spectroscopic data. In a set amount of intervals a line of data is taken out of the image and then plotted in order to enable researchers to resolve difficult to resolve images from ARPES or other spectroscopic data. We use the waterfall() function in order to reconstruct the EDC and MDC plots seen in literature [22]. The plot also have the benefit of being three dimensional with the ability to add a color map to further define intensity differences.
II.6 Stacked theory
In order to import theory, we create a 2D surface in a 3D box using Matlab’s meshgrid() function to import an image of the theoretical plot. To insure that the images that we import are of the same size we use the largest image dimensions as the map for all of the subsequent images. We do this because the 3D plot will not work unless we use the same size map. We then offset the images by one for each image. Now, one can scale the distance between image layers using the daspect() function of Matlab to scale the Z (Energy) in order to resolve the layers.
III Analysis tools of SpectroLab
Here we included an overview of the uses of SpectroLab. The fermi level can be found with the fermisurface() [Fig. 2(a)] and the ypos variable
Program | Description |
---|---|
Kx Cuts | Creates momentum slices |
Ky Cuts | Creates momentum slices |
Plot_KX_KY | For quick check of data analysis |
Fermi Surface | Draws Fermi surface from 3D map |
Momentum 2D | 2D ARPES cuts |
Stacked plot | Slices and stacks 3D momentum cuts |
Stacked theory | Stack theory similar to stacked plot |
Density Curves | EDC and MDC |
Energy Contour plot | ECP in exact steps |
Volumetric plot | 3D volumetric plot |
Dispersion | photon energy dependence |
Inner core | Analysis of inner core spectra |
III.1 Graphical User Interface (GUI)
We include a graphical user interface (GUI) [Fig. 1] that can be used as a general tool, more advance data selection and analysis will need to be done in code.
III.2 Constant Energy Contours
We include a function to extract constant energy contours (ECs) from a 3D band mapping. StackedECP() [Fig. 2(c,d) is a feature that calculates ECs and stacks them on top of each other in order to visualize the bands dispersing in 3D space. The energy contour functions do the same, however the ECs are presented in a 2D format.
III.3 Volumetric plot
In the volumetric plot function, a 3D band mapping is interpreted with an alpha map (transparency map). This allows for all bands to be mapped in a 3D space. In addition, users can rotate and zoom in to further examine the electronic structure.
III.4 Momentum cuts
III.5 Energy & momentum distribution curves
Energy distribution curves (EDCs) and momentum distribution curves (MDCs) are important tools for the analysis of ARPES data. Here, we construct programs that can create 3D EDC [Fig. 4(a)] and MDC [Fig. 4(b)] plots similar to those found in previous literature. The advantage of these types of plots is that they are able to give a 3D interpretation of the EDC and MDC which will allow for better understanding of the intensity at certain points (such as discerning if there is a band gap or weak feature in the band gap).
III.6 Photon energy dependence
Dispersion allows for one to interpret photon energy dependent cuts (not a mapping of photon energy) to include for interpretation or publication. The Dispersion map function can interpret an arbitrary amount of cuts specified by the user. [Fig. 5]
III.7 Stacked theory
Stacked theory is a function that allows one to import theoretical DFT energy contours and plot them in a way to compare to the stackedECP() function [Fig. 2(b)]. There is also a feature that allows for plotting theory in one of the energy contour functions.
IV Installation and usage
In this section, we present how to install and use SpectroLab.
IV.1 Get SpectroLab
SpectroLab is an open source software package distributed under the MIT License. The code can be downloaded directly from the public code repository: github.com/christophersims/SpectroLab.
IV.2 Installation and running the code
The code requires no installation, however, the folders that contain the code must be added to the path in order for them to run correctly (or the user could place all of the .m files in one directory). The user must have a Matlab version year of at least 2018 with the image toolbox add-on installed.
The code can be run by simply specifying the file path of the data one wishes to analyze. If there are no formatting errors the code should run without errors.
IV.3 File formats
For ARPES there are three major file formats used (from the Igor suite), .txt, .ibw, and .pxt. Important data is lost in the .txt format and the .pxt format is compressed and cannot be decompressed outside of the Igor program. Therefore, this program only uses the Igor Binary Wave format (.ibw). In addition, the program only accepts files in the format (,Energy,), however, the file can be reformatted within the program.
V Examples
V.1 Incorrectly formatted input
If the input of the code in not formatted correctly (in the (,Energy,) format) it is possible to still run the code by utilizing Matlab’s permute() function. This function allows for one to swap the matrices in order for the program to run correctly. In addition to using the permute the variables in variables() must also be changed in order to match the code. In figure , we present data that was formatted incorrectly but was able to run in the program and produce good results. Here we present the data of Hf2Te2P (Fig. 6) and ZrSiS (Fig. 7) which were imported using the permute function.
V.2 Plotting theory
Our implementation of plotting theory is currently an image importer, however, we have the code that allows for the input if the surface states and Fermi surface generated with the iterative surface green functions[37] imported from Wanniertools[38]. The calculations are not included in this package and must be calculated with tools such as Quantum Espresso[39], VASP[40], Abinit[41], Wannier90[42], etc. In figure 2(b), we show the capability so show stacked theory plots in order to coincide with the stackedECP() function. In addition, we have included a ECP function that also allows for the inclusion of theoretical calculation figures (see supplementary).
V.3 Volumetric plot
VI Conclusion
In conclusion, we have designed a Matlab based program that can be used to interpret spectroscopic data. Included in this tool are multiple functions which can be used for the analysis of ARPES data. To demonstrate the robustness of this package we show ARPES analysis of several data sets. This package can be used as a standalone with no other dependency on other programs. The features of this analysis suite is extensive with the addition of new analysis techniques such as the 3D volumetric plot. In the future, we aim to integrate the analysis of XRD and STM data into the SpectroLab suite.
Supplemetary Material
See Supplementary material for further figures of spectrolab’s output in the HfP2, Hf2Te2P, and ZrSiS systems.
Acknowledgments
The authors would like to thank the Matlab community which provided several methods and programs used in SpectroLab.
C.S. acknowledges the generous support of the Purdue ECE ASIRE fellowship and the National GEM consortium fellowship
Correspondence and requests for additional functionality should be addressed to C.S.
(Email: Sims58@purdue.edu).
References
- Damascelli [2004] A. Damascelli, Phys. Scr. T109, 61 (2004).
- Lu et al. [2012] D. Lu, I. M. Vishik, M. Yi, Y. Chen, R. G. Moore, and Z.-X. Shen, Annual Review of Condensed Matter Physics 3, 129 (2012).
- Binnig et al. [1982] G. Binnig, H. Rohrer, C. Gerber, and E. Weibel, Phys. Rev. Lett. 49, 57 (1982).
- Tersoff and Hamann [1983] J. Tersoff and D. R. Hamann, Phys. Rev. Lett. 50, 1998 (1983).
- Binnig and Rohrer [1987] G. Binnig and H. Rohrer, Rev. Mod. Phys. 59, 615 (1987).
- Wilkinson, Wollan, and Koehler [1961] M. K. Wilkinson, E. O. Wollan, and W. C. Koehler, Annu. Rev. Nucl. Sci. 11, 303 (1961).
- Prince [2004] E. Prince, Appl. Spectrosc. Rev. 34, 159 (2004).
- Strobl et al. [2017] M. Strobl, R. Harti, C. Gruenzweig, R. Woracek, and J. Plomp, Journal of Imaging 3, 64 (2017).
- Hasan and Kane [2010] M. Z. Hasan and C. L. Kane, Rev. Mod. Phys. 82, 3045 (2010).
- Xia et al. [2009] Y. Xia, D. Qian, D. Hsieh, L. Wray, A. Pal, H. Lin, A. Bansil, D. Grauer, Y. S. Hor, R. J. Cava, and M. Z. Hasan, Nat. Phys. 5, 398 (2009).
- Xu et al. [2015] S.-Y. Xu, I. Belopolski, N. Alidoust, M. Neupane, G. Bian, C. Zhang, R. Sankar, G. Chang, Z. Yuan, C.-C. Lee, S.-M. Huang, H. Zheng, J. Ma, D. S. Sanchez, B. Wang, A. Bansil, F. Chou, P. P. Shibayev, H. Lin, S. Jia, and M. Z. Hasan, Science 349, 613 (2015).
- Lv et al. [2015] B. Q. Lv, H. M. Weng, B. B. Fu, X. P. Wang, H. Miao, J. Ma, P. Richard, X. C. Huang, L. X. Zhao, G. F. Chen, Z. Fang, X. Dai, T. Qian, and H. Ding, Phys. Rev. X 5, 031013 (2015).
- Huang et al. [2015] S.-M. Huang, S.-Y. Xu, I. Belopolski, C.-C. Lee, G. Chang, B. Wang, N. Alidoust, G. Bian, M. Neupane, C. Zhang, S. Jia, A. Bansil, H. Lin, and M. Z. Hasan, Nat. Commun. 6, 7373 (2015).
- Burkov, Hook, and Balents [2011] A. A. Burkov, M. D. Hook, and L. Balents, Phys. Rev. B 84, 235126 (2011).
- Fang et al. [2015] C. Fang, Y. Chen, H.-Y. Kee, and L. Fu, Phys. Rev. B 92, 081201 (2015).
- Fang et al. [2016] C. Fang, H. Weng, X. Dai, and Z. Fang, Chin. Phys. B 25, 117106 (2016).
- [17] S. Regmi, M. M. Hosen, B. Ghosh, B. Singh, G. Dhakal, C. Sims, B. Wang, F. Kabir, K. Dimitri, Y. Liu, A. Agarwal, H. Lin, D. Kaczorowski, A. Bansil, and M. Neupane, http://arxiv.org/abs/1911.03703v1 .
- Schindler et al. [2018] F. Schindler, A. M. Cook, M. G. Vergniory, Z. Wang, S. S. P. Parkin, B. A. Bernevig, and T. Neupert, Sci. Adv. 4, eaat0346 (2018).
- Sims et al. [2019] C. Sims, M. M. Hosen, H. Aramberri, C.-Y. Huang, G. Dhakal, K. Dimitri, F. Kabir, S. Regmi, X. Zhou, T.-R. Chang, H. Lin, D. Kaczorowski, N. Kioussis, and M. Neupane, arXiv:1906.09642 (2019).
- Neupane et al. [2016] M. Neupane, I. Belopolski, M. M. Hosen, D. S. Sanchez, R. Sankar, M. Szlawska, S.-Y. Xu, K. Dimitri, N. Dhakal, P. Maldonado, P. M. Oppeneer, D. Kaczorowski, F. Chou, M. Z. Hasan, and T. Durakiewicz, Phys. Rev. B 93 (2016).
- Hosen et al. [2017] M. M. Hosen, K. Dimitri, I. Belopolski, P. Maldonado, R. Sankar, N. Dhakal, G. Dhakal, T. Cole, P. M. Oppeneer, D. Kaczorowski, F. Chou, M. Z. Hasan, T. Durakiewicz, and M. Neupane, Phys. Rev. B 95 (2017).
- Hosen et al. [2018] M. M. Hosen, K. Dimitri, A. K. Nandy, A. Aperis, R. Sankar, G. Dhakal, P. Maldonado, F. Kabir, C. Sims, F. Chou, D. Kaczorowski, T. Durakiewicz, P. M. Oppeneer, and M. Neupane, Nat. Commun. 9 (2018).
- Comin and Damascelli [2015] R. Comin and A. Damascelli, ARPES: A Probe of Electronic Correlations (2015) pp. 31–71.
- Senthilkumaran and Rajesh [2009] N. Senthilkumaran and R. Rajesh, in 2009 International Conference on Advances in Recent Technologies in Communication and Computing (IEEE, 2009).
- Ma et al. [2010] C. Ma, W. Gao, L. Yang, and Z. Liu, in 2010 2nd International Conference on Mechanical and Electronics Engineering (IEEE, 2010).
- Gao et al. [2010] W. Gao, X. Zhang, L. Yang, and H. Liu, in 2010 3rd International Conference on Computer Science and Information Technology (IEEE, 2010).
- Seif, Salut, and Marsono [2010] A. Seif, M. M. Salut, and M. N. Marsono, in 2010 IEEE Conference on Sustainable Utilization and Development in Engineering and Technology (IEEE, 2010).
- Mintz [1994] D. Mintz, CVGIP: Image Understanding 59, 137 (1994).
- Kanopoulos, Vasanthavada, and Baker [1988] N. Kanopoulos, N. Vasanthavada, and R. Baker, IEEE J. Solid-State Circuits 23, 358 (1988).
- Chen, Tsang, and Xu [2012] L. Chen, I. W. Tsang, and D. Xu, IEEE Trans. Neural Netw. Learn. Syst. 23, 902 (2012).
- Canny [1986] J. Canny, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-8, 679 (1986).
- Huertas and Medioni [1986] A. Huertas and G. Medioni, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-8, 651 (1986).
- Shrivakshan and Chandrasekar [2012] G. T. Shrivakshan and C. Chandrasekar, in IJCSI International Journal of Computer Science Issues (2012).
- Bishop [1996] C. M. Bishop, “Neural networks: A pattern recognition perspective,” (1996).
- [35] H. Peng, X. Gao, Y. He, Y. Li, Y. Ji, C. Liu, S. A. Ekahana, D. Pei, Z. Liu, Z. Shen, and Y. Chen, http://arxiv.org/abs/2001.10908v1 .
- Goodfellow et al. [2014] I. J. Goodfellow, J. Pouget-abadie, M. Mirza, B. Xu, D. Warde-farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” (2014).
- Sancho et al. [1985] M. P. L. Sancho, J. M. L. Sancho, J. M. L. Sancho, and J. Rubio, J. Phys. F: Met. Phys. 15, 851 (1985).
- Wu et al. [2018] Q. Wu, S. Zhang, H.-F. Song, M. Troyer, and A. A. Soluyanov, Comput. Phys. Commun. 224, 405 (2018).
- Giannozzi et al. [2009] P. Giannozzi, S. Baroni, N. Bonini, M. Calandra, R. Car, C. Cavazzoni, D. Ceresoli, G. L. Chiarotti, M. Cococcioni, I. Dabo, A. D. Corso, S. de Gironcoli, S. Fabris, G. Fratesi, R. Gebauer, U. Gerstmann, C. Gougoussis, A. Kokalj, M. Lazzeri, L. Martin-Samos, N. Marzari, F. Mauri, R. Mazzarello, S. Paolini, A. Pasquarello, L. Paulatto, C. Sbraccia, S. Scandolo, G. Sclauzero, A. P. Seitsonen, A. Smogunov, P. Umari, and R. M. Wentzcovitch, J. Phys.: Condens. Matter 21, 395502 (2009).
- Kresse and Hafner [1993] G. Kresse and J. Hafner, Phys. Rev. B 48, 13115 (1993).
- Gonze et al. [2009] X. Gonze, B. Amadon, P.-M. Anglade, J.-M. Beuken, F. Bottin, P. Boulanger, F. Bruneval, D. Caliste, R. Caracas, M. Côté, T. Deutsch, L. Genovese, P. Ghosez, M. Giantomassi, S. Goedecker, D. Hamann, P. Hermet, F. Jollet, G. Jomard, S. Leroux, M. Mancini, S. Mazevet, M. Oliveira, G. Onida, Y. Pouillon, T. Rangel, G.-M. Rignanese, D. Sangalli, R. Shaltaf, M. Torrent, M. Verstraete, G. Zerah, and J. Zwanziger, Comput. Phys. Commun. 180, 2582 (2009).
- Mostofi et al. [2008] A. A. Mostofi, J. R. Yates, Y.-S. Lee, I. Souza, D. Vanderbilt, and N. Marzari, Comput. Phys. Commun. 178, 685 (2008).







