Metadata-Version: 2.4
Name: midas-snapshot
Version: 0.1.0
Summary: Still-frame (no rotation) diffraction time series: per-frame matrix scale and halo traces, calibrated sparse-spot detection, feature linking, measured detection limits and candidate-cell tests with nulls and negative controls.
Author: MIDAS maintainers
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/marinerhemant/MIDAS
Project-URL: Documentation, https://github.com/marinerhemant/MIDAS/tree/master/manuals/snapshot-xrd
Project-URL: Issues, https://github.com/marinerhemant/MIDAS/issues
Keywords: MIDAS,diffraction,in situ,still frames,single shot,synchrotron
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.22
Requires-Dist: scipy>=1.9
Requires-Dist: tifffile>=2023.0
Requires-Dist: midas-peakfit>=0.7.0
Requires-Dist: midas-hkls>=0.16.0
Requires-Dist: midas-integrate-v2>=0.8.0
Requires-Dist: midas-defect>=0.8.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Provides-Extra: plot
Requires-Dist: matplotlib>=3.5; extra == "plot"
Dynamic: license-file

# midas-snapshot

Still-frame diffraction time series, where the sample does not rotate: monochromatic beam, an
area detector, one frame or a series. The patterns are spotty or sparse, so radial lineouts
lose the signal.

For each window of frames, the pipeline:

1. fits one isotropic scale of a known matrix phase from its rings (a relative thermometer);
2. computes a diffuse-halo index (melt / amorphous indicator);
3. detects spots with a background model that is local and a threshold calibrated on
   noise-only images;
4. places each spot relative to the matrix lines.

Downstream stages:

- choose before/after windows from the traces by a stated rule;
- merge repeated detections into features, and test "present before / absent after" on raw
  photon counts;
- test candidate cells with a null and automatically generated negative controls;
- measure the detection limit by injecting synthetic spots into real frames.

```
midas-snapshot init --frames DIR --geometry params.txt --out OUT --matrix-cif matrix.cif \
                    --halo-band 2.9 3.2 --base-band 1.9 2.2 --tth-max 12
midas-snapshot run OUT/snapshot_config.json
midas-snapshot analyse OUT/snapshot_config.json --candidates cand1.cif cand2.cif --controls
midas-snapshot report OUT/snapshot_config.json
```

What the method cannot do:

- It cannot give an absolute temperature: thermal and uniform elastic dilatation shift peaks
  identically.
- It cannot give a strain tensor from one still.
- It cannot identify a phase from one line.
- A passing candidate identifies a cell and pattern, not a chemistry.

The procedure and its measured limits are in `manuals/snapshot-xrd/`.
