Skip to main content

midas-ff-pipeline

End-to-end pure-Python FF-HEDM workflow. Drives all the midas-* sibling packages so a single command — or a single notebook — takes raw detector zarr inputs through to Grains.csv with no C binaries on the path.

Status: 0.2.x — dataset-density-aware GPU group_size resolver and multi-process CPU sharding (--cpu-shards) for the indexer stage; real-data shakedown on Park22 + Ti-7Al. Single-detector path is fully exercised; 1-N multi-detector pinwheel layout is supported via the existing midas_diffract.HEDMForwardModel(multi_mode="panel") backend. For the unified PF + FF orchestrator see midas-pipelinemidas-ff-pipeline and midas-pipeline run --scan-mode ff invoke the same kernels.

What it does

For each FF-HEDM layer:

Stage Sibling package
HKL list generation midas-hkls
Peak finding (per detector) midas-peakfit (peakfit_torch)
Overlap merge midas-peakfit (midas-merge-peaks)
Calc radius midas-peakfit (midas-calc-radius)
Detector transforms midas-transforms (midas-fit-setup)
Cross-detector merge midas-ff-pipeline (this package)
Binning midas-transforms (midas-bin-data)
Indexing midas-index
Grain refinement midas-fit-grain
Grain consolidation + strain midas-process-grains

The cross-detector merge is the only piece this package implements itself. It concatenates per-detector spot lists and emits a side-car Spots_det.bin mapping each obs spot to its source detector (det_id), keeping the main Spots.bin byte-compatible with the C IndexerOMP so any cross-pipeline parity test still works.

Quick start

CLI

midas-ff-pipeline run \
    --params /path/to/Parameters.txt \
    --result /path/to/run_dir \
    --layers 1-1 \
    --device cuda --dtype float64

Library API

from midas_ff_pipeline import Pipeline, PipelineConfig

pipe = Pipeline(
    config=PipelineConfig(
        result_dir="/path/to/run_dir",
        params_file="/path/to/Parameters.txt",
        n_cpus=16,
        device="cuda",
        dtype="float64",
    ),
)
pipe.run()
print(pipe.layer_result.n_grains)

Notebook

See notebooks/01_smoke_walkthrough.ipynb for the simplest end-to-end demo (synthetic 50-grain Au, single detector). 02_stage_diagnostics.ipynb adds per-stage plots between cells. 03_multi_detector_demo.ipynb runs the four-detector pinwheel layout against a synthetic ground truth.

These notebooks are not shipped with pip install — get them by cloning the MIDAS repository <https://github.com/marinerhemant/MIDAS/tree/master/packages/midas_ff_pipeline/notebooks>_.

Multi-detector

from midas_ff_pipeline import Pipeline, PipelineConfig, DetectorConfig

detectors = DetectorConfig.load_many("detectors.json")
pipe = Pipeline(
    config=PipelineConfig(
        result_dir="/path/to/multi_det_run",
        params_file="/path/to/Parameters_4det.txt",
        n_cpus=16, device="cuda", dtype="float64",
    ),
    detectors=detectors,
)
pipe.run()

detectors.json:

[
  {"det_id": 1, "zarr_path": "det1.MIDAS.zip", "lsd": 1000000.0,
   "y_bc": 1024.0, "z_bc": 1024.0, "tx": 0.0, "ty": 0.0, "tz": 0.0,
   "p_distortion": [0,0,0,0,0,0,0,0,0,0,0]},
  {"det_id": 2, "zarr_path": "det2.MIDAS.zip", "lsd": 1005000.0, ...},
  {"det_id": 3, "zarr_path": "det3.MIDAS.zip", "lsd": 1010000.0, ...},
  {"det_id": 4, "zarr_path": "det4.MIDAS.zip", "lsd": 1015000.0, ...}
]

If detectors.json is absent the pipeline falls back to DetParams 1/DetParams 2/... rows in Parameters.txt (same convention as FitMultipleGrains.c).

Resume

Each layer's directory holds a midas_state.h5 provenance ledger. --resume auto skips stages whose recorded input/output hashes match the current files. --resume from:indexing deletes the indexing-stage outputs and resumes from there. midas-ff-pipeline status prints the per-stage state for a given run dir.

Relationship to ff_MIDAS.py

FF_HEDM/workflows/ff_MIDAS.py is the historical workflow that shells out to a mix of C binaries and torch tools. midas-ff-pipeline is its pure-Python successor: same stages, no C binaries, multi-detector aware out of the box. ff_MIDAS.py is left untouched for users still on the mixed path.

Download files

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

Source Distribution

midas_ff_pipeline-0.5.0.tar.gz (77.6 kB view details)

Uploaded Source

Built Distribution

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

midas_ff_pipeline-0.5.0-py3-none-any.whl (81.0 kB view details)

Uploaded Python 3

File details

Details for the file midas_ff_pipeline-0.5.0.tar.gz.

File metadata

  • Download URL: midas_ff_pipeline-0.5.0.tar.gz
  • Upload date:
  • Size: 77.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for midas_ff_pipeline-0.5.0.tar.gz
Algorithm Hash digest
SHA256 344145cb0b292b0de981c8d4fc7d0556708bdfa89c69357fb8ff442bee40329a
MD5 d09e89dcee920f8608058b973e722df5
BLAKE2b-256 87b7b4726276533069409b33b414ca1220658d44c278c2ea0c7b1fb0312d6405

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_ff_pipeline-0.5.0.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_ff_pipeline-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for midas_ff_pipeline-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6055af492b27db7e32cd907c522357b46fc702878c768f9f6ca125044000fd51
MD5 eea81a7d2fabb60abe2cdfe61454ecd3
BLAKE2b-256 2d1fabf5f828f5e4c63a01a2c2d60b4660e02f3f3f12f2234bdbe78ffc541973

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_ff_pipeline-0.5.0-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.

Release history Release notifications | RSS feed

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

This release

0.5.0 This release

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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