Skip to content

Add MultiInstrumentCalibrator#950

Open
psavery wants to merge 2 commits into
masterfrom
multi-instrument-calibrator
Open

Add MultiInstrumentCalibrator#950
psavery wants to merge 2 commits into
masterfrom
multi-instrument-calibrator

Conversation

@psavery

@psavery psavery commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Overview

This can calibrate multiple instruments simultaneously, while only allowing a small subset of instrument parameters to vary, or grain/material parameters to vary.

Currently, the HEDM sample stage parameters (sample stage translation and chi) are the only instrument parameters which can vary between instruments. Otherwise, the detector tilts/translations and other parameters are shared and stay fixed between instruments. Even though only the sample stage parameters can currently be varied separately, it is relatively straightforward to extend this to other detector parameters too, as needed (we just need a unique prefix per detector).

This is being used for a particular experiment done at CHESS, where a 3-grain ruby sample was scanned at 50 different sample stage locations. In this case, the detector parameters should all remain constant, and only the sample stage location vary between them. It is actually going to be very helpful for determining a good standard set of relative tilts/translations between subpanels for the Eiger.

Affected Workflows

Core (new feature only)

psavery added 2 commits June 24, 2026 22:19
This can calibrate multiple instruments simultaneously, while only
allowing a small subset of instrument parameters to vary, or
grain/material parameters to vary.

Currently, the HEDM sample stage parameters (sample stage translation
and chi) are the only instrument parameters which can vary between
instruments. Otherwise, the detector tilts/translations and other
parameters are shared and stay fixed between instruments. Even
though only the sample stage parameters can currently be varied
separately, it is relatively straightforward to extend this to
other detector parameters too, as needed (we just need a unique
prefix per detector).

This is being used for a particular experiment done at CHESS, where
a 3-grain ruby sample was scanned at 50 different sample stage locations.
In this case, the detector parameters should all remain constant, and
only the sample stage location vary between them. It is actually going
to be very helpful for determining a good standard set of relative
tilts/translations between subpanels for the Eiger.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Adds an optional `ome_step` to GrainCalibrator/sxcal_obj_func; when set, the
omega residual is scaled by pixel_size/ome_step so a one-frame error counts
like a one-pixel xy error. Defaults to None (unweighted), so existing
behavior is unchanged.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@psavery psavery force-pushed the multi-instrument-calibrator branch from 7a0f1f9 to 83c223b Compare June 24, 2026 14:40
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.42975% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.42%. Comparing base (90c7b97) to head (83c223b).

Files with missing lines Patch % Lines
hexrd/core/fitting/calibration/instrument.py 87.36% 12 Missing ⚠️
hexrd/hedm/fitting/calibration/grain.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #950      +/-   ##
==========================================
+ Coverage   73.36%   73.42%   +0.05%     
==========================================
  Files         148      148              
  Lines       22805    22907     +102     
==========================================
+ Hits        16732    16820      +88     
- Misses       6073     6087      +14     

☔ 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.

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.

1 participant