Closed loichuder closed 11 months ago
Hi Loic,
Thanks for highlighting those unconsistencies in the docstring. There are obviouly copy-paste error but maybe more than that ...
The result cannot be 4D (y,x,corner,position) and I except it to be 2D. If the array is 3D, the radial is the index 0 in the last dim thus the scaling (index1 would be the azimuthal angle) thus the scaling. Nota, the scaling would be wrongly applies if ndim=2 and this is a bug. Scaling is True only outside pyFAI, internally, the scale is always applied last (pyFAI works in SI unit all the time and converts the result)
Relevant code:
https://github.com/silx-kit/pyFAI/blob/327676400247078e19268426f94fba978004a2bd/src/pyFAI/geometry/core.py#L876
Short version
Since
center_array
expects to work with a 3D array but I get a 2D array, the unit scaling applied to the last dimension of the resultingcenter_array
is only applied to the first column/row.https://github.com/silx-kit/pyFAI/blob/327676400247078e19268426f94fba978004a2bd/src/pyFAI/geometry/core.py#L919
Long version
Reading
center_array
docstring, the returned array is expected to be 3D.https://github.com/silx-kit/pyFAI/blob/327676400247078e19268426f94fba978004a2bd/src/pyFAI/geometry/core.py#L886
However, reading the code, the returned
ary
comes from theunit.equation
which returns an array with the same dimensionality asx
,y
,z
. Andx
,y
,z
are 2D arrays (ifshape
is a tuple of 2 integers as indicated by the docstring) sincepos
is 3D. Soary
is in fact 2D...To add more confusion, the main part of the docstring indicates that the returned array is 2D.
https://github.com/silx-kit/pyFAI/blob/327676400247078e19268426f94fba978004a2bd/src/pyFAI/geometry/core.py#L878
But perhaps am I missing something in my analysis and/or call of
center_array
?