Skip to content

sia104/DiffractionDataVisuliser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DIAD Diffraction & Radiography Data Toolkit

Jupyter‑friendly helpers for visualising, analysing and cleaning the dual‑stream HDF5 data generated by the DIAD beamline at Diamond Light Source.

Features

  • 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).

Installation

1. Clone this repository

git clone https://github.com/DIAD-beamline/DataPostprocessing.git
cd DataPostprocessing

2. Create & activate a virtual environment (optional but recommended)

python -m venv diad_vis
source diad_vis/bin/activate   # Linux/macOS
diad_vis\Scripts\activate      # Windows

3. Install dependencies

pip install -r requirements.txt
# or, manually:
pip install numpy h5py matplotlib ipywidgets ipympl scipy pillow tifffile

Note: On Diamond’s analysis cluster simply module load python then pip install --user -r requirements.txt.


Quick Start

jupyter lab      # or jupyter notebook

Open one of the ExampleNotebook_* notebooks and run the first cell. A small GUI will pop up asking you to select your .h5 dataset.


Typical Workflows

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.

Repository Structure

DataPostprocessing/
├── diffractionDataExplorer_class.py
├── diffractionDataAnalysis_class.py
├── radiographyDataNormalize_class.py
├── notebooks/
│   ├── ExampleNotebook_DiffractionDataExplorer.ipynb
│   ├── ExampleNotebook_DiffractionDataAnalysis.ipynb
│   └── ExampleNotebook_RadiographyDataNormalize.ipynb
├── tests/
└── README.md

Contributing

Bug reports, feature requests and pull requests are very welcome! Please open an issue first if you plan major changes.

  1. Fork the repo
  2. Create a feature branch: git checkout -b awesome‑feature
  3. Commit and push: git push origin awesome‑feature
  4. Open a pull request

License

Distributed under the MIT License. See LICENSE for details.


Citation

If this toolkit helps your research, please cite:

Watch this space


Contact

Questions? Open an issue or reach us at diad@diamond.ac.uk.


Acknowledgments

This software was developed by the DIAD beamline team and the wider Diamond Light Source community.

About

Python notebook or scripts for common postprocessing of DIAD diffraction data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 97.6%
  • Python 2.4%