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

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.3.0
File Size Uploaded
midas_joint_ff_calibrate-0.3.0.tar.gz 79.7 kB Details

Built distribution (wheel)

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

Total release size: 161.0 kB

Release files / midas_joint_ff_calibrate-0.3.0.tar.gz

Download URL midas_joint_ff_calibrate-0.3.0.tar.gz
Size 79.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7d0435e5bb5df6588db0d451c63671050f22f75dea36b985c6319f2dbaa62320
BLAKE2b-256 checksum
How to use checksums
31a305e525030aa41adb34b60488413451f6dddc88fe219b07285c4faef79295
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 18, 2026.

Transparency log

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

Download URL midas_joint_ff_calibrate-0.3.0-py3-none-any.whl
Size 81.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ebcdc53162f52d28c2a57153146f988392f1059f954f4b1e30b0450e69201c2
BLAKE2b-256 checksum
How to use checksums
856f41ed61fefbf892926fbaf3139808d084f4e7508dfd5ae3d5bb1ec8ec5b34
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 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.0 This release

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