Reuse & Permissions

It is not necessary to obtain permission to reuse this article or its components as it is available under the terms of the Creative Commons Attribution 4.0 International license. This license permits unrestricted use, distribution, and reproduction in any medium, provided attribution to the author(s) and the published article's title, journal citation, and DOI are maintained. Please note that some figures may have been included with permission from other third parties. It is your responsibility to obtain the proper permission from the rights holder directly for these figures.

Export citation

Export citation

Choose format for download:

Download Citation
  • Open Access

diffpy.morph: Python tools for model-independent comparisons between sets of one-dimensional functions

Andrew Yang1,*, Christopher L. Farrow1, Pavol Juhás2, Luis Kitsu Iglesias3,4, Chia-Hao Liu1, Samuel D. Marks5,6, Vivian R. K. Wall7, Joshua Safin8, Sean M. Drewry8 et al.

Caden Myers1, Dillon F. Hanlon9, Nicholas Leonard9, Cedomir Petrovic10,†, Ahhyun Jeong11, Dmitri V. Talapin11, Linda F. Nazar12, Haidong Zhou13, Samuel W. Teitelbaum9, Tim B. van Driel14, Soham Banerjee1, Emil S. Bozin15, Michael F. Toney4,6,16, Katharine Page8,17, Naomi S. Ginsberg7,18,19,20,21, and Simon J. L. Billinge1,‡,§

  • *Present address: Department of Applied Physics and Materials Science, California Institute of Technology, Pasadena, California 91125, USA.
  • †Present address: Shanghai Key Laboratory of Material Frontiers Research in Extreme Environments (MFree), Shanghai Advanced Research in Physical Sciences (SHARPS), Shanghai 201203, People's Republic of China.
  • ‡Contact author: sbillinge@ucsb.edu
  • §Present address: Materials Department, University of California, Santa Barbara, California 93106, USA.

Phys. Rev. Materials 10, 113801 – Published 5 November, 2026

DOI: https://doi.org/10.1103/t39r-v3lx

Abstract

diffpy.morph addresses a need to gain scientific insights from one-dimensional (1D) scientific spectra in model-independent ways. A powerful approach for this is to take differences between pairs of spectra and look for meaningful changes that might indicate underlying chemical, structural, or other modifications. The challenge is that the difference curve may contain uninteresting differences such as experimental inconsistencies and benign physical changes such as the effects of thermal expansion. diffpy.morph allows researchers to apply simple transformations, or “morphs,” to one of the datasets to remove the unwanted differences, revealing, when they are present, nontrivial differences. diffpy.morph is an open-source Python package available on the Python Package Index and conda-forge. Here, we describe its functionality and apply it to solve a range of experimental challenges on diffraction and pair distribution function data from x-rays and neutrons, though we note that it may be applied to any 1D function in principle.

View figure in article

Physics Subject Headings (PhySH)

Article Text

Supplemental Material

References (63)

  1. R. E. Dinnebier and S. J. L. Billinge, in Powder Diffraction, edited by R. E. Dinnebier and S. J. L. Billinge (Royal Society of Chemistry, Cambridge, 2008), pp. 1–19.
  2. T. Egami and S. J. L. Billinge, Underneath the Bragg Peaks: Structural Analysis of Complex Materials, 2nd ed., Pergamon Materials Series Vol. 16 (Elsevier, Amsterdam, 2012).
  3. S. J. L. Billinge and K. M. Ø. Jensen, Atomic Pair Distribution Function Analysis—A Primer, International Union of Crystallography Texts on Crystallography (Oxford University Press, Oxford, England, 2024).
  4. K. Pearson and F. Galton, VII. Note on regression and inheritance in the case of two parents, Proc. R. Soc. London 58, 240 (1895).
  5. See Supplemental Material at http://link.aps.org/supplemental/10.1103/t39r-v3lx for more physical and mathematical justifications for when one can apply the various morphs, which also contains Refs.  [6, 7, 8, 9, 10, 11].
  6. J. M. Léger, A. Pereira, J. Haines, S. Jobic, and R. Brec, Phase transformations of polymeric CdI2-type IrTe2 under high pressure, J. Phys. Chem. Solids 61, 27 (2000).
  7. P. J. Brown, A. G. Fox, E. N. Maslen, M. A. O'Keefe, and B. T. M. Willis, Intensity of diffracted intensities, in International Tables for Crystallography Volume C: Mathematical, Physical and Chemical Tables, edited by E. Prince (Springer Netherlands, Dordrecht, 2006), pp. 554–595.
  8. M. L. Boas, Mathematical Methods in the Physical Sciences (Wiley, Hoboken, NJ, 2006).
  9. R. E. Dinnebier and S. J. L. Billinge, Overview and principles of powder diffraction, in International Tables for Crystallography (International Union of Crystallography, 2019), Vol. H, Chap. 1.1, pp. 2–23.
  10. L. A. Feigin, D. I. Svergun, and G. W. Taylor, General principles of small-angle diffraction, in Structure Analysis by Small-Angle X-Ray and Neutron Scattering, edited by G. W. Taylor (Springer US, Boston, 1987), pp. 25–55.
  11. L. C. Evans and R. F. Gariepy, Measure Theory and Fine Properties of Functions, 1st ed., Textbooks in Mathematics (Chapman and Hall/CRC, Boca Raton, FL, 2015).
  12. G. Tomasi, F. van den Berg, and C. Andersson, Correlation optimized warping and dynamic time warping as preprocessing methods for chromatographic data, J. Chemom. 18, 231 (2004).
  13. P. H. C. Eilers, Parametric time warping, Anal. Chem. 76, 404 (2004).
  14. Q. P. He, J. Wang, J. A. Mobley, J. Richman, and W. E. Grizzle, Self-calibrated warping for mass spectra alignment, Cancer Inform. 10, 65 (2011).
  15. J. Kieffer and D. Karkoulis, PyFAI, a versatile library for azimuthal regrouping, J. Phys.: Conf. Ser. 425, 202012 (2013).
  16. B. H. Toby and R. B. Von Dreele, GSAS-II: The genesis of a modern open-source all purpose crystallography software package, J. Appl. Crystallogr. 46, 544 (2013).
  17. O. Arnold, J. Bilheux, J. Borreguero, A. Buts, S. Campbell, L. Chapon, M. Doucet, N. Draper, R. Ferraz Leal, M. Gigg, V. Lynch, A. Markvardsen, D. Mikkelson, R. Mikkelson, R. Miller, K. Palmen, P. Parker, G. Passos, T. Perring, P. Peterson, et al., Mantid—Data analysis and visualization package for neutron scattering and μ SR experiments, Nucl. Instrum. Methods Phys. Res. Sect. A 764, 156 (2014).
  18. Regents of the University of California, The 3-clause BSD license (1989), https://spdx.org/licenses/BSD-3-Clause.html.
  19. A. Yang, C. L. Farrow, C.-H. Liu, L. Kitsu, and S. J. L. Billinge, diffpy.morph (PyPI package), 2025, https://pypi.org/project/diffpy.morph.
  20. conda-forge community, diffpy.morph (Conda-forge package), 2025, https://anaconda.org/channels/conda-forge/packages/diffpy.morph/overview.
  21. N. Lazarević, E. S. Bozin, M. Šćepanović, M. Opačić, H. Lei, C. Petrovic, and Z. V. Popović, Probing IrTe2 crystal symmetry by polarized Raman scattering, Phys. Rev. B 89, 224301 (2014).
  22. Y. Liu, H. Lei, K. Wang, M. Abeykoon, J. B. Warren, E. Bozin, and C. Petrovic, Thermoelectric studies of Ir1−xRhxTe2 ( 0≤x≤0.3), Phys. Rev. B 98, 094519 (2018).
  23. J. J. Yang, Y. J. Choi, Y. S. Oh, A. Hogan, Y. Horibe, K. Kim, B. I. Min, and S.-W. Cheong, Charge-orbital density wave and superconductivity in the strong spin-orbit coupled IrTe2:Pd, Phys. Rev. Lett. 108, 116402 (2012).
  24. S. Pyon, K. Kudo, and M. Nohara, Superconductivity induced by bond breaking in the triangular lattice of IrTe2, J. Phys. Soc. Jpn. 81, 053701 (2012).
  25. R. Yu, S. Banerjee, H. C. Lei, R. Sinclair, M. Abeykoon, H. D. Zhou, C. Petrovic, Z. Guguchia, and E. S. Bozin, Absence of local fluctuating dimers in superconducting Ir1−x(Pt,Rh)xTe2, Phys. Rev. B 97, 174515 (2018).
  26. I.-K. Jeong, R. H. Heffner, M. J. Graf, and S. J. L. Billinge, Lattice dynamics and correlated atomic motion from the atomic pair distribution function, Phys. Rev. B 67, 104301 (2003).
  27. R. Yu, S. Banerjee, H. Lei, M. Abeykoon, C. Petrovic, Z. Guguchia, and E. S. Bozin, Phase separation at the dimer-superconductor transition in Ir1−xRhxTe2, Phys. Rev. B 98, 134506 (2018).
  28. C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, J. Bloch, T. Proffen, and S. J. L. Billinge, PDFfit2 and PDFgui: Computer programs for studying nanostructure in crystals, J. Phys.: Condens. Matter 19, 335219 (2007).
  29. B. Frandsen, L. Yang, and S. J. L. Billinge, pdfttp_data, 2023, https://github.com/Billingegroup/pdfttp_data.
  30. E. Grüneisen, Theorie des festen Zustandes einatomiger Elemente, Ann. Phys. 344, 257 (1912).
  31. Y. Chang, On the temperature dependence of the bulk modulus and the Anderson-Grüneisen parameter δ of oxide compounds, J. Phys. Chem. Solids 28, 697 (1967).
  32. D. Schroeder, An Introduction to Thermal Physics (Oxford University Press, 2021).
  33. O. L. Anderson, Derivation of Wachtman's equation for the temperature dependence of elastic moduli of oxide compounds, Phys. Rev. 144, 553 (1966).
  34. S. V. Ushakov, A. Navrotsky, R. J. K. Weber, and J. C. Neuefeind, Structure and thermal expansion of YSZ and La2Zr2O7 above 1500∘C from neutron diffraction on levitated samples, J. Am. Ceram. Soc. 98, 3381 (2015).
  35. P. Aldebert, Neutron and X-ray experiments at high temperature, Rev. Phys. Appl. (Paris) 19, 649 (1984).
  36. M. I. Ahmad, D. G. Van Campen, J. D. Fields, J. Yu, V. L. Pool, P. A. Parilla, D. S. Ginley, M. F. A. M. Van Hest, and M. F. Toney, Rapid thermal processing chamber for in-situ X-ray diffraction, Rev. Sci. Instrum. 86, 013902 (2015).
  37. H. Hayashi, T. Saitou, N. Maruyama, H. Inaba, K. Kawamura, and M. Mori, Thermal expansion coefficient of yttria stabilized zirconia for various yttria contents, Solid State Ion. 176, 613 (2005).
  38. J. A. Krogstad, Y. Gao, J. Bai, J. Wang, D. M. Lipkin, and C. G. Levi, In situ diffraction study of the high-temperature decomposition of t'-zirconia, J. Am. Ceram. Soc. 98, 247 (2015).
  39. M. Goyal and M. Singh, Size and shape dependence of optical properties of nanostructures, Appl. Phys. A 126, 176 (2020).
  40. S. H. Tolbert and A. P. Alivisatos, Size dependence of a first order solid-solid phase transition: The Wurtzite to rock salt transformation in CdSe nanocrystals, Science 265, 373 (1994).
  41. C. L. Farrow and S. J. L. Billinge, Relationship between the atomic pair distribution function and small-angle scattering: Implications for modeling of nanoparticles, Acta Crystallogr. A 65, 232 (2009).
  42. S. Banerjee, A. Zangiabadi, A. Mahdavi-Shakib, S. Husremovic, B. G. Frederick, K. Barmak, R. N. Austin, and S. J. L. Billinge, Quantitative structural characterization of catalytically active TiO2 nanoparticles, ACS Appl. Nano Mater. 2, 6268 (2019).
  43. S. Banerjee, C.-H. Liu, K. M. Ø. Jensen, P. Juhás, J. D. Lee, M. Tofanelli, C. J. Ackerson, C. B. Murray, and S. J. L. Billinge, Cluster-mining: An approach for determining core structures of metallic nanoparticles from atomic pair distribution function data, Acta Crystallogr A 76, 24 (2020).
  44. S. Tao, J. Billet, J. De Roo, and S. J. L. Billinge, Rapid modeling of the local structure of metal oxide nanoparticles from PDF data: A case study using TiO2 nanoparticles, Chem. Mater. 36, 10912 (2024).
  45. A. S. Masadeh, E. S. Božin, C. L. Farrow, G. Paglia, P. Juhás, S. J. L. Billinge, A. Karkamkar, and M. G. Kanatzidis, Quantitative size-dependent structure and strain determination of CdSe nanoparticles using atomic pair distribution function analysis, Phys. Rev. B 76, 115413 (2007).
  46. B. Guzelturk, J. Portner, J. C. Ondry, S. Ghanbarzadeh, M. Tarantola, A. Jeong, T. Field, A. M. Chandler, E. Wieman, T. R. Hopper, N. E. Watkins, J. Yu, X. Cheng, M.-F. Lin, D. Luo, P. L. Kramer, X. Shen, A. H. Reid, O. Borkiewicz, U. Ruett, et al., Ultrafast symmetry control in photoexcited quantum dots, Adv. Mater. 37, 2414196 (2025).
  47. Y. Noda, K. Masumoto, S. Ohba, Y. Saito, K. Toriumi, Y. Iwata, and I. Shibuya, Temperature dependence of atomic thermal parameters of lead chalcogenides, PbS, PbSe and PbTe, Acta Crystallogr. Sect. C 43, 1443 (1987).
  48. A. Yang, C. L. Farrow, C.-H. Liu, L. Kitsu, and S. J. L. Billinge, diffpy.morph, 2025, https://github.com/diffpy/diffpy.morph.
  49. https://groups.google.com/g/diffpy-users.
  50. A. Jeong, J. Portner, C. P. N. Tanner, J. C. Ondry, C. Zhou, Z. Mi, Y. A. Tazoui, B. Lee, V. R. K. Wall, N. S. Ginsberg, and D. V. Talapin, Colloidal dispersions of sterically and electrostatically stabilized PbS quantum dots: Structure factors, second virial coefficients, and film-forming properties, ACS Nano 18, 33864 (2024).
  51. J. Kieffer, J. Orlans, N. Coquelle, S. Debionne, S. Basu, A. Homs, G. Santoni, and D. De Sanctis, Application of signal separation to diffraction image compression and serial crystallography, J. Appl. Crystallogr. 58, 138 (2025).
  52. P. Juhas, T. Davis, C. L. Farrow, and S. J. L. Billinge, PDFgetX3: A rapid and highly automatable program for processing powder diffraction data into total scattering pair distribution functions, J. Appl. Crystallogr. 46, 560 (2013).
  53. F. Bertolotti and I. Robinson, Scientific opportunities with very hard XFEL radiation, XFEL.EU WR-2024-002 (2024).
  54. A. F. Sapnik, P. A. Chater, D. S. Keeble, J. S. O. Evans, F. Bertolotti, A. Guagliardi, L. J. Støckler, E. A. Harbourne, A. B. Borup, R. S. Silberg, A. Descamps, C. Prescher, B. D. Klee, A. Phelipeau, I. Ullah, K. G. Medina, T. A. Bird, V. Kaznelson, W. Lynn, A. L. Goodwin, et al., High-quality ultra-fast total scattering and pair distribution function data using an X-ray free-electron laser, IUCrJ 12, 531 (2025).
  55. T. Fuchs, S. P. Culver, P. Till, and W. G. Zeier, Defect-mediated conductivity enhancements in Na3−xPn1−xWxS4 (Pn = P, Sb) using aliovalent substitutions, ACS Energy Lett. 5, 146 (2020).
  56. W. Decking, in Brilliant Light in Life and Material Sciences, edited by V. Tsakanov and H. Wiedemann (Springer Netherlands, Dordrecht, 2007), pp. 21–30.
  57. A. Galler, W. Gawelda, M. Biednov, C. Bomer, A. Britz, S. Brockhauser, T.-K. Choi, M. Diez, P. Frankenberger, M. French, D. Görries, M. Hart, S. Hauf, D. Khakhulin, M. Knoll, T. Korsch, K. Kubicek, M. Kuster, P. Lang, F. Alves Lima, et al., Scientific instrument femtosecond X-ray experiments (FXE): Instrumentation and baseline experimental capabilities, J. Synch. Radiat. 26, 1432 (2019).
  58. K. Kodama, S. Iikubo, T. Taguchi, and S.-i. Shamoto, Finite size effects of nanoparticles on the atomic pair distribution functions, Acta Crystallogr. A 62, 444 (2006).
  59. M. Lei, A. M. R. de Graff, M. F. Thorpe, S. A. Wells, and A. Sartbaeva, Uncovering the intrinsic geometry from the atomic pair distribution function of nanomaterials, Phys. Rev. B 80, 024118 (2009).
  60. DiffPy team, Diffpy - atomic structure analysis in Python (2025), https://www.diffpy.org/.
  61. P. Juhás, C. L. Farrow, X. Yang, K. R. Knox, A. Yang, and S. J. L. Billinge, diffpy.utils, 2025, https://github.com/diffpy/diffpy.utils.
  62. https://diffpy.org/diffpy.morph/.
  63. diffpy.morph authors, Data used for figures in diffpy.morph manuscript [Data set], Zenodo, 2026, https://doi.org/10.5281/zenodo.20680507.

Outline

Information

Sign In to Your Journals Account

Filter

Filter

Article Lookup

Enter a citation