From 241ff2c839188a581872e788973815a76e5f3f2e Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Sun, 22 Jun 2025 16:12:42 -0400 Subject: [PATCH] Provide omega period to fitGrain This does change the results of fit-grains slightly. We are currently assessing the changes. The chi-squared remained nearly the same. For one grain, it increased very slightly, and for another grain, it decreased very slightly. Signed-off-by: Patrick Avery --- hexrd/fitgrains.py | 6 ++++-- hexrd/fitting/grains.py | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hexrd/fitgrains.py b/hexrd/fitgrains.py index caa2a7e3..ceaa9e4a 100644 --- a/hexrd/fitgrains.py +++ b/hexrd/fitgrains.py @@ -216,7 +216,8 @@ def fit_grain_FF_reduced(grain_id): else: grain_params = fitGrain( grain_params, instrument, culled_results, - plane_data.latVecOps['B'], plane_data.wavelength + plane_data.latVecOps['B'], plane_data.wavelength, + omePeriod=ome_period, ) # get chisq # TODO: do this while evaluating fit??? @@ -289,7 +290,8 @@ def fit_grain_FF_reduced(grain_id): if num_refl_valid > 12: grain_params = fitGrain( grain_params, instrument, culled_results_r, - plane_data.latVecOps['B'], plane_data.wavelength + plane_data.latVecOps['B'], plane_data.wavelength, + omePeriod=ome_period, ) # get chisq # TODO: do this while evaluating fit??? diff --git a/hexrd/fitting/grains.py b/hexrd/fitting/grains.py index 37169f79..9a394776 100644 --- a/hexrd/fitting/grains.py +++ b/hexrd/fitting/grains.py @@ -74,11 +74,6 @@ def fitGrain(gFull, instrument, reflections_dict, DESCRIPTION. """ - # FIXME: will currently fail if omePeriod is specifed - if omePeriod is not None: - # xyo_det[:, 2] = rotations.mapAngle(xyo_det[:, 2], omePeriod) - raise RuntimeError - gFit = gFull[gFlag] # objFuncFitGrain can run *significantly* faster if we convert the