X-ray Scattering Analysis Tools — a Dash web app for reducing and analyzing fixed-energy and resonant X-ray scattering (SAXS/WAXS/GI-SWAXS) data from synchrotron beamlines.
| Tab | Description |
|---|---|
| PTable | Periodic table element lookup |
| XAS Calculations | Sample-stack transmission/attenuation calculations across an energy range, via XrayDB |
| Scattering 2D & 1D | The core scattering tool: upload a detector image (and optionally a .poni calibration file), set up pyFAI geometry, and run azimuthal integration.
|
| Grazing Incidence (GI-SWAXS) | Promotes the shared pyFAI integrator to a FiberIntegrator for grazing-incidence geometry (incident/tilt angle, sample orientation).
|
| Resonant Scattering | Load a folder of detector images spanning an energy series (energy parsed from each filename); per-file 2-D/1-D preview with the wavelength overridden from that file's own energy, an ROI accumulator on the pixel-space image, a background NEXAFS job (ROI intensity vs. energy), and a background energy-colored 1-D overlay across the whole series |
| Batch SWAXS | Run 1-D and/or 2-D q-space processing over a whole folder of detector images in the background (with a live progress bar); choose either the Scattering 2D & 1D (azimuthal) or Grazing Incidence (fiber) integrator, reusing that tab's geometry/regions |
| SWAXS Merging | Average multiple integrated profiles and merge/splice two averaged profiles together |
Requires Python 3.
macOS / Linux:
git clone https://github.com/josecdiazm/XraySA.git
cd XraySA
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtWindows (PowerShell):
git clone https://github.com/josecdiazm/XraySA.git
cd XraySA
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txtNotes for Windows:
- If
Activate.ps1fails because script execution is disabled, runSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypassonce, then retry the activation line. - If
pythonisn't recognized, or points to an unexpected install (e.g. MSYS2/Git Bash's Python instead of a normal Windows one), checkGet-Command python -Allto see everypython.exeon your PATH, and either reorder PATH or invoke the correct one directly by its full path, e.g.& "C:\Users\<you>\AppData\Local\Programs\Python\Python3xx\python.exe" -m venv venv. - The clone URL above uses HTTPS, not SSH — it works with no GitHub login
or SSH key needed, since this repo is public. If you get a
Permission denied (publickey)error, you're likely using angit@github.com:...-style SSH URL instead; switch to the HTTPS one shown here.
python app.pyThe app runs at http://127.0.0.1:8050.
If you cloned this repo with git, pull the latest changes and reinstall
dependencies (in case new ones were added):
cd XraySA
git pull
pip install -r requirements.txtIf you instead downloaded a ZIP of the repo rather than using git clone,
there's no update command — download a fresh ZIP from
the repo's main branch
and replace the old folder. If you expect to update regularly, it's worth
switching to git clone once so future updates are just git pull.
- Built on pyFAI for detector calibration/azimuthal integration and fabio for reading detector image formats (edf, cbf, tif, etc.), in addition to
.npy/.npz. - Batch SWAXS uses Dash's background callbacks (
dash[diskcache]) for progress bars on long-running batch jobs. - Folder inputs (Batch SWAXS, SWAXS Merging) can be filled via a native folder-picker dialog, cross-platform through tkinter, run in a subprocess to avoid freezing the app.
- File inputs (Resonant Scattering, SWAXS Merging, Batch SWAXS) also support drag-and-drop as an alternative to browsing.
- This is a local-only tool (server and browser on the same machine) — it is not hardened for exposure on a network.