Skip to main content

midas-pf-odf

Joint per-grain peak-shape inversion of pf-HEDM (point-focused HEDM, also known as scanning 3DXRD) data.

Phase 1 (current): for each grain, fit all of its voxels' (R_V, ε_V) jointly to image-MSE on measured 3D peak patches, given voxel→grain assignment as input. Differentiable PyTorch forward; voxel-summed splat per (spot, scan); closed-form per-spot intensity scale c_s*.

Phase 2 (later): per-voxel ODF (sub-grain mosaic / GND density) on the same forward.

Notebooks

Worked-example Jupyter notebooks live in notebooks/. They are not shipped with pip install — get them by cloning the MIDAS repository.

Status

Pre-alpha; private. See dev/RESTART.md for the active worklog and resume point.

Where this sits relative to the literature

Henningsson et al. 2020 (J. Appl. Cryst.) introduced PCR / ASR — joint multi-voxel intragranular strain reconstruction from scanning 3DXRD, using peak centroids only. They explicitly call out peak-shape inversion as the next direction (untapped at time of writing). This package takes that step:

  • Centroid → peak-shape (image-MSE on (F, P, P) patches).
  • Hand-derived Jacobian → autograd / PyTorch.
  • Single (R_V, ε_V) per voxel → per-voxel ODF (Phase 2).

The forward model is midas_diffract.HEDMForwardModel; reusable infrastructure (sparse splatter, ODF parameterizations, held-out CV selector, sparse-tile chunking) comes from midas_grain_odf.

Quickstart

cd packages/midas_pf_odf
pip install -e .[dev]
python -m pytest tests/ -xvs

Layout

midas_pf_odf/        — public library
    simulate.py       — synthetic plant (orientation+strain gradients, multi-grain, noise)
    forward.py        — joint per-grain forward (soft beam gate, voxel-summed splat)
    inversion.py      — joint inversion driver (Adam / L-BFGS, identifiability knobs)
    validation.py     — per-voxel RMSE vs plant, held-out R²
    io.py             — I/O for real data (deferred)
dev/                  — implementation plan, paper, notebooks, worklog
tests/                — synthetic round-trip tests

Decisions locked

  1. Identifiability knob: project ε to mean-zero per grain (default, recommended) or per-voxel-lattice over-parameterized (toggle).
  2. Smoothness regularizer: off by default (λ_smooth = 0).
  3. Synthetic source: torch-native simulator inside this package.
  4. Outlier voxels: soft-mask by held-out R² in the loss.
  5. Multi-grain parallelism: one grain × one GPU each via parsl (deferred until workflow integration).
  6. Output schema: parallel HDF5; centroid path untouched (deferred).

Metadata

Release files for midas-pf-odf 0.1.2

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-pf-odf 0.1.2
File Size Uploaded
midas_pf_odf-0.1.2.tar.gz 78.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for midas-pf-odf 0.1.2
File Interpreter ABI Platform
midas_pf_odf-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 142.5 kB

Release files / midas_pf_odf-0.1.2.tar.gz

Download URL midas_pf_odf-0.1.2.tar.gz
Size 78.1 kB
Tags Source
SHA-256 checksum
How to use checksums
16e42450b0320f9da98656bee681a64000bf7c7f8a1947762cdc4400749e5512
BLAKE2b-256 checksum
How to use checksums
b654ecbc3536435b9fd1e06b4983d0c3ca8212c090933b5c5232d5b62be278c6
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 30, 2026.

Transparency log

Release files / midas_pf_odf-0.1.2-py3-none-any.whl

Download URL midas_pf_odf-0.1.2-py3-none-any.whl
Size 64.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94218f729dcc2105982ed512bf50316d73f6ea18ca3d7309e50d10fba5a58c1e
BLAKE2b-256 checksum
How to use checksums
68ff4e7118828b5ee7cbdb429fd43a6c88c9771c83702202578cb77aa2dd7c0a
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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