Py fai matchup sept2026 - #3
Open
jonwright wants to merge 2 commits into
Open
Conversation
fitpksEiger_pyFAI_2026.9.0.dev0+1e06043e4.ipynb reproduces the ImageD11 fit from
fitpksEiger.ipynb unchanged (one intentional fix, marked inline with
`# FIXED !!!!`: the pyFAI spatial file now uses pyFAI's own 0-to-1 pixel-corner
convention rather than the original -0.5/+0.5 one), then adds a full independent
cross-check: conversion of the converged geometry to a pyFAI PONI via
pyFAI.geometry.imaged11, a peak-by-peak ImageD11-vs-pyFAI tth comparison, and a
third check via integrate2d directly on the raw image with proper exclusion of
bins contaminated by masked/gap pixels or the detector edge.
To reproduce, beyond what fitpksEiger.ipynb / moduleSpatialPeakSearch.ipynb
already need:
- pyFAI must be built from source, not installed from a release: the
ImageD11<->pyFAI conversion (pyFAI.geometry.imaged11) only exists on the
as-yet-unmerged kif/doc_calib_ID11 branch of silx-kit/pyFAI, commit 1e06043e4
("upgrade tutorial"; pyFAI.version == 2026.9.0-dev0).
- the raw calibration image, in addition to the eigerSpatial/*.flt peak files:
frame 1 of scan0001/eiger_0000.h5 from the same CeO2_Spatial_distortion_apr2021
dataset referenced in the readme (ESRF path or the Zenodo record), read with
hdf5plugin.
Everything else the notebook needs (newspatial_pyFAI.h5, 1.poni,
fitted_eiger_pars2.dat, ...) it generates itself when run top to bottom.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Wrap ImageD11's t.fit() calls in contextlib.redirect_stdout: Simplex.minimize() prints a "\r"-prefixed progress line per iteration (up to hundreds of lines per fit, with no way to disable it from the caller), which doesn't behave as an overwriting line outside a live terminal - it just floods the saved notebook output. The few genuinely useful prints (peaks kept after outlier rejection, etc.) are left visible outside the redirect. - Drop the `%matplotlib ipympl` cell. It switches to the interactive widget backend for the rest of the notebook, which has no static representation to save - every plot after that cell was rendering blank/disappearing when viewed statically (e.g. on GitHub). Everything now stays on the `%matplotlib inline` set at the top, so all plots are embedded as ordinary static PNGs. Re-executed top to bottom; same results as before (this only touches output formatting), file size roughly halved. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner
Author
|
Clean up the readme to be more concise and wait for @kif to finish up on the pyFAI side, in case we discover more issues to be resolved. |
|
Hi Jon, I read the comment & new cells from your notebook and they look correct. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.