HEXRD / hexrd

A cross-platform, open-source library for the analysis of X-ray diffraction data.
Other
56 stars 25 forks source link

Add option to set eta_step size for eta omega maps #573

Closed psavery closed 11 months ago

psavery commented 1 year ago

It was previously fixed to 0.25 degrees. However, the users may find it beneficial to change this.

Smaller eta_step sizes might lead to less overlap between neighboring peaks in the eta omega maps, for example.

psavery commented 1 year ago

Although this works, I found an issue with modifying eta_step. Detectors that have a split in eta (i. e., contain -180 next to 180) don't appear correct for smaller eta_step values, such as 0.05. I believe the issue is here

The problem is that for a detector split in eta, we need to remap the angles to be increasing with no gap. So, for instance, for dexelas, ff2 needs to go from 98.5 degrees to 261.5 degrees.

Something in the logic in that function is breaking for small eta_step so that the eta values don't get ordered correctly, and that's making the histogram look wrong. We need to fix that issue.

psavery commented 11 months ago

@donald-e-boyce This is working now.

psavery commented 11 months ago

For reference, here are eta omega maps produced using different eta steps. A smaller eta step produces a higher resolution along the eta axis. The default eta value is 0.25, and that was hardcoded before this PR.

1.0

1 00_eta

0.25

0 25_eta

0.05

0 05_eta

0.01

0 01_eta

psavery commented 11 months ago

@donald-e-boyce I made your suggested changes and removed the histogramming entirely. It seems to work well! This is ready for your review.

psavery commented 11 months ago

Unfortunately, removing the histogramming appears to have changed two things:

  1. The places where eta doesn't lie on a detector used to be np.nan, but not after these changes (it is 0 instead)
  2. The actual data appears different. The new data has fewer spots. I don't immediately know why.
psavery commented 11 months ago

@donald-e-boyce helped me fix this.

The only potential issue is that, for a small eta step, there are some nans on the detector plates. However, indexing still worked fine. We will explore fixing this in the future, if needed.