Save powder diffraction intensity data to different output types

This seems to have been copy/pasted from elsewhere.