Skip to main content

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.txt the refiner consumes — the latter omits OmegaStep, NrFilesPerSweep and NrPixelsY/Z, which the forward model needs. Without them every predicted spot is invalid and you get matched spots = 0. (A guard raises on OmegaStep == 0 rather 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.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for midas-joint-ff-calibrate 0.4.3
File Size Uploaded
midas_joint_ff_calibrate-0.4.3.tar.gz 105.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for midas-joint-ff-calibrate 0.4.3
File Interpreter ABI Platform
midas_joint_ff_calibrate-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 197.3 kB

Release files / midas_joint_ff_calibrate-0.4.3.tar.gz

Download URL midas_joint_ff_calibrate-0.4.3.tar.gz
Size 105.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dd838642b4f90f996fd88a0447ee60a192c79beb4c48a0f72d3d5aebfc6224aa
BLAKE2b-256 checksum
How to use checksums
c7115d56f3e12b17197d9beb613fb8ca58e83d7ce7dbb54e83089b7b27b04e31
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 Sep 10, 2026.

Transparency log

Release files / midas_joint_ff_calibrate-0.4.3-py3-none-any.whl

Download URL midas_joint_ff_calibrate-0.4.3-py3-none-any.whl
Size 92.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
782c41f8fc032c4bd2f8ee82537be17748607d0ffe3415c672516a02004d1623
BLAKE2b-256 checksum
How to use checksums
4eef5ac3cd31ad5af968ab6acc85ca72fb2deb9a74aa8c53cba08195566a987e
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 Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page