Skip to content

Load, process, and analyze Xenocs Xeuss 3.0 GIWAXS data

Notifications You must be signed in to change notification settings

ToneyGroupCU/xenocs_giwaxs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load, process, and analyze Xenocs Xeuss 3.0 GIWAXS data

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!

Overview

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

Recommended conda environment setup:

  1. 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
  2. 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
  3. Install the local cloned PyHyperScattering package into your conda environment:
    • pip install -e /path-to-PyHyperScattering-git-repository
  4. Install all required packages (this should handle pygix):
    • pip install -r /path-to-PyHyperscattering-git-repository/requirements.txt
  5. Install lmfit pip install lmfit if fitting is desired in plotting notebook

General use:

  • 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

Notes:

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

About

Load, process, and analyze Xenocs Xeuss 3.0 GIWAXS data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published