For GIWAXS data recorded with the beam at the corner of the Eiger2 1M detector! This repository is intended to provide template processing/plotting notebooks to be copied for your own data workflows. Feel free to clone or copy files directly from here.
There are two Xenocs Xeuss 3.0 GIWAXS output folders in the example_data directory. Also included are two .poni pyFAI calibration files with sample-detector-distance (sdd) set to 100 or 120 mm. These poni text files should not need to change for all Xenocs Xeuss 3.0 measurements, except for the sdd value which is easy to overwrite (units in meters).
This code is all a work-in-progress. Contributions are welcome!
Loading and processing code here requires an up-to-date PyHyperScattering version (containing the CMSGIWAXSLoader.py
and PGGeneralIntegrator.py
scripts). PyHyperScattering utilizes Xarray for convenient and consistent structuring of data, especially useful when working with large, multidimensional datasets. The core operations within PyHyperScattering are performed with pyFAI & pygix (and of course numpy).
- Clone PyHyperScattering to a chosen directory in your local machine (I like to keep all my cloned github repos in the same place):
- Enter terminal/powershell, ensure git is installed, navigate to directory where you want to clone to, then run:
git clone https://github.com/usnistgov/PyHyperScattering.git
- This step will be unecessary when the GIWAXS support code is included in published PyHyperScattering pip release
- Enter terminal/powershell, ensure git is installed, navigate to directory where you want to clone to, then run:
- Create conda environment (python >= 3.9), along with some basic packages:
conda create -n name python numpy matplotlib jupyter ipympl
- Activate your environment after creating it:
conda activate name
- Install the local cloned PyHyperScattering package into your conda environment:
pip install -e /path-to-PyHyperScattering-git-repository
- Install all required packages (this should handle pygix):
pip install -r /path-to-PyHyperscattering-git-repository/requirements.txt
- Install lmfit
pip install lmfit
if fitting is desired in plotting notebook
-
Processing notebook:
- Load raw data from recored .edf's into xarray DataArrays
- Check data, combine 'line erasor' detector images if applicable
- Stitch horizontal detector gap and average all points where data overlaps between the two images
- Rotate image so that bottom horizon is flat (if it isn't already)
- Use PyHyperScattering to apply pygix-backed transformations
- Save/export data from processed DataArrays as desired (.zarr stores recommended for moving forward with plotting notebook)
-
Plotting notebook:
- Load processed zarr stores
- Generate plots from cartesian (q_xy vs q_z) or polar (chi vs q_r) reciprocal space data
- Use lmfit for fitting peaks in selected regions of interest
- When first importing PyHyperScattering, many warnings pop up. As long as the cell executes and you are using a correct PyHyperScattering version, this is fine.