Skip to content

Support fixed pink-beam asymmetry in powder calibration#947

Merged
psavery merged 1 commit into
masterfrom
fast-powder-fix-asymmetry
Jun 19, 2026
Merged

Support fixed pink-beam asymmetry in powder calibration#947
psavery merged 1 commit into
masterfrom
fast-powder-fix-asymmetry

Conversation

@psavery

@psavery psavery commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Overview

Add an optional fixed_pink_asymmetry argument to PowderCalibrator and SpectrumModel that pins the pink-beam shape parameters (alpha/beta for dcs, sigma for heating, tau for exponential) from a prior WPPF refinement and holds them fixed during the fit.

This is needed because WPPF can often refine asymmetry parameters to very accurate values since the parameters are being refined for the entire spectrum. But in the PowderCalibrator and SpectrumModel, asymmetry parameters are refined for each peak, which can sometimes lead to unrealistic results.

Allowing the asymmetry params to be set from WPPF allows us to fix them to be realistic for powder calibration.

Affected Workflows

Powder

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.25%. Comparing base (e39aae6) to head (f370cd7).

Files with missing lines Patch % Lines
hexrd/powder/fitting/calibration/powder.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #947      +/-   ##
==========================================
+ Coverage   73.23%   73.25%   +0.01%     
==========================================
  Files         146      146              
  Lines       22683    22696      +13     
==========================================
+ Hits        16613    16625      +12     
- Misses       6070     6071       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add an optional `fixed_pink_asymmetry` argument to PowderCalibrator and
SpectrumModel that pins the pink-beam shape parameters (alpha/beta for dcs,
sigma for heating, tau for exponential) from a prior WPPF refinement and
holds them fixed during the fit.

This is needed because WPPF can often refine asymmetry parameters to
very accurate values since the parameters are being refined for the entire
spectrum. But in the PowderCalibrator and SpectrumModel, asymmetry parameters
are refined for each peak, which can sometimes lead to unrealistic results.

Allowing the asymmetry params to be set from WPPF allows us to fix them to
be realistic for powder calibration.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@saransh13 saransh13 force-pushed the fast-powder-fix-asymmetry branch from df1c03e to f370cd7 Compare June 15, 2026 18:15

@saransh13 saransh13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@psavery psavery merged commit 90c7b97 into master Jun 19, 2026
10 checks passed
@psavery psavery deleted the fast-powder-fix-asymmetry branch June 19, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants