Skip to main content

Joint differentiable powder + FF-HEDM detector calibration for MIDAS. Breaks single-distance per-panel rank-1 degeneracy by combining a powder calibrant pseudo-strain residual with HEDM grain spot residuals in one Bayesian MAP + Laplace inference. Pure-Python, fully autograd-traced; consumes the shared midas_peakfit substrate (ParameterSpec, lm_minimise, laplace_at_map, TPSpline, zero_sum_residual) plus midas_calibrate_v2 (powder forward + pseudo_strain) and midas_fit_grain (HEDM spot forward).

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

midas_joint_ff_calibrate-0.1.6.tar.gz (69.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midas_joint_ff_calibrate-0.1.6-py3-none-any.whl (73.2 kB view details)

Uploaded Python 3

File details

Details for the file midas_joint_ff_calibrate-0.1.6.tar.gz.

File metadata

  • Download URL: midas_joint_ff_calibrate-0.1.6.tar.gz
  • Upload date:
  • Size: 69.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for midas_joint_ff_calibrate-0.1.6.tar.gz
Algorithm Hash digest
SHA256 209a54dfa59d43e85fcdb663a5f3ba232902482f457f8f6cf4b2d0c8859d9ffc
MD5 4450d5be643bc2d8bbcf8494a4623700
BLAKE2b-256 88416a0cac6f910fe14458df146eca8ae58a0ed6358efd370866118a20882829

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_joint_ff_calibrate-0.1.6.tar.gz:

Publisher: python-packages.yml on marinerhemant/MIDAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file midas_joint_ff_calibrate-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for midas_joint_ff_calibrate-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bffc8fcdf066e6b918b5b52b7d394279d09d8f3314dec39560b8fbbb23d886fb
MD5 b8ac1faf598b84fbe50350e05f5a679d
BLAKE2b-256 924152365fdf0d4f171205962731f5093602d4922ce80a1d1149e99763a0aa4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_joint_ff_calibrate-0.1.6-py3-none-any.whl:

Publisher: python-packages.yml on marinerhemant/MIDAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page