usnistgov / PyHyperScattering

Tools for hyperspectral x-ray and neutron scattering data loading, reduction, slicing, and visualization.
Other
7 stars 9 forks source link

feat: generalize AR calculations, chi center, polarizations, reflections #133

Open BijalBPatel opened 6 months ago

BijalBPatel commented 6 months ago

Proposed changes:

  1. Generalize Calculation beyond para, perp, and polarization framing. Allow parameters chi_1, chi_2 as optional parameters to choose where the chi wedges are centered. Default behavior will be chi_1 = 0, chi_2 = chi1 - 90, but allow users to override this. This enables more flexibility e.g., computing AR along a target chi aligned with a biaxial director, or sanity check of calculating AR aligned 45 degrees to uniaxial director. Goal is for default behavior to match current behavior.
  2. Add a flag to integrate 4 chi wedges per image, instead of 2. Presently, AR is calculated from two chi-wedges, centered on 0 +- chi_width (para) and -90 +- chi_width (perp). The proposed change would allow incorporating the reflection (so I_para is calculated from the wedges centered on 0 and 180, and I_perp is from wedges centered on 90 and -90).

Possible QOL additions:

Possible Connections with existing issues:

Existing Code for reference: https://github.com/usnistgov/PyHyperScattering/blob/6603dd403a1c48133ecc235a6ddc52f008161810/src/PyHyperScattering/RSoXS.py#L109-L151

BijalBPatel commented 5 months ago

Branch is feature complete, but there are some additions I want to make before PR.

At the earliest, i'll work on it again next Tuesday, but its open to anyone to test.