Skip to content

Refactor i10 Powder Diffraction Data Reduction for Production #24

@Relm-Arrowny

Description

@Relm-Arrowny

Since the publication of our powder diffraction paper, there has been a significant increase in demand for powder deffraction beam time on i10. However, because the original data analysis relied on ad hoc scripts that are no longer functional, it is essential to update our data reduction software. Making the software production-ready will ensure it is accessible and reliable for a broader range of users.

Goals

Acceptance criteria : What journeys should the user be able to complete to consider your feature done
Be as specific as you can, check them off once they work. Add more if you find more requirements during development. Issue should only be considered done after all of them are checked

  • A set of api tools so that user can perform the data reduction with the correct beamline parameters.
  • A jupyter example for using the api.

Function flow

Read hdf data for each tth angle sum them up to generate a single image for each two theta.
Apply correction to the summed data.
Reduce the data two 1d sections.
Join the 1d section together.

Tasks

base on the goals, deduce the tasks required. check them off once they're done

  • Remove Hardcoded Paths: Replace all C:\Users\wvx67826\... strings with dynamic path handling (using argparse or pathlib).
  • Update Dependencies: Ensure compatibility with modern pyFAI ($2024.x+$) and Python 3.10+.
  • Environment Spec: Provide a requirements.txt or environment.yml for one-click setup.

2. Data Robustness

  • Improved Regex Parsing: Replace fragile split("=") logic with a robust regex to extract tth (theta) values from varied filenames.
  • Batch Processing: Enable the user to process a directory of TIFF images in a single loop.
  • Input Validation: Implement check for existence of .poni and .TIFF files before execution starts.

3. Integration & Calibration

  • Refinement Module: Encapsulate GoniometerRefinement into a reusable function/class.
  • Standardized Export: Support data export to .xy formats for Rietveld refinement compatibility.
  • Metadata Logging: Automatically save a JSON log of the parameters used (dist, poni, wavelength) for every run.

4. Documentation

  • README: Add a brief guide on how to run the script via Command Line.
  • Example Data: Include a small "test" folder with 1-2 images to verify the pipeline.

Related Resources

  • Legacy Dependencies: pyFAI 0.19.0, fabio, matplotlib.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions