Here are a pair of Jupyter notebooks that were used to fit the spatial distortion of the Eiger4M CdTe detector at ID11.
They work by fitting the diffraction geometry for a series of images of powder patterns with different beam centers.
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 : .
Uploaded to github on 6 Dec 2021 by Jon Wright.