Jupyter‑friendly helpers for visualising, analysing and cleaning the dual‑stream HDF5 data generated by the DIAD beamline at Diamond Light Source.
- Inspect radiography and diffraction frames side‑by‑side in an interactive widget.
- Click‑to‑plot 1‑D diffraction profiles mapped to any pixel in the radiograph.
- Batch peak‑find / integrate hundreds of patterns and export CSV or pickle.
- Flat‑field & dark‑correct radiography stacks in seconds.
- Pure‑Python stack built on familiar libraries (
numpy,h5py,matplotlib,ipywidgets).
git clone https://github.com/DIAD-beamline/DataPostprocessing.git
cd DataPostprocessingpython -m venv diad_vis
source diad_vis/bin/activate # Linux/macOS
diad_vis\Scripts\activate # Windowspip install -r requirements.txt
# or, manually:
pip install numpy h5py matplotlib ipywidgets ipympl scipy pillow tifffileNote: On Diamond’s analysis cluster simply
module load pythonthenpip install --user -r requirements.txt.
jupyter lab # or jupyter notebookOpen one of the ExampleNotebook_* notebooks and run the first cell. A small GUI will pop up asking you to select your .h5 dataset.
| Task | Notebook | What you get |
|---|---|---|
| Visual exploration & annotation | ExampleNotebook_DiffractionDataExplorer.ipynb |
Scroll through projections, click the sample image to see its diffraction, overlay multiple profiles, save PNGs. |
| Batch peak analysis | ExampleNotebook_DiffractionDataAnalysis.ipynb |
Load ROI‑averaged 1‑D profiles, detect peaks, integrate intensities, export results table and plots. |
| Radiography normalisation | ExampleNotebook_RadiographyDataNormalize.ipynb |
Apply dark subtraction, flat‑field division, optional median filter; outputs TIFF stack ready for reconstruction. |
DataPostprocessing/
├── diffractionDataExplorer_class.py
├── diffractionDataAnalysis_class.py
├── radiographyDataNormalize_class.py
├── notebooks/
│ ├── ExampleNotebook_DiffractionDataExplorer.ipynb
│ ├── ExampleNotebook_DiffractionDataAnalysis.ipynb
│ └── ExampleNotebook_RadiographyDataNormalize.ipynb
├── tests/
└── README.md
Bug reports, feature requests and pull requests are very welcome! Please open an issue first if you plan major changes.
- Fork the repo
- Create a feature branch:
git checkout -b awesome‑feature - Commit and push:
git push origin awesome‑feature - Open a pull request
Distributed under the MIT License. See LICENSE for details.
If this toolkit helps your research, please cite:
Watch this space
Questions? Open an issue or reach us at diad@diamond.ac.uk.
This software was developed by the DIAD beamline team and the wider Diamond Light Source community.