powder diffraction data analysis functions