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

Built distribution (wheel)

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

Total release size: 145.9 kB

Release files / midas_pf_odf-0.1.3.tar.gz

Download URL midas_pf_odf-0.1.3.tar.gz
Size 80.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0f07d4ffec2357ddc89b6cd369f3781ebb216f2f53cb8622654ffd4d2f4e9577
BLAKE2b-256 checksum
How to use checksums
6d1bb58834d09dd03c99f0125dcb61c00dc1671f2b6563f055d59a4aabdce09b
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 Oct 14, 2026.

Transparency log

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

Download URL midas_pf_odf-0.1.3-py3-none-any.whl
Size 65.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f7ea9663893f1377439fc85190f8cf7afdaaff4099f05b1226eccd64d194f9b
BLAKE2b-256 checksum
How to use checksums
4bcbee1c31ba8b654c559f5531978808d82484d4a149fa09b0732449af654741
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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

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