support code for x-ray scattering experiments