midas-joint-ff-calibrate
Joint differentiable powder + FF-HEDM detector calibration.
The single-image powder calibration problem (Wright, Giacobbe & Lawrence
Bright 2022 § 3; midas_calibrate_v2 paper § 9) is rank-deficient on
per-panel (δy, δz) shifts: each panel's η coverage is too narrow to break
the radial-vs-azimuthal degeneracy without translating the detector to
multiple distances. For a ~100 kg detector on a translation stage that's
impractical.
This package solves the same problem at a single distance by combining the
calibrant powder image with a co-located HEDM grain-fit dataset. HEDM spots
are determinate in (R, η) and distribute across all panels at varied
azimuth, so the joint Fisher block on per-panel shifts becomes full rank.
The same machinery generalises to refining any subset of the unified spec —
geometry, distortion, panels, wavelength, per-grain orientation/position/
strain, or arbitrary user-defined blocks.
Notebooks
Worked-example Jupyter notebooks live in notebooks/. They are not shipped with pip install — get them by cloning the MIDAS repository.
Start with 05_grain_tx_from_grains
if you have an FF reconstruction in hand — it covers the one geometry parameter
a powder calibration can never give you (tx), why it matters, and how to
refine it. Notebooks 00–04 build up the joint-calibration theory behind the
IUCrJ paper.
Grain-based tx — the powder-blind geometry
Powder/calibrant calibration cannot determine tx, the in-plane detector
rotation about the beam: Debye–Scherrer rings are rotationally symmetric about
that axis, so every value of tx fits equally well. Only single-crystal spots
break the symmetry. An FF reconstruction calibrated on a standard therefore
runs with tx = 0, and correcting it is a genuine second calibration pass.
midas-joint-ff-calibrate grain-tx \
--paramstest master_ff_params.txt \
--layer-dir recon/LayerNr_1 \
--refine tx --kind angular --max-grains 50 \
--out recon/LayerNr_1/paramstest_graintx.txt
Pass the master FF parameter file, not the stripped per-layer
paramstest.txtthe refiner consumes — the latter omitsOmegaStep,NrFilesPerSweepandNrPixelsY/Z, which the forward model needs. Without them every predicted spot is invalid and you getmatched spots = 0. (A guard raises onOmegaStep == 0rather than failing silently.)
Also available as refine_geometry_from_grains() (library) and as an optional
FF pipeline stage (midas-pipeline run ... --grain-geometry-run). tx enters
at the transforms step, so benefiting from it means re-running the
reconstruction with the corrected file. Only tx and Wedge can be refined
here; see the notebook's Limitations section.
Architecture
midas_peakfit (shared substrate)
ParameterSpec / pack / lm / laplace / TPSpline / Σ=0
▲ ▲
│ │
midas_calibrate_v2 midas_fit_grain
(powder forward + loss) (HEDM forward + loss)
▲ ▲
└──────────┬────────────┘
│
midas_joint_ff_calibrate
(joint spec / loss / drivers)
Pure-Python, fully autograd-traced. No legacy C code (FitMultipleGrains.c
is not used).
Drivers
pipelines.alternating.AlternatingDriver— the recommended default. Outer loop alternates between (geometry + grain orientation/position) and (grain strain) passes. Cheap, robust.pipelines.full_joint.FullJointDriver— refine every refined parameter at once with a single LM call; report MAP plus Laplace covariance.pipelines.identifiability.fisher_block_rank— diagnostic that reports rank, condition number, and σ per parameter on a user-chosen Fisher block under powder-only, HEDM-only, or joint evidence.
Status
Pre-alpha. Companion paper to the J. Appl. Cryst. submission of
midas_calibrate_v2 (paper 3); see dev/paper/.
Metadata
Release files for midas-joint-ff-calibrate 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| midas_joint_ff_calibrate-0.2.0.tar.gz | 77.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| midas_joint_ff_calibrate-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 156.5 kB
Release files / midas_joint_ff_calibrate-0.2.0.tar.gz
| Download URL | midas_joint_ff_calibrate-0.2.0.tar.gz |
|---|---|
| Size | 77.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c60119fa8df75bf68694c3d3ef163b60ca29562ca8b66c8f7858db88070bdf3e
|
|
BLAKE2b-256 checksum How to use checksums |
9eb2d27b47783f48c6cc37deff612abb23dcec7be73125766b1178fe24c182bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / midas_joint_ff_calibrate-0.2.0-py3-none-any.whl
| Download URL | midas_joint_ff_calibrate-0.2.0-py3-none-any.whl |
|---|---|
| Size | 79.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0f1994bf1a598db210c4785c32c7dcb8deaa5ed7c7c76497570dfe7549d255c
|
|
BLAKE2b-256 checksum How to use checksums |
3d4b9751176fdf4a5313d0593aaef51ee83311de484123d859a8ef320ef6b7e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log