New save output

Saving diffraction intensities into different file formats
Added the helper function