Metadata-Version: 2.4
Name: nanoBragg_noise
Version: 1.9
Summary: A command-line tool to add noise to simulated H5 data.
Author-email: Derek 'Braggling' Mendez <dermen@slac.stanford.edu>
License: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy
Requires-Dist: h5py
Requires-Dist: joblib
Dynamic: license-file

# nanoBragg_noise

This tool allows synthetic diffraction data to be stored on disk as Bragg peaks alone, with individual background files for maximum compression. It is meant to facilitate the sharing of synthetic diffraction data to drive development of novel data reduction algorithms. It adds noise and background to simulated diffraction data, specifically designed for data generated using the `datsimx.sim` script with the `--noNoise` option (see [mx_simulate.py](https://github.com/pixel-modelers/datsimx/blob/main/datsimx/mx_simulate.py)), which is a thin wrapper to a nanoBragg-style forward model.

## Usage Example

To add noise to a noiseless dataset, use the `braggaddnoise` command with the following options:

```bash
braggaddnoise --dirname simulated_scan --run 3 --nj 20

--dirname: The path to the folder containing the simulated data (e.g., simulated_scan).

--run: The run number used in the datsimx simulation (e.g., 3).

--nj: The number of parallel processes to use for faster processing.
```

The above command will find all HDF5 files matching `shots_3_*h5` in the `simulated_scan` folder, add the background to them that's stored in the file `background_3.h5`, and add noise to the result, finally overwriting the existing `sim_image` datasets.

