Save powder diffraction intensity data to different output types

use a context manager here too