Save powder diffraction intensity data to different output types

you should use a context manager here

```python
with open(file_path, 'wb') as f):
```