New save output

Saving diffraction intensities into different file formats
This should check that `err`, if it is given is the same length.