Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,723 changes: 6,723 additions & 0 deletions fitpksEiger_pyFAI_2026.9.0.dev0+1e06043e4.ipynb

Large diffs are not rendered by default.

42 changes: 41 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,44 @@ They work by fitting the diffraction geometry for a series of images of powder p
You will need to edit/modify them for any other detector geometry.
If you can log in at ESRF you can find the data files referenced here, otherwise at Zenodo : [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6344000.svg)](https://doi.org/10.5281/zenodo.6344000).

Uploaded to github on 6 Dec 2021 by Jon Wright.
Uploaded to github on 6 Dec 2021 by Jon Wright.

## Addendum, September 2026: `fitpksEiger_pyFAI_2026.9.0.dev0+1e06043e4.ipynb`

This notebook is a copy of `fitpksEiger.ipynb` (the ImageD11-based module-geometry fit is
unchanged, cell for cell, apart from one deliberate fix noted inline with `# FIXED !!!!`:
the pyFAI spatial-distortion file now uses pyFAI's own 0-to-1 pixel-corner convention
instead of the original -0.5/+0.5 one). It appends a full cross-check of the result against
pyFAI:

- converts the converged ImageD11 geometry to a pyFAI PONI file, using pyFAI's own
`pyFAI.geometry.imaged11` ImageD11<->pyFAI conversion helpers, referencing the corrected
spatial file;
- compares peak positions computed by ImageD11 and by pyFAI's `Geometry.tth`/`chi` for the
same peaks, converged geometry, and reference CeO2 rings (should - and does - agree to a
few 0.1 mdeg, since this checks the conversion, not two independently-fitted geometries);
- as a third, independent check that doesn't touch ImageD11's peaksearch at all: runs
`integrate2d` directly on the raw calibration image and computes a background-subtracted,
per-azimuth-bin peak centroid for every visible CeO2 ring, with contaminated bins (those
whose region-of-interest touches a masked/gap pixel or the detector edge, grown by 1
pixel) detected and excluded rather than averaged over.

**To reproduce**, in addition to what the original notebooks above already need:

- **pyFAI from source, not a release.** The ImageD11<->pyFAI conversion
(`pyFAI.geometry.imaged11`) lives only on an as-yet-unmerged branch:
[`kif/doc_calib_ID11`](https://github.com/kif/pyFAI/tree/doc_calib_ID11) off
[silx-kit/pyFAI](https://github.com/silx-kit/pyFAI), specifically commit `1e06043e4`
("upgrade tutorial"; `pyFAI.version` reports `2026.9.0-dev0`). Build/install pyFAI from
that checkout (`pip install -e .` or a meson-python editable install) rather than from
PyPI/conda.
- **The raw calibration image**, in addition to the `eigerSpatial/*.flt` peak files the
original notebooks already regenerate: the notebook's final integrate2d cross-check reads
frame index 1 of `scan0001/eiger_0000.h5` directly (same beamtime/dataset as everything
else here - ESRF path `/data/id11/nanoscope/blc12841/id11/CeO2/CeO2_Spatial_distortion_apr2021/`,
or the corresponding file in the Zenodo record linked above if running outside ESRF), plus
`hdf5plugin` to read it (bitshuffle/LZ4-compressed Eiger data).

Everything else the notebook produces along the way (`newspatial_pyFAI.h5`, `1.poni`,
`fitted_eiger_pars2.dat`, etc.) is generated by the notebook itself; nothing else needs to
be supplied by hand.